Associate III
February 6, 2024
Solved
Bug writing to FLASH with the CLI
- February 6, 2024
- 4 replies
- 2826 views
I've noticed what seems to be a bug when writing to flash with the '-w32' flag using STM32_Programmer_CLI. My order of operations is:
- I erase sector 0 of the flash
- I read the first 8 words of Flash and verified that it's erased.
- I write some words to flash with the command:
stm32_programmer_cli -c port=SWD mode=NORMAL reset=HWrst -q -w32 0x08000000 0x00000001 0x00000002 0x00000003 0x00000004 0x00000005
- This write fails with the message:
Error: Failed to download data! If it's a Flash memory, it may be not erased or protected
- I read the first eight words of flash and it has this value:
0x08000000 : 00000001 00000002 00000003 FFFFFFFF
0x08000010 : FFFFFFFF FFFFFFFF 00000000 00000000
So it writes the first three words correctly, skips three words, then fills from 0x0800_000C - 0x0800EC7C with zeros. Certainly not what I expected/hoped!
I've attached a file showing all of the commands and the output. For reference, I'm using the STM32WLE5JC and version 2.15 of STM32CubeProgrammer.
Next, I'll try the -w64 command and see how that works.
