NRF54L15DK trace port configuration ( tracing in ozone with segger j-trace pro )

Hello, i am already 1 week trying to make tracing working. I have NRF54L15DK and SEGGER J_TRACE PRO. I solder trace port on the board.

I did enable => nRF TPIU in nRF KConfig GUI

I did disable internal SWD and leds ( since trace pins are coupled with leds gpios ) 

And tracing is not working..... I can't find any documentation about how to make configuration. Just that is possible.......... availability of trace port - it was main reason why i decide to use your SoC. 

Please, help me with configuration  

  • Hello,

    Please try to add the below to your AfterTargetReset() in your Ozone project. I don't have a jlink trace debug probe here at my desk to verify it myself, but my colleague who wrote this script has so it should work. 

    void AfterTargetReset (void) {
      _SetupTarget();
      // Set OSCILLATORS->GLOBAL_OSCILLATORS_S.PLL.FREQ = 128MHz
      Target.WriteU32(0x50120800, 1);
      Target.WriteU32(0x50050430, 0x3);
      // GPIO->GLOBAL_P2_S.PIN_CNF[6] = 0x00000f02;
      Target.WriteU32(0x50050498, 0x00000f02);
      // GPIO->GLOBAL_P2_S.PIN_CNF[7] = 0x00000f02;
      Target.WriteU32(0x5005049c, 0x00000f02);
      // GPIO->GLOBAL_P2_S.PIN_CNF[8] = 0x00000f02;
      Target.WriteU32(0x500504a0, 0x00000f02);
      // GPIO->GLOBAL_P2_S.PIN_CNF[9] = 0x00000f02;
      Target.WriteU32(0x500504a4, 0x00000f02);
      // GPIO->GLOBAL_P2_S.PIN_CNF[10] = 0x00000f02;
      Target.WriteU32(0x500504a8, 0x00000f02);
      // TAD->ENABLE = 1
      Target.WriteU32(0x50053500, 0x1);
      // TAD->TRACEPORTSPEED = DIV2
      Target.WriteU32(0x50053518, 0x1);
    }

    Note: with this script it's not necessary to enable the nRF TPIU symbol in your FW as the debugger takes care of the configuration. 

    Best regards,

    Vidar

  • With this script -> tracing working better, and each time from reset vector. 

    void AfterTargetReset (void) {
    _SetupTarget();

    // 1. Enable TAD
    Target.WriteU32(0x50120800, 0x00000001); // TAD.ENABLE = 1
    Target.WriteU32(0x50053500, 0x00000001); // TRACEPORTSPEED = 1
    Target.WriteU32(0x50053518, 0x00000001); // DIV2 → 64 MHz

    // 2. Configure trace pins (high drive + connect to peripheral)
    Target.WriteU32(0x50050430, 0x00000F02); // TRACECLK
    Target.WriteU32(0x50050498, 0x00000F02); // TRACEDATA0
    Target.WriteU32(0x5005049C, 0x00000F02); // TRACEDATA1
    Target.WriteU32(0x500504A0, 0x00000F02); // TRACEDATA2
    Target.WriteU32(0x500504A4, 0x00000F02); // TRACEDATA3
    // TRACEDATA4 optional

    // 3. TPIU: 64 MHz, 4-bit parallel, continuous mode
    Target.WriteU32(0xE0040010, 0x00000001); // ACPR = 1 → 128 / 2 = 64 MHz
    Target.WriteU32(0xE00400F0, 0x00000002); // SPPR = 2 → 4-bit parallel
    Target.WriteU32(0xE0040304, 0x00000102); // FFCR = continuous + formatter

    // 4. ETM: Unlock & Enable
    Target.WriteU32(0xE0041FB0, 0xC5ACCE55); // Unlock ETM
    Target.WriteU32(0xE0041040, 0x00000001); // Trace ID = 1
    Target.WriteU32(0xE0041000, 0x00001001); // ETMCR = enable + stall
    }

  • But CPU frequency need to set  at 128mhz

    Edit.SysVar (VAR_TRACE_CORE_CLOCK, 128000000);

Related