cancel
Showing results for 
Search instead for 
Did you mean: 

nucleo's stlink not working while mcu sleeps

carleslsregner
Associate III

Greetings, 

I know how to solve it , but I do want to reseach on this issue. I use a nucleo's stlink (nucleo F070RB) to program a stm32g030k8tx. 

However, the target is only detected and, therefore programmed, when the external mcu is not on standby mode. 

Could it be becasue I do not use the NRST on the SWD? I just use Software Reset, instead. 

 

Thanks. 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Andrew Neil
Super User

As @Peter BENSCH said, the debug (including programming) is not accessible when the CPU is asleep.

See this recent post (for a different STM32, but the principle is the same).

 

AndrewNeil_0-1768406056611.png

https://www.st.com/resource/en/reference_manual/rm0454-stm32g0x0-advanced-armbased-32bit-mcus-stmicroelectronics.pdf#page=973

via: https://www.st.com/en/microcontrollers-microprocessors/stm32g030k8.html#documentation

This is what the 'Debug in low power modes' CubeIDE setting does:

AndrewNeil_2-1768406329237.png

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

View solution in original post

2 REPLIES 2
Peter BENSCH
ST Employee

If the target is in sleep mode, it can only be brought out of this state by resetting it. Therefore, NRST must be connected and the debugger must be set to ‘Connect under Reset’.

Regards
/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Andrew Neil
Super User

As @Peter BENSCH said, the debug (including programming) is not accessible when the CPU is asleep.

See this recent post (for a different STM32, but the principle is the same).

 

AndrewNeil_0-1768406056611.png

https://www.st.com/resource/en/reference_manual/rm0454-stm32g0x0-advanced-armbased-32bit-mcus-stmicroelectronics.pdf#page=973

via: https://www.st.com/en/microcontrollers-microprocessors/stm32g030k8.html#documentation

This is what the 'Debug in low power modes' CubeIDE setting does:

AndrewNeil_2-1768406329237.png

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.