Skip to main content
Associate
May 14, 2024
Solved

STM32 Debugging not available

  • May 14, 2024
  • 4 replies
  • 5142 views

I am using STM32G031J6M6 and using NRST pin as GPIO.

I have been unable to connect to STM32CubeIDE, CubeProgrammer and ST-Link Utility since then, probably because I executed __WFI() in the program.

CubeProgrammer error code

STM32 target not found! If your product has debug authentication built in, please use debug authentication to run detection.”

I did a lot of research and could not connect to either Software/HardwareReset.

Please share your wisdom on how to connect and debug.

Best answer by Uwe Bonnes

Have a look at https://community.st.com/t5/stm32-mcus-products/need-a-clarification-on-nrst-mode-functionality/td-p/249891 too


Upon power reset or wakeup from shutdown mode, the NRST pin is configured as Reset input/output and driven low by the system until it is reconfigured to the expected mode when the option bytes are loaded, in the fourth clock cycle after the end of trstempo.

4 replies

Uwe Bonnes
Chief
May 14, 2024

Did you try "Connect under reset"? I assume that G0 only remaps NRST after it has booted...

wataoAuthor
Associate
May 14, 2024

Thanks I already tried that but still no connection...

Andrew Neil
Super User
May 14, 2024

@watao wrote:

Please share your wisdom on how to connect and debug.


FWIW, my wisdom says that repurposing NRST is highly un-wise!

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.
wataoAuthor
Associate
May 14, 2024

I regret that I should not have tinkered with the NRST during debugging

Andrew Neil
Super User
May 14, 2024

An older & wiser engineer once said to me:

"if you don't have enough resources to dedicate 10% to debug/diagnostics,
then you don't have enough resources"

in that context, "resources" includes pins.

 

#DebugResources #Diagnostics

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.
Uwe Bonnes
Chief
May 14, 2024

Sorry, Connect under reset will not work with NRST remapped without reboot. Can you unpower the board, pull NRST low, repower and than connect under reset and remove the NRST pull?

wataoAuthor
Associate
May 14, 2024

I tried but still could not connect.
I have a Nucleo ST-Link, so I tried connecting to another STM, which was recognized with no problem...

 

Andrew Neil
Super User
May 14, 2024

@watao wrote:

 I tried connecting to another STM, which was recognized with no problem...


Was that STM running the same code?

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.
Uwe Bonnes
Uwe BonnesBest answer
Chief
May 14, 2024

Have a look at https://community.st.com/t5/stm32-mcus-products/need-a-clarification-on-nrst-mode-functionality/td-p/249891 too


Upon power reset or wakeup from shutdown mode, the NRST pin is configured as Reset input/output and driven low by the system until it is reconfigured to the expected mode when the option bytes are loaded, in the fourth clock cycle after the end of trstempo.
wataoAuthor
Associate
August 26, 2024

It's been a while.
I had given up trying to solve this problem, but I confirmed that NRST was enabled immediately after startup, and after trying to connect with CubeProgrammer, I was able to control it successfully!
Thank you very much.