cancel
Showing results for 
Search instead for 
Did you mean: 

Can you change how ST-Link Utility saves readback of flash

JBlackann
Associate III

0690X000006CLl9QAG.pngHello,

I am guessing I am missing some setting somewhere but I am not unable to find how to change how ST-Link Utility saves a readback of flash. So I am working on a bootloader application. My application is capable of writing the flash, I was just using ST-Link Utility to confirm that the flash was written correctly. Just to verify things a small snippet of code is supposed to write 4 lines of flash starting at address 0x08008000. Attached is the file named user_app_nucleo_401RE_Starts_at_0x08008000__4_lines.hex

I then can look in ST-Link Utility and see that flash has been updated and appears to match what my hex file contained.

Now I wanted to save this using File - Save file as. When I do this it saves the hex file but appears to write the hex file as 32 bytes wide instead of 16 bytes wide. I am trying to just compare the two files and because they are different lengths for each line I can't use a program like Beyond Compare to quickly compare the files. I can visually hold one over top of the other to confirm that they match.

My question is can I do something to save the file differently so that it matches my file that I started with. I want the file produced by ST Link Utility to make a file that only has 16 bytes of data in each line.

Please see the attached screen shots and attached files.

I originally was using ST Link Utility V4.2.0. I updated to V4.3.0 and the program works the same way in both versions.

Thanks.

2 REPLIES 2
JBlackann
Associate III

An update.

I contacted support and they responded with the following.

"Hi, I find no way to change the save as block size to 16 instead of 32 using stlink utility. I will submit a request to see if this feature can somehow be added. In case you are needing this format I did find a utility at source forge that can convert the format for you. https://sourceforge.net/projects/srecord/ It is precompiled for windows so no need to recompile it.   There is a built in command Output_Block_Size=16 which can force the output to 16 bytes instead of 32. Looks like it can be abbreviated as -obs from the example shown. Example: I first created a dump.hex file of 100 bytes using the Command Line Interface of stlink. C:\Program Files (x86)\STMctroicroelenics\STM32 ST-LINK Utility\ST-LINK Utility>ST-LINK_CLI.exe -c ID=0 SWD UR -Dump 0x08000000 0x64 "C:\Program Files (x86)\STMicroelectronics\STM32 ST-LINK Utility\ST-LINK Utility\dump.hex" Taking this dump.hex file and running it through srec_info shows C:\Users\<user_name>\Documents\MCD\download\SRecord>srec_info dump.hex -intel Format: Intel Hexadecimal (MCS-86) Data:  08000000 - 08000063 Converting it to 16 bytes block size. C:\Users\<use_name>\Documents\MCD\download\SRecord>srec_cat dump.hex -intel -o newdump.hex -intel -obs=16 This newdump.hex file should be giving you what you are looking for. 

Regards, ST MCU Support Team"

I went to sourceforge and found the SRecord application referenced. I downloaded the application, placed the file I wanted to examine (the file referenced as dump.hex from the support person), opened a command prompt and ran the command "srec_cat dump.hex -intel -o newdump.hex -intel -obs=16" as listed by support. The new newdump.hex file that was created was then compared against my initial hex file and it compared exactly correct for the lines of data that existed in my original file. The newdump.hex was much longer than my initial hex file (which was only 3 lines of data).

The program I used for dumping a comparison of the hex files was BeyondCompare from ScooterSoftware.

I hope that ST makes a change to the Utility application as it is just annoying to have to go through this initial step.

Thanks.

JBlackann
Associate III

0690X000006CNHwQAO.png