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

Problem with SWO when debugger not connected

Hi,

I have configured my M4 based CC3200 from TI to output printf via ITM (all uarts used). Works great as long as the debugger is connected. But when I boot up with no debugger it streams out unrecognisable packets. The normal packets are one header and one byte  0x09 XX where XX is my ascii trace. Now, with no debugger, I get a verbose stream of one byte packets the content of which I don't recognise. 0x09 YY 0x09 YY etc where YY is not ascii. Often it could be 0x09 0x89 0x09 0x89 0x09 0x89 0x09 0x89 0x09 0x89. Any clue as to what is going on with Coresight/ Debug and Trace / ITM? 

Thanks,

Ciarán

Code here:

// Enable Trace (Debug Exception and Monitor Control Registe
CoreDebug->DEMCR = CoreDebug_DEMCR_TRCENA_Msk;

// Enable write to ITM registers
ITM->LAR = 0xC5ACCE55;

// TPIU - Select UART(NRZ) mode (Sometimes called SWO Mode)
TPI->SPPR = 0x00000002;

// TPIU - Set the baud rate (I found this did NOT work reliably at 256000. 95% ok, but occassionally saw *** in the trace and scoping it showed the timing was well out of range. 115200 looks better.
TPI->ACPR = 80000000 / 115200 - 1;

// Configure FIFO
TPI->FFCR = 0x100;

ITM->TPR = ITM_TPR_PRIVMASK_Msk;

// Enable ITM (Trace Control Register) 
ITM->TCR = (ITM_TCR_TraceBusID_Msk | ITM_TCR_ITMENA_Msk | ITM_TCR_SWOENA_Msk | ITM_TCR_SYNCENA_Msk ); // Enable

DWT channel anyway even if we don't config a watchpoint below, it doesn't matter
// Enable stimulus port (Trace Enable Register)
ITM->TER = 2; // Was 3

  • Apologies - I think this may have been one of those false alarms. I _think_ the problem was that I wasn't flashing the image right - so when running from debugger (i.e. full image running in RAM - CC3200 has no on board/XIP flash) all was ok. Then when I 'flashed' the image, I think it was not overwriting the stupid file system properly so my previous image was still there.

    Short version :  the above code works even when debugger disconnected and my trace works fine. Single wire connected to COM port and my own home spun parser  to interpret the DWT packets.

    Ciarán