Description
Hello,
I'm trying to load a firmware on a nucleo_h743zi
using pyocd
.
When the firmware size is small (blinky, hello world, ~20kB) everything is fine: my firmware is downloaded onto target and runs smoothly.
However, if the firmware gets big (tried with 256k), pyocd
says that it programmed the file correctly, however the firmware does not run or crash (fault trace from zephyr OS).
I dumped the content of my flash and saw that some portions of the flash was left unprogrammed (0xff) or set to 0.
When using openocd
or STM32_Programmer
I do not have that issue.
I tried to increase the size of an hello-world by adding random data at the end and tried programming it with STM32_Programmer_CLI
(it works) and with pyocd
(does not work).
Here are the various command line used:
- Grow small binary file (
hello.bin
):
head -c 200k < /dev/urandom > random.bin
cat hello.bin random.bin >> big_hello.bin
- programming firmware:
pyocd flash -e sector -a 0x8000000 -t stm32h743zitx -O reset_type=hw --pack Keil.STM32H7xx_DFP.2.7.0.pack big_hello.bin
STM32_Programmer_CLI -c port=SWD -d big_hello.bin 0x08000000 -rst
- Dumping memory content:
pyocd commander -c "savemem 0x08000000 220712 dump_with_cmder.bin"
STM32_Programmer_CLI -c port=SWD -u 0x08000000 220712 dump_from_stm32prog.bin
Memory read from the devices is always the same regardless of the method.
Memory written to the device is not correct when using pyocd
.
Let me know if you need additional information.
Thanks.
ps: by now, I also get errors when programming small firmwares.