cancel
Showing results for 
Search instead for 
Did you mean: 

UART4 interrupts during emulation break

dsjnews
Associate III
Posted on June 27, 2012 at 11:19

Hi,

I am using the Keil ARM MDK development tool with an STM32F103ZG microcontroller and ULINK Pro JTAG. I have some UART code that I would like to test which requires the generation of UART transmit and receive interrupts whilst the emulator has stopped on a code breakpoint. Is there a way to generate transmit or receive interrupts when the emulator has stopped at a breakpoint?
4 REPLIES 4
Posted on June 27, 2012 at 13:42

No, stopping the core is invasive. Things like watchdogs can be stopped or enabled during debug as they are independently clocked peripherals rather than executing code.

If you need real-time diagnostics the cheap route is to instrument your code and output telemetry via another serial port to understand code flow and interaction. The expensive route is to use trace hardware and analyze what has happened.

The USART could be serviced by DMA, but that will be limited to the resources you had set up prior to stopping.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
dsjnews
Associate III
Posted on June 27, 2012 at 14:10

Many thanks!

Jo

Chris1
Senior III
Posted on June 27, 2012 at 20:55

Telemetry via the SWO (Serial Wire Output) port should be possible with the Ulink.  That should be less intrusive to your application than using another USART.  See ST Technical Note TN0132 [Doc ID 16243] ''STM32 Serial Wire Viewer and ETM capabilities with EWARM 5.40 and MDK-ARM 3.70''.

Posted on June 27, 2012 at 21:37

I've tried to make the ITM SWV work on a couple of occasions without much joy, not sure if I have the wrong ULink version or firmware, or if it doesn't work with eval releases. Without an interrupt or a buffer behind it a real serial port is preferable if available.

Link to the mentioned tech note

http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/TECHNICAL_NOTE/CD00248035.pdf

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