cancel
Showing results for 
Search instead for 
Did you mean: 

Application doesn't run, unless connected by STLINK or in Debug Mode

wuliang
Associate
Posted on May 28, 2015 at 18:53

Hi,

I just got my new STM32F4 discovery board, i wrote a LED test program with CoIDE and flashed it, but LED didn't toggle, even i try to press RESET button. Then i go to debug mode and click run, it starts to toggle. I plug out the power and plug in again, it doesn't toggle, after i open the STLINK Utility and click connect, it starts to run. 

Could anyone tell me what is the problem? Is it something to do with Bootloader? 

Thanks.
4 REPLIES 4
Posted on May 28, 2015 at 19:00

Is it something to do with Bootloader?

Unless you've strapped BOOT0 High, then no.

Look more carefully at your code, specifically that you enable all the clocks you are using. The debugger enables things it needs to function, the side effect is that things you're using may also start working despite your code being incomplete/wrong.

Short of that you'll need to waypoint your code with GPIO, LED or USART output so you can understand where it got to or stopped.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
wuliang
Associate
Posted on May 28, 2015 at 20:32

You are right, was a pin configuration error. Now it is working:) Thank you very much.

AvaTar
Lead
Posted on May 28, 2015 at 20:54

Do you have any semihosting libs/code in your project ?

Try removing it, and rebuild.

Check your startup code.

Not sure what Coocox provides, some toolchains (like Crossworks) add a ''catch loop'' at the very beginning, to prevent bad code from locking out the debugger.

EDIT: realized it's already solved ...

Posted on May 28, 2015 at 21:13

Assuming this is an STM32F429I-DISCO not an STM32F4-DISCO

There's some C++ and CooCox style I don't care much for, but it looks reasonable enough. Try the attached .HEX

________________

Attachments :

STM32F429I-DISCO-LEDS.hex : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I1Lq&d=%2Fa%2F0X0000000blh%2F0K7dOYknvQPEUd5BSLG2REOLU20s.wy98WUQw3Dqlc4&asPdf=false
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..