AnsweredAssumed Answered

K60 Keil ETM Tracing

Question asked by swtat on Aug 2, 2013
Latest reply on Jul 28, 2015 by DaveTonyCook



I don't manage to get ETM tracing working on my TWR-K60D100M board. I followed the instruction in:


Tracing does not work with the Blinky Example found in Keil Install-Dir: Keil\ARM\Boards\Freescale\TWR-K60N512


I get: "Trace: Data Stream Error", "Trace: Synchronization error",... and no Trace Data is displayed.


Using my second board, the TWR-K40X256, ETM tracing works perfect:

- same debugger settings

- same trace settings

- corresponding blinky project (TWR-K40X256)


I can see the TRACE CLK with my oscilloscope: K40: 28MHz, K60: 24MHz.


My settings of the K60 project are:



FUNC void SetupTrace (void) {
  // SIM_SCGC5: enable PORT A clock
  _wDWORD(0x40048038,(_RDWORD(0x40048038) | 0x00000200));
  _wDWORD(0x40049018, 0x00000740);      // PORTA_PCR6  -> (ALT7 + DSE) TRACE_CLKOUT
  _wDWORD(0x4004901C, 0x00000740);      // PORTA_PCR7  -> (ALT7 + DSE) TRACE_D3
  _wDWORD(0x40049020, 0x00000740);      // PORTA_PCR8  -> (ALT7 + DSE) TRACE_D2
  _wDWORD(0x40049024, 0x00000740);      // PORTA_PCR9  -> (ALT7 + DSE) TRACE_D1
  _wDWORD(0x40049028, 0x00000740);      // PORTA_PCR10 -> (ALT7 + DSE) TRACE_D0


Debug: SWJ active, SW, 1MHz

Trace: Core Clock 48MHz, Trace Port Sync Trace Port with 4-bit Data, ETM Trace Enabled, EXCTRC disabled