cancel
Showing results for 
Search instead for 
Did you mean: 

uart request response just during debug and debugger connected

carleslsregner
Associate II

Hello people,

I have been developing a firmware to be used in the stm32g051. One of the features is the ability to respon to request to get information from the uC. I used dma for the uart1 tx and rx.  I was happily developing and testing the new feature added into the stm32g051. Then when I use it without the debugger, it is unable to stablish communications between the PC and the microcontroller. 

The curious thing is the fact that I remove the debugger -I disconnect it- and the communication still works. It is the "reset" without debugger what is unable to stablish the connection.  

I change the clocks following the several  post regarding this problem but the solution still eludes me. 

 

 

 

2 REPLIES 2
Andrew Neil
Super User

@carleslsregner wrote:

The curious thing is the fact that I remove the debugger - I disconnect it - and the communication still works. It is the "reset" without debugger what is unable to stablish the connection.  


Sounds like some timing issue in your startup: the startup will be slower in the debugger.

Instrument your code so that you can see what's happening during startup independent of having the debugger connected.

 

Note that you can connect to a running (or "crashed") system without doing a reset or flash programming:

https://community.st.com/t5/stm32-mcus-embedded-software/processor-stuck-if-i-run-code-without-debugger/m-p/802267/highlight/true#M63401

 

PS:

More on "instrumenting your code" here (from that same thread).

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.

That's a good idea that I miss. I will try right now!