This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Output data via SWO without debugger ?

Note: This was originally posted on 15th November 2010 at http://forums.arm.com

Hello,

i am using a Cortex-M3 (in my case a TI Stellaris LM3S9B92 Rev B1).
I would like to know, if it is possible to output data via SWO without a debugger ?
Do i need any clocks (via SWD) from outside (normally generated by the debugger) to output data via SWO (UART, not Manchester) ?

I already tried the following from inside Cortex-M3:

In setup:

#define TRCENA       0x01000000

#define DEMCR     (*((volatile unsigned long *)(0xE000EDFC)))
#define TRACE_ENABLE_REGISTER     (*((volatile unsigned long *)(0xE0000E00)))
#define TRACE_CONTROL_REGISTER       (*((volatile unsigned long *)(0xE0000E80)))
#define ASYNC_CLOCK_PRESCALER_REGISTER  (*((volatile unsigned long *)(0xE0040010)))
#define SELECTED_PIN_CONTROL_REGISTER   (*((volatile unsigned long *)(0xE00400F0)))

             DEMCR = DEMCR | TRCENA;

             TRACE_ENABLE_REGISTER = 0xFFFFFFFF;

             TRACE_CONTROL_REGISTER = 0x00000001;

             ASYNC_CLOCK_PRESCALER_REGISTER = 10;

             SELECTED_PIN_CONTROL_REGISTER = 0x00000002;

In main loop:

   if (DEMCR & TRCENA)
   {
     while (ITM_Port32(0) == 0);
     ITM_Port8(0) = 0x41;
   }


But i don't see any activity on SWO, nor is the line switched to output at all...

Best regards,

Martin
Parents
  • Note: This was originally posted on 16th November 2010 at http://forums.arm.com

    Hi Martin,

    Yes, if the debug interface is in JTAG mode, there is a switching sequence to switch it to Serial Wire model.

    (http://infocenter.arm.com/help/topic/com.arm.doc.ddi0316d/Chdhfbhc.html)

    Depends on the TDO/SWO output connection design, I guess the pin is used as JTAG TDO unless the debugger switch it to serial wire debug mode.
    Unfortunately there is no way to control the switching by software. (It is not impossible, but I don't think any Cortex-M3 microcontrollers has such programmable register in the system level design to override the TDO/SWO usage.  It is just something that we don't expect users to do.).

    It you really want to, you can try to put two jumpers on your PCB to connect TMS and TCK to I/O port and switch it to serial wire mode by software. (Without a debugger connected of course).

    May I ask you why do you want to use the ITM without a debugger? :-)
    (I suppose you could use a UART for text output?)

    regards,
    Joseph
Reply
  • Note: This was originally posted on 16th November 2010 at http://forums.arm.com

    Hi Martin,

    Yes, if the debug interface is in JTAG mode, there is a switching sequence to switch it to Serial Wire model.

    (http://infocenter.arm.com/help/topic/com.arm.doc.ddi0316d/Chdhfbhc.html)

    Depends on the TDO/SWO output connection design, I guess the pin is used as JTAG TDO unless the debugger switch it to serial wire debug mode.
    Unfortunately there is no way to control the switching by software. (It is not impossible, but I don't think any Cortex-M3 microcontrollers has such programmable register in the system level design to override the TDO/SWO usage.  It is just something that we don't expect users to do.).

    It you really want to, you can try to put two jumpers on your PCB to connect TMS and TCK to I/O port and switch it to serial wire mode by software. (Without a debugger connected of course).

    May I ask you why do you want to use the ITM without a debugger? :-)
    (I suppose you could use a UART for text output?)

    regards,
    Joseph
Children
No data