cancel
Showing results for 
Search instead for 
Did you mean: 

Read/Write flash section using CLI

Mkuma.7
Associate III

Hello,

I was trying to program STM32 using CLI, I want to READ/WRITE the memory flash section of STM32

I tried STM32_Programmer_CLI -c port=/dev/ttyS0 -w memory=flash readfile=HS_read.bin address=0x08000000 size=16

STM32_Programmer_CLI -c port=COM15 these commands, but it was showing the following error

Can you help me with what going wrong here?

And also can you help me with the correct STM commands?

11 REPLIES 11
Javier1
Principal

are you using an Stlink? did you tried with CubeProgrammer already?(just checking)

we dont need to firmware by ourselves, lets talk
Mkuma.7
Associate III

I tried STM32_Programmer_CLI -c port=COM15 -w memory=flash readfile=HS_read.bin address=0x08000000

Mkuma.7
Associate III

Hello Javier,

I am using STLINK itself, and verified with CubeProgrammer

MM..1
Chief III

COM USB and other interfaces is designed to use with internal system bootloader, not for direct flash.

This CLI can only over stlink

"C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin\STM32_Programmer_CLI.exe" -c port=SWD mode=UR -d yourbuild.elf -v -g
"C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin\STM32_Programmer_CLI.exe" -c port=USB1 -d yourbuild.elf -v -g
 
here need be MCU in system or compatible bootloader mode

ofcourse many switches instead -d is possible ...

Mkuma.7
Associate III

What exactly I was doing that I need to read the memory flash section and store it in a bin file?

And also How to write a specific value to STM32?

Can you help me with the proper STM32 commands?

How you connect ? This isnt arduino...

run cmd CLI without params and search your syntax, right is

-r 0X80YYYY 16 store.bin

Hello Master Mind,

The right cmd which you sent got worked... thank you

How to write a specific value to STM32 memory flash section?

Can you help me with this?

Mkuma.7
Associate III

Hello Master Mind,

The right cmd which you sent got worked... thank you

How to write a specific value to STM32 memory flash section?

Can you help me with this?

write is more complicated, need erase etc. Based on pages and sectors.

Do what i write run only CLI without params and read showed info.