Affordable and flexible platform to ease prototyping using a STM32F401RET6 microcontroller.

Offline KeilMDK5.1 compile and Blink LED problem

27 Feb 2014

I have imported "Nucleo_blink_led" to the online compiler, made .bin file (7560 Bytes), copy it to the Nucleus STM32F401-RE board, it works fine (green LED blinks).

Same example Exported to Keil format. I have used KeilMDK 5.1, It does open fine. It compiles fine and makes "Nucleo_blink_led_NUCLEO_F401RE.bin" (7572 Bytes). But when it is copied to the Nucleo board, green LED does not blink.

ps. Flash loading from Keil does not work ether (Debugger - Cortex-M Error: Flash\STM32F4xx_256.FLM "Cannot Load Flash Device Description !").

27 Feb 2014

Did you install also flash algo? IF you open Debugger settings , do you see the device connected there? Either your flash algo are missing or the device (nucleo board) is not recognized by uVision. Those 2 are my initial guesses. I still don't have this board so can't test it at my desk.

Did you compare those 2 bins, how they differ? Can you debug the program in uVision to find out why LED does not blink?

Regards,
0xc0170

28 Feb 2014

First I thought that possible reason was that I have used Export toolchain "Keil uVision4" because there is no uVision5 option, but in KeilMDK v4.6 it does not even compile (reports bunch of errors), maybe it does not support STM32F401RE like KeilMDK v5.1.

I have installed additionally "Keil.STM32F4xx_DFP.1.0.6.pack" and Flash write in MDK5.1 works fine now.

Now I am able to debug program, and I see that it works fine until the following code line was reached: "wait(0.2);", and execution stops there forever, so the green LED never goes OFF. If I comment these two "wait" lines, the green LED is lighting with 50% intensity.

28 Feb 2014

Solved!

Replaced "wait(0.2);" with "wait_ms(200);" and "wait(1.0);" with "wait_ms(1000);". Now it works fine.

28 Feb 2014

Ok solved for you, but wonder what's wrong. I just received nucleo 401, will test the program you mentioned. It should work in both cases. By default, Floating point is not enabled for 401 target, I would like to enable it. please check FPU settings in your project. Most probably will be issue there.

Where do I get the pack Keil.STM32F4xx_DFP.1.0.6.pack ?

28 Feb 2014

You will find it on their site (http://www.keil.com/dd2/pack/), or direct link (http://www.keil.com/dd2/GetPack/Keil.STM32F4xx_DFP.1.0.6.pack).

By default FPU was enabled in OptionsForTarget > Target > CodeGeneration > FloatingPointHardware = "Use FPU"

If I change it to "Not Used", than the original example with "wait(0.2);" WORKS well also. Don't know why.

16 Mar 2014

dan cervo wrote:

You will find it on their site (http://www.keil.com/dd2/pack/), or direct link (http://www.keil.com/dd2/GetPack/Keil.STM32F4xx_DFP.1.0.6.pack).

By default FPU was enabled in OptionsForTarget > Target > CodeGeneration > FloatingPointHardware = "Use FPU"

If I change it to "Not Used", than the original example with "wait(0.2);" WORKS well also. Don't know why.

I have a same problem :)

19 Mar 2014

@above The FPU needs to be enabled by software. If you use it when it is not enabled it won't work, probably point you towards a fault handler. Guess that part isn't working.

14 Apr 2014

Jeroen Lodder wrote:

By default FPU was enabled in OptionsForTarget > Target > CodeGeneration > FloatingPointHardware = "Use FPU"

If I change it to "Not Used", than the original example with "wait(0.2);" WORKS well also. Don't know why.

same to me :)

"Not Used", works!!

Please log in to post a reply.