cancel
Showing results for 
Search instead for 
Did you mean: 

How to write bytes to flash without restart?

ADiet.1
Associate III

I am trying to use the windows version of STM32_Programmer_CLI.exe (version 2.13.0) to write bytes to a flash (windows 10). The command I am using is like

./STM32_Programmer_CLI.exe -c port=SWD mode=HOTPLUG -w8 0x08080000 0x00 0x00 0x00 0x00 0x00 0x00 -w8 0x08080C00 0xAA 0x00 0x00 0x00 0x00 0x00 -v

and although I use the "mode=hotplug", each time I run this command a restart is triggered. I did expect no restart when using "mode=hotplug".

Can I try something else to be sure to avoid a restart/reset?

13 REPLIES 13

Hello,

so this restart could be caused by the software on the device. But for this top happen the mcu must be put in a `halt` state. So how can I run this above command without putting the microcontroller in any halt state? I tried different options and even tried with `--run`, but it does not seem to work...

Sara BEN HADJ YAHYA
ST Employee

Hello @ADiet.1​ ,

When using the Hotplug mode, connection to the target is done without a halt nor a reset. From CubeProgrammer side I can assure you that there is no isse in the HotPlug connection mode.

In your case, a reset is triggered and from you're saying it is probably caused by the software, if that is the case, the halt could be also triggered by the software.

You can use the "-score" command to check the core status (�?Running�?, �?Halted�?, �?Locked up�?, �?Reset�?, or �?Kept under reset�?).

At this level, I can confirm that the issue is not related to the CubeProgrammer tool, I suggest you review the software that can contain the root cause of the problem. 

Thank you for your contribution to the ST community, if you have another issue, please do not hesitate to create another thread.

Sara.

Hello again,

there is still the issue with the above mentioned error I get when writing to the mcu, and I do not understand what a "core locked up" means for the core status.

I also tried to write bytes without any additional option, but I also used "-run", "-step" and "-halt" and in every case I get a core status "Core locked up". What does it mean?

Alternate approach, your firmware could facilitate the writing of these values via a console or user interface during final test, etc​

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