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

Measuring nRF52840 / ETM trace data race on a custom board bus

Dear Nordic experts,

I am trying to profile embedded S/W on a custom board (call it board #1) with a nRF52840 on it. On this board the trace pins TRACECLK and TRACEDATA[0-3] are wired to test points on the PCB.

In order to connect a Segger J-Trace to it we have connected with wires these test points to corresponding points on a custom adaptor board (call it board #2) which has a connector for a ribbon cable to the J-Trace.

Since this wiring is sort of home-made tampering we suspect that there are inconsistent race delays on the TRACECLK/TRACEDATA[0-3] signals, and that this is the reason why the trace data cannot be properly sampled by the J-Trace (as FW is compiled with ENABLE_TRACE we cannot imagine any other reasons). So we would like to use the timing adjustment function of the J-Trace to compensate for that.

So, I am looking for a method to measures these delays. My idea is to make some simple test FW in which the pins corresponding to TRACECLK and TRACEDATA[0-3] are configured as GPOs, and these GPOs are toggled with some PWM so that each port correspond to some known pattern (like some counter bits, or some synchronised pulses) so that we could observe with a scope the signal at the ribbon cable connect and measure any intersignal-delay.

I would like to know whether using the PWM module is the recommended way to address this kind of situation, or there are any tools already available from the shelf to create a well defined test signal on the TRACECLK and TRACEDATA[0-3] pins, observe these test signal at the ribbon cable connector, and measure what timing adjustments are needed to be configured to the J-Trace. Maybe the ETM already has some test signal function or something like that and we don't need to reinvent the wheel.

Related