cancel
Showing results for 
Search instead for 
Did you mean: 

Binary flashing script

GHM
Associate II

How to flash a binary file to the microcontroller with script only ie without STM32Cube IDE & Stm32cube programmer. Please provide a detailed script to flash a given binary saved at a known location

11 REPLIES 11
LCE
Principal II

Start with something simple...

Can you flash the *.bin by copying via Windows explorer to the STLINK drive?

Then doing this by *.bat?

Then build around that.

MM..1
Chief III

O boy , search somebody with basic MSDOS shell know. Dont try scripts without basic info. Flash is simple one line command batch...

"C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin\STM32_Programmer_CLI.exe" -c port=SWD mode=UR -d "pathto your.hex" -v -g

for bin files is required addr to load, too elf can be used instead hex usw.

read complete command help run without params

     [<[start end]>]    : Erase the specified sectors starting from
                          start code to end code, ex: -e [5 10]
 -w,     --write
 -d,     --download     : Download the content of a file into device memory
     <file_path>        : File path name to be downloaded: (bin, hex, srec, s19
                          elf, stm32 or tsv file)
     [<address>]        : Start address of download
 -w64                   : Write a 64-bits data into device memory
     <address>          : Start address of download
     <64-bit_data>      : 64-bit data to be downloaded
                          values should not be separated by space
 -w32                   : Write a 32-bits data into device memory
     <address>          : Start address of download
     <32-bit_data>      : 32-bit data to be downloaded
                          values should be separated by space...