ST-Link V2 on Linux/OSX/Windows

This forum is about you. Feel free to discuss anything is related to embedded and electronics, your awesome projects, your ideas, your announcements, not necessarily related to ChibiOS but to embedded in general. This forum is NOT for support.
User avatar
DeusExMachina
Posts: 223
Joined: Tue Apr 03, 2012 5:08 am
Has thanked: 3 times
Been thanked: 3 times

Re: ST-Link V2 on Linux/OSX/Windows

Post by DeusExMachina »

openocd works, debugging works, but... I get the same freezes on chThdSleepMilliseconds. I even tried standard VL_Discovery demo, but I get the same trouble using both st-util and openocd!!!
Now I think that it is arm-none-eabi-gdb bug. So I cant claim st-util for this issue...

Code: Select all

arm-none-eabi-gdb --version
GNU gdb (Sourcery CodeBench Lite 2012.09-63) 7.4.50.20120716-cvs


:(

debuggin locks in chcore_v7m line 262

Code: Select all

    asm volatile ("mov     r0, r5                                 \n\t"
                "blx     r4                                     \n\t"
                "bl      chThdExit");

gdb writes nothing
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: ST-Link V2 on Linux/OSX/Windows

Post by Tectu »

Okay, I think this is definitely a toolchain problem. Don't worry, this happened often. I know over ten people myself which did had strange problem like yours which were caused by their compiler toolchain (CodeSourcery is a real problem to work properly with ChibiOS). The problem can be solved VERY easily. Just use this toolchain here. It even comes with precompiled binaries for Windows, Linux and Mac OSX. The toolchain works out of the box for 100% sure.
Just make sure that you are definitely using the "new" toolchain. Uninstall the old or make sure that it's out of your PATH or what ever your OS uses.


~ Tectu
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: ST-Link V2 on Linux/OSX/Windows

Post by Tectu »

Could this maybe be related? --> viewtopic.php?f=11&t=952&p=9286#p9286


~ Tectu
User avatar
DeusExMachina
Posts: 223
Joined: Tue Apr 03, 2012 5:08 am
Has thanked: 3 times
Been thanked: 3 times

Re: ST-Link V2 on Linux/OSX/Windows

Post by DeusExMachina »

Unfortunately the last version of GNU ARM tools has the same problem...
About your link - sometimes debugger locks in this place too...
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: ST-Link V2 on Linux/OSX/Windows

Post by Tectu »

Giovanni wrote:Probably this depends on the FPU settings, in the Makefiles is automatic but in IAR project you have to enable disable the FPU both the compiler settings AND correctly defining CORTEX_USE_FPU.

If the two mismatch then the port crashes.

Giovanni


What IDE are you using? You might want to check your FPU settings.


~ Tectu
User avatar
DeusExMachina
Posts: 223
Joined: Tue Apr 03, 2012 5:08 am
Has thanked: 3 times
Been thanked: 3 times

Re: ST-Link V2 on Linux/OSX/Windows

Post by DeusExMachina »

I use Eclipse. Chibios 2.4.3
Under Windows the same code compiles and debugs well, using Atollic gdb server + CodeSourcery toolchain... make file from VL-Discovery demo
Last edited by DeusExMachina on Wed Feb 20, 2013 10:08 am, edited 1 time in total.
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: ST-Link V2 on Linux/OSX/Windows

Post by Tectu »

Did you check your Makefile setting? What MCU do you use? Might it be that you have the FPU turned on but the MCU dosen't have any? Also, try to disable it for a simple test if it's turned on anyways.


~ Tectu
User avatar
DeusExMachina
Posts: 223
Joined: Tue Apr 03, 2012 5:08 am
Has thanked: 3 times
Been thanked: 3 times

Re: ST-Link V2 on Linux/OSX/Windows

Post by DeusExMachina »

Tectu wrote:Did you check your Makefile setting? What MCU do you use? Might it be that you have the FPU turned on but the MCU dosen't have any? Also, try to disable it for a simple test if it's turned on anyways.


~ Tectu

Yes, it is regular VL-discovery demo with regullar STM32F100VLdiscovery... So no FPU settings in makefile present
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: ST-Link V2 on Linux/OSX/Windows

Post by Tectu »

Giovanni, could you please jump in here?


~ Tectu
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: ST-Link V2 on Linux/OSX/Windows

Post by Giovanni »

If the demo works under windows then this is not a problem with the demo itself, it must be related to the toolchain or the software used to flash.

Last time I worked with Linux I used CodeSourcery and OpenOCD.

Giovanni
Post Reply