cancel
Showing results for 
Search instead for 
Did you mean: 

UART not sending out messages unless I single step with the debugger

DiBosco
Senior
Posted on April 14, 2016 at 20:02

Folks,

I've been on this problem from over a day and am just utterly bewildered by it. I'm just hoping someone might be able to suggest something that might help me track this down.

I have set up a DMA to send information out of a UART. If I set a break point and step through the code to this line:

DMA_Cmd(DMA_Channel4, ENABLE);

And then step over that with the debugger, the scope shows the 16 bytes I requested sent out exactly correctly.

If I just free run the program nothing goes out. Even if I have the debugger two lines above and hit F5 to resume it won't send.

If anyone can think of anything at all to try I would be most grateful. I've never come across anything like this.

Thanks,

Rob

3 REPLIES 3
TDK
Guru
Posted on April 14, 2016 at 20:47

Something else could be swamping the DMA, preventing it from handing the UART.

You could be reassigning this DMA channel later on which would prevent it from working.

Put a ''while (1);'' loop right after that command and see if it works.  If so, your problem is likely somewhere in the code that follows the command.

Debugging problems often seems perplexing, but just remember there is a reason for the behavior and you just have to find it.  And 99.9% of the time the hardware is not to blame.

If you feel a post has answered your question, please click "Accept as Solution".
DiBosco
Senior
Posted on April 14, 2016 at 22:38

Thanks for the suggestions. I'd already tried that, or something very similar and I'd tried sending out the bytes one at a time rather than by DMA and that didn't work either.

However, it looks as if the issue was an interrupt going off and disabling the UART itself, not the DMA. Seems so obvious now. :~(

Thanks again for the suggestions.

PS Been trying to post this for ages, but the forum's being even more rubbish than normal!

Posted on April 14, 2016 at 22:55

PS Been trying to post this for ages, but the forum's being even more rubbish than normal! 

I believe they are in the process of transitioning to a new web platform. The forum has seemed fairly robust from my location today.

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