Tutorial - How to upload arbitrary data to STM32F4 Flash Memory

Uploading binary data to a desired address


Gecho has one megabyte of FLASH memory, and only a fragment is occupied by standard firmware.

You might need to use this process, if:

  • you wish to extend the functionality
  • you need to store larger amount of data
  • it is not handy to pack data into source files (as constants etc.)
  • you want to be able to replace this data without interfering with firmware

Connect your SWD Programming Adapter and start STM32 ST-LINK Utility.

Into the "Size" field, enter 0x100000 - this is a full range of FLASH memory available in our MCU - and click "Connect to the target" icon.

You should see data appearing - this means the SWD communication works.

Now, click on "Binary file" tab, a dialog will appear, and after you select your *.bin file, preview shows up.

Click "Program verify" icon.

In the pop-up dialog, enter new value to "Start address" field. This should be an address of memory in the upper part, unoccupied by your program code. For example. 0x080A8000. Click "Start".

If successful, you will see this message appearing down in the debug info panel.

Your code will now have access to new data. Click "Disconnect" and close the program.

All done!