cancel
Showing results for 
Search instead for 
Did you mean: 

stm32l431 SWD only connects at 5 kHz

CVita.1
Associate

I have a board with an stm32l431rc.

I have some sample code generated by CubeMX, and it boots up just fine.

I'm trying to work with zephyr v2.5.0. Zephyr has hal and pinctrl dtsi files for this MCU, so adding a new board was pretty straightforward.

I start with the MCU running the CubeMX code, then flash zephyr's trivial programs like blinky or hello_world. I see my changes, and everything is good. I can keep reflashing the MCU without issue.

However, if I power cycle the MCU while running zephyr code, SWD will only connect at 5 kHz. Once I use STM32CubeProgrammer to mass erase I can reconnect at 4 MHz.

I'm using ST-LINK/V2 with the latest firmware.

I saw this post and set RCC_HSICALIBRATION_DEFAULT to 0x10, but it didn't change the behavior.

Any advice on anything else to check?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

Does you board clock slowly or use low power modes?

Do you connect NRST on the debug header? This is required for "Connect Under Reset" to actually work.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

2 REPLIES 2

Does you board clock slowly or use low power modes?

Do you connect NRST on the debug header? This is required for "Connect Under Reset" to actually work.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
CVita.1
Associate

@Community member​ ,

I appreciate your quick reply.

Doubled-checked my board today and confirmed NRST is connected.

However, I discovered line has a voltage problem.

Worked around the issue, and I can reconnect at 4 MHz.

Thanks