cancel
Showing results for 
Search instead for 
Did you mean: 

Stm32f429 discovery only run at download and debug mode

to_sam_kim
Associate II
Posted on April 19, 2015 at 23:45

Hello,

I'm using IAR and I configured stm32f429 discovery board by STCubeMX and its libraies.

It seems to work fine when I run my code with Download and Debug mode.

But when I exit debug mode the board stop running immediely even if I downloaded my code into flash memory.

I have no idea what I shoud fix in order to make the board run without debug mode. 

Please help if anyone know about this issue. 

Best regards,

 

#stm32f429 #st32f4
5 REPLIES 5
Posted on April 20, 2015 at 01:45

For code that only runs in debug mode you'd want to double check for clocks being enabled, and code that's time sensitive.

To troubleshoot you may want to try other methods of indicating progress through your code, ie GPIO or USART output.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
to_sam_kim
Associate II
Posted on April 20, 2015 at 03:46

Always thank you for your help.

Do you mean set USART and see if communication success in debug mode?

If not, can I assume my RCC clock setup is wrong?

Actually, I used STcubeMX to configure the board initially and then I manually added stm32f429 discovery library for LCD and gyro. Do you think it could be problem? 

Best regards,

P.S: I put two LED blinking code. LEDs are also blinking only at debug mode.

Posted on April 20, 2015 at 14:45

I wouldn't assume anything, you need to analyze what's happening and why.

I've suggested a couple of things that might be issues, but I have no insight into your code/system.

With systems that are difficult to debug I tend to use a USART to output information, this requires that it is set up early, and might be done without library code. A slightly simpler alternative is to use GPIO pin(s).

I would also suggest walking through the code from the ResetHandler to some other checkpoint in the code, and confirm there are no infinite loops, and that clocks are enabled before use. I'd also have the Hard Fault Handler signal in some fashion so I could see if any gross errors ended up there.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
stm32forum
Associate II
Posted on April 21, 2015 at 15:14

Don't forget to remove the semihosting lib in your release build.

to_sam_kim
Associate II
Posted on April 25, 2015 at 03:08

Thanks everyone for help.

Finally, I found the problem. I used printf for degugging.

this printf stops my system when I leaev debug mode.

I don't know a specific reason yet.

But, I removed the printf and it fixed my problem.

Thanks again.