cancel
Showing results for 
Search instead for 
Did you mean: 

Capture STM32F405xx Firmware with ST-Link Utility

FPayn.1
Associate III

I have your ST-LINK Utility connected to the STM32F405xx MCU on my FlashForge Creator Pro 2 3D printer (see screenshot below) and I want to capture the current firmware contents so I can revert to it if a planned firmware upgrade is unsuccessful.  

The initial 'memory grid' display utility showed the memory from 0x8000000 to 0x8001000, and I tried saving this using 'File-Save As'.  However, the saved file is only 4K bytes, and I was concerned that I'm only saving the first 4KB of a larger firmware image.  Then I tried editing the 'Size' field to larger and larger values, and eventually got to the point where I saw a full row of '0000000's starting at 0x0800C6F0, and then rows of 'FFFFFFF's, starting at 0x0800C6F0 (see second image below).  Then when I did another 'Save', the saved file size was 50KB rather than the 4KB from the first one.  Is it safe to assume that saving everything up to the point where the display changes to 'FFFFFFF's gets the entire firmware image?

Assuming I have captured the entire firmware image correctly, am I correct in thinking that using the 'Target -> Program' command with the start address set to 0x08000000' and the file path set to point to the above uploaded binary will correctly revert whatever I have in the MCU to its original state?

TIA,

Frank

 

 

ST-LINK_Display.png

ST-LINK_Display_0xF000.png

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

Is it safe to assume that saving everything up to the point where the display changes to 'FFFFFFF's gets the entire firmware image?

Typically, yes, not but 100%. You could save the entire 2MB to be safe, but it's not likely there are things beyond that. Since it's easy to do, I would save the entire thing (size of 0x200000, might need to split it into two sections). Possibly the last page is used to store user data.

> Assuming I have captured the entire firmware image correctly, am I correct in thinking that using the 'Target -> Program' command with the start address set to 0x08000000' and the file path set to point to the above uploaded binary will correctly revert whatever I have in the MCU to its original state?

Yes, exactly.

ST-Link Utility is deprecated, but it works on the STM32F4 if you have a compatible firmware.

Consider using STM32CubeProgrammer.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

2 REPLIES 2
TDK
Guru

Is it safe to assume that saving everything up to the point where the display changes to 'FFFFFFF's gets the entire firmware image?

Typically, yes, not but 100%. You could save the entire 2MB to be safe, but it's not likely there are things beyond that. Since it's easy to do, I would save the entire thing (size of 0x200000, might need to split it into two sections). Possibly the last page is used to store user data.

> Assuming I have captured the entire firmware image correctly, am I correct in thinking that using the 'Target -> Program' command with the start address set to 0x08000000' and the file path set to point to the above uploaded binary will correctly revert whatever I have in the MCU to its original state?

Yes, exactly.

ST-Link Utility is deprecated, but it works on the STM32F4 if you have a compatible firmware.

Consider using STM32CubeProgrammer.

If you feel a post has answered your question, please click "Accept as Solution".
FPayn.1
Associate III

Thanks Guru - you answered my question completely.  l did try using STM32CubeProgrammer, but I couldn't get it to connect to my MCU.  The ST-LINK Utility connected on the first try.  I like your idea of capturing the entire 2MB memory space - I think I'll do that in addition to capturing up to the 'FFFFFFFF' rows.

Frank