cancel
Showing results for 
Search instead for 
Did you mean: 

How to load bin file to memory

lukasz2
Associate III
Posted on July 11, 2014 at 11:28

Hello,

I use STM32F103 uC and I want to load pattern file to memory at address 0x08010000 (FLASH area). I want to do it in simulation.

I converted my pattern bin file to hex format by using bin2hex from

http://www.ht-lab.com/freeutils/bin2hex/bin2hex.html

:

bin2hex.exe pattern.bin output.hex -s 0801 -o 0000

When I use type the command: Load ''C:\\output.hex'' in Keil Command window I do not get answer. In the Memory window data do not change. I tried to load this pattern file to address 0x2000000 (RAM area) with no effect too.

Please help how to do this.

#stm32-flash-load-file
3 REPLIES 3
Posted on July 11, 2014 at 13:04

If you are using an ST-LINK, you could use the ST-LINK Utilities to download arbitrary binary or hex data to flash.

A J-Link has similar tools.

You could use a USART with the System Loader, and the Flash Demonstrator Application.

You could add a feature in your firmware to accept a download and flash it to memory, in a similar fashion to an IAP solution/example.

I'd imagine there's a way to do it with the Keil LOAD command, but I'd have to review the documentation, and output from your hex converter to be sure you're doing it right.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
chen
Associate II
Posted on July 11, 2014 at 13:07

Hi

''I use STM32F103 uC and I want to load pattern file to memory at address 0x08010000 (FLASH area).''

If you are using the ST-Link to debug, then the Utility program 'ST Link Util' that comes with it should be able to load an Intel Hex file and program it into memory.

''I want to do it in simulation.''

Do not know what you mean by this statement.

lukasz2
Associate III
Posted on July 11, 2014 at 13:38

I loaded successfuly file using ST-LINK Utility. I tried it before and I got wrong format error because my pattern file has not .bin extension. Thanks