cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L4 The firmware does not start automatically after being programmed if ST-LINK_CLI.exe is used, unless...

BenBel
Associate II

I use ST-Link/V2 with ST-LINK_CLI.exe to program my firmware into a STM32L452.

The command I use is: ST-LINK_CLI.exe -P Myfile.hex -V -Rst

Programming works fine, no error. But at the end I’m expecting my firmware to start running automatically and as soon as ST-LINK_CLI finishes its job, especially because of the -Rst parameter (I’ve also tried with -HardRst and I got the same result).

Pin BOOT0 of my STM32L452 is always tied low through a pulldown resistor.

The only way to get my firmware running is by doing a power-off reset of my board. Strangely if I re-program the same board (after the power-up reset), then it will start running automatically after ST-LINK_CLI.exe finishes its job (no need to do any more power-up reset).

The pattern is repeatable, meaning if I program a board for its very first time, I must do a power-up reset for my firmware to start running. The same board, if re-programmed, will then automatically start running as soon as ST-LINK_CLI finishes.

Why and what can I do to make any board programmed for its very first time to start running automatically after ST-LINK_CLI finishes?

Thanks in advance for your help.

Ben

3 REPLIES 3
BenBel
Associate II

I didn't find an explanation of this behaviour but using the -Run parmeter when invoking ST-LINK_CLI.exe solved my problem.

I have the same problem, but I'm running the ST-Link from a python script file using the '-Run' option puts me in interactive mode which won't work for me.

Likely relates to the memory mapping and SCB->VTOR settings. Perhaps also a watchdog.

In these parts if the FLASH is blank it runs the System Loader in ROM regardless of the BOOT0 setting.

Perhaps make sure VTOR and SYSCFG settings are better aligned with running from FLASH, and do so in the Reset Handler.

I think the Options Bytes get loaded at Power Cycle, not reset.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..