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 15th November 2010 at http://forums.arm.com

    Hello Joseph,

    many thanks for your answer !


    The ITM has a lock register that you need to unlock before programming the ITM.
    After setting TRCENA, could you add
    #define ITM_LOCK_ACCESS_REGISTER  (*((volatile unsigned long *)(0xE0000FB0)))
    ITM_LOCK_ACCESS_REGISTER = 0xC5ACCE55;


    Unfortunately it is still not working. Is there perhaps some switch to enable SWJ, disable JTAG ?
    The pin where SWO is on behaves still like an input.
    Is there some clock on TCLK needed for at leats part of the functionality ?

    Best regards,

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

    Hello Joseph,

    many thanks for your answer !


    The ITM has a lock register that you need to unlock before programming the ITM.
    After setting TRCENA, could you add
    #define ITM_LOCK_ACCESS_REGISTER  (*((volatile unsigned long *)(0xE0000FB0)))
    ITM_LOCK_ACCESS_REGISTER = 0xC5ACCE55;


    Unfortunately it is still not working. Is there perhaps some switch to enable SWJ, disable JTAG ?
    The pin where SWO is on behaves still like an input.
    Is there some clock on TCLK needed for at leats part of the functionality ?

    Best regards,

    Martin
Children
No data