I have some hardware that has an STM32 chip in it. I normally use an ST Link/V2 USB programmer and STM32CubeProgrammer to flash the firmware file. In this case, it'a 152KB file with the extension .out.
Flashing via STM32CubeProgrammer works fine. I'm now trying to automate the process and write a bash script to flash the devices using stlink tools.
I try to use the command st-flash --reset write filename.out 0x08000000 but receive the errors:
2023-03-23T16:33:28 INFO common.c: Attempting to write 156016 (0x26170) bytes to stm32 address: 134217728 (0x8000000)
2023-03-23T16:33:28 ERROR common.c: addr too high
2023-03-23T16:33:28 INFO common.c: Go to Thumb mode
The output from the STM32CubeProgrammer software when successfully flashing the file says:
16:42:43 : Memory Programming ...
16:42:43 : Opening and parsing file: node_1_15.out
16:42:43 : File : filename.out
16:42:43 : Size : 12.80 KB
16:42:43 : Address : 0x08000000
16:42:43 : Erasing memory corresponding to segment 0:
16:42:43 : Erasing internal memory sectors [0 102]
16:42:43 : Download in Progress:
16:42:44 : File download complete
As far as I can tell, the starting memory address is the same, the file is the same and it's the same programmer. I can't see why STM32CubeProgrammer shows a much smaller file size however (12.8KB vs 152KB).
Can anyone offer any guidance as to how I can proceed?