Hello,
I recently transferred to Platformio from the CubeIDE for a project with the STM32G431CB. When I try to upload or debug my program on the unit it gets uploaded fine but doesn’t execute. I checked with CubeProgrammer that the upload actually is happening. The program executes properly when I try to debug through CubeIDE. After investigating I found out that the first line of the reset handler throws an exception. The reset handler is exactly the same as used in the CubeIDE project. I’m using SWD with a 4 wire config. I’m suspecting that I’m missing an option from my ini file that alters the upload / reset process.
The contents of my ini file are:
[env:genericSTM32G431CB]
platform = ststm32
board = genericSTM32G431CB
framework = stm32cube
upload_protocol = stlink
debug_tool = stlink
debug_init_break =
Debug view after exception on first line of reset handler:
Debug output:
Reading symbols from C:\Users\Tom\Desktop\LED_G431CB\.pio\build\genericSTM32G431CB\firmware.elf...
done.
PlatformIO Unified Debugger -> https://bit.ly/pio-debug
PlatformIO: debug_tool = stlink
PlatformIO: Initializing remote target...
xPack Open On-Chip Debugger 0.12.0-01004-g9ea7f3d64-dirty (2023-01-30-15:04)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
hla_swd
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : tcl server disabled
Info : telnet server disabled
Info : clock speed 2000 kHz
Info : STLINK V2J43M28 (API v2) VID:PID 0483:374B
Info : Target voltage: 3.234098
Info : [stm32g4x.cpu] Cortex-M4 r0p1 processor detected
Info : [stm32g4x.cpu] target has 6 breakpoints, 4 watchpoints
Info : starting gdb server for stm32g4x.cpu on pipe
Info : accepting 'gdb' connection from pipe
[stm32g4x.cpu] halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x1fff44ea msp: 0x20002cd8
Info : device idcode = 0x20036468 (STM32G43/G44xx - Rev 'unknown' : 0x2003)
Info : RDP level 0 (0xAA)
Info : flash size = 128 KiB
Info : flash mode : single-bank
Info : device idcode = 0x20036468 (STM32G43/G44xx - Rev 'unknown' : 0x2003)
Info : RDP level 0 (0xAA)
Info : OTP size is 1024 bytes, base address is 0x1fff7000
Warn : keep_alive() was not invoked in the 1000 ms timelimit. GDB alive packet not sent! (1026 ms). Workaround: increase "set remotetimeout" in GDB
0x1fff44ea in ?? ()
PlatformIO: Initialization completed