This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to enable parallel trace output?

I am currently using SWO to get tracing data from ITM and DWT successfully.

Now I want to use parallel trace for more throughput. For that I use an FPGA, no JTrace or similar. Also I don't use any debugging software or IDE, I want everything to be set up via the target code or GDB.

I switched the TRACE switch on my nRF52840 DK to "Alt".

When looking into the documentation it seems to me the only thing I have to do is setting TRACEMUX in TRACECONFIG to 2 for parallel trace and configure the pins correctly. This is precisely what system_nrf52840.c does if I define ENABLE_TRACE.

So I expected to get trace output then. I also expected TPI->SPPR (Selected Pin Protocol Register) to be zero for TracePort mode. However it is "01" for SerialWire Output.

When ENABLE_TRACE is defined, the TRACECLK and TRACEDATA[0] pins are at around 1.4v. The other data pins are zero though. When I am in SWO mode, TRACECLK is zero as well. So ENABLE_TRACE has an effect. I can also verify that TRACEMUX is set up correctly.

Is there anything else that I need to configure to get ITM packets through the TPIU to the trace pins? Can you give me some hints or a tutorial? For me as someone how doesn't do low level development regularly the documentation is not very clear, it seems like you need to know what to do already so that you can look up the specifics about the registers.

Thanks

Bennet

Parents
  • Hi Bennet

    If I understand you correctly you want to create your own trace debugger rather than getting an off the shelf one?

    We don't really have any guides or tutorials showing how to do this, since this is not something our customers normally do. 

    You would have to start by reading through the relevant ARM specifications, covering the trace modules and the SWD interface:

    https://developer.arm.com/documentation/ddi0480/b

    Best regards
    Torbjørn

  • To be precise, I want to use https://github.com/orbcode/orbuculum

    This project has a subproject called "orbtrace" which uses an FPGA connected to the trace pins. The software also has a TPIU decoder. There are some gdb scripts for STM based chips for enabling the trace output. But nothing for nrf, the developer doesn't know how to do it either.

    This isn't specific to that project though, I could also want to use a logic analyzer and feed the result to sigrok for decoding. For this I also need to know how to configure trace.

    I'll look into the documentation but would be very grateful for some hints. 

    What I found so far is that I probably need to set Current_port_size (CSPSR) to width 4 (0x8) to enable all 4 pins. However that doesn't make a difference, there is still only activity on one pin. Edit: it does work if I set 

    TPI->SPPR = 0x0;

    Now I get some voltage on all pins. Capturing trace still doesn't work, but I have yet to figure out whether that is the fault of my configuration or orbtrace.

Reply
  • To be precise, I want to use https://github.com/orbcode/orbuculum

    This project has a subproject called "orbtrace" which uses an FPGA connected to the trace pins. The software also has a TPIU decoder. There are some gdb scripts for STM based chips for enabling the trace output. But nothing for nrf, the developer doesn't know how to do it either.

    This isn't specific to that project though, I could also want to use a logic analyzer and feed the result to sigrok for decoding. For this I also need to know how to configure trace.

    I'll look into the documentation but would be very grateful for some hints. 

    What I found so far is that I probably need to set Current_port_size (CSPSR) to width 4 (0x8) to enable all 4 pins. However that doesn't make a difference, there is still only activity on one pin. Edit: it does work if I set 

    TPI->SPPR = 0x0;

    Now I get some voltage on all pins. Capturing trace still doesn't work, but I have yet to figure out whether that is the fault of my configuration or orbtrace.

Children
Related