Skip to main content
dsjnews
Associate II
June 27, 2012
Question

UART4 interrupts during emulation break

  • June 27, 2012
  • 4 replies
  • 1184 views
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?
    This topic has been closed for replies.

    4 replies

    Tesla DeLorean
    Guru
    June 27, 2012
    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
    dsjnews
    dsjnewsAuthor
    Associate II
    June 27, 2012
    Posted on June 27, 2012 at 14:10

    Many thanks!

    Jo

    Chris1
    Associate II
    June 27, 2012
    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''.

    Tesla DeLorean
    Guru
    June 27, 2012
    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..