Page 9 of 12

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

Posted: Wed Feb 20, 2013 5:52 am
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

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

Posted: Wed Feb 20, 2013 8:00 am
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

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

Posted: Wed Feb 20, 2013 9:29 am
by Tectu
Could this maybe be related? --> viewtopic.php?f=11&t=952&p=9286#p9286


~ Tectu

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

Posted: Wed Feb 20, 2013 9:47 am
by DeusExMachina
Unfortunately the last version of GNU ARM tools has the same problem...
About your link - sometimes debugger locks in this place too...

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

Posted: Wed Feb 20, 2013 9:58 am
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

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

Posted: Wed Feb 20, 2013 10:01 am
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

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

Posted: Wed Feb 20, 2013 10:03 am
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

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

Posted: Wed Feb 20, 2013 11:39 am
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

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

Posted: Wed Feb 20, 2013 12:39 pm
by Tectu
Giovanni, could you please jump in here?


~ Tectu

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

Posted: Wed Feb 20, 2013 1:39 pm
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