I’m using an STLink V2 to debug my code on an STM32F207 chip. If I modify code and then Start Debugging from the toolbar, it rebuilds then uploads code to the target and I can debug just fine.
Problem: If I merely build the code and then try to only Upload the .bin file. It proceeds and says upload successful (here are last lines of output):
debug_level: 1
hla_swd
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080001a0 msp: 0x20004cf0
** Programming Started **
** Programming Finished **
** Verify Started **
** Verified OK **
** Resetting Target **
shutdown command invoked
As soon as this completes, the target application is dead, won’t run at all. Tried hardware resetting to no avail. It almost seems like the Upload process is putting the binary into the wrong areas of the mcu flash.
Is there a way I can look at what the Upload command is doing?
Is there a also a way to tell the Upload task where the base flash address should be?
The platformio.ini file default_envs points to an [env:debug] section that uses
extra_scripts =
${common.extra_scripts}
buildroot/scripts/stm32f2xx_0x8000_iap.py
The custom py script sets FLASH: ORIGIN = 0x8008000 in the link script and maybe this
doesn’t get picked up when running the Upload command?
I’m lost at this point and and any thoughts are appreciated,
thanks.