I am new to development with mbed. I started a new project and used
https://github.com/ladislas/mbed-cmake-template by @ladislas as a basis, as I need to connect several devices that share a good amount of code. So far everything worked really nicely.
However, I have a problem flashing my STM32L432 using openocd. After the first time I flash, openocd can no longer connect to the device (unless I press the reset button). I have the suspicion that SWD gets disabled.
After this I can only flash using the CubeIDE or Mbed studio.
So I am clearly doing something wrong.
My openocd call looks as follows:
openocd -f openocd.cfg -c 'program $(BIN_PATH_BACK) 0x08000000' -c exit
openocd.cfg contains this:
# This is a ST NUCLEO L432KC board with a single STM32L432KCU6 chip. # This is for using the onboard STLINK/V2 source [find interface/stlink.cfg] transport select hla_swd # increase working area to 48KB set WORKAREASIZE 0x0c000 # chip name set CHIPNAME STM32L432 source [find target/stm32l4x.cfg] # use hardware reset reset_config srst_only srst_nogate
Any hint how to solve this?