Skip to main content
Mkuma.7
Associate III
February 7, 2023
Question

Read/Write flash section using CLI

  • February 7, 2023
  • 8 replies
  • 5304 views

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?

This topic has been closed for replies.

8 replies

Javier1
Principal
February 7, 2023

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

hit me up in https://www.linkedin.com/in/javiermuñoz/
Mkuma.7
Mkuma.7Author
Associate III
February 7, 2023

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

Mkuma.7
Mkuma.7Author
Associate III
February 7, 2023

Hello Javier,

I am using STLINK itself, and verified with CubeProgrammer

MM..1
Chief III
February 7, 2023

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
Mkuma.7Author
Associate III
February 8, 2023

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?

MM..1
Chief III
February 8, 2023

How you connect ? This isnt arduino...

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

-r 0X80YYYY 16 store.bin

Mkuma.7
Mkuma.7Author
Associate III
February 9, 2023

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
Mkuma.7Author
Associate III
February 10, 2023

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?

MM..1
Chief III
February 10, 2023

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.

Mkuma.7
Mkuma.7Author
Associate III
February 15, 2023

Do you know How to read FUS version using STM32 CLI?

Remy ISSALYS
Technical Moderator
February 17, 2023

Hello,

According to UM2237, there isn't any command to read FUS version using STM32 CLI.

Best Regards