PPI trace

The PPI trace module enables tracing of hardware peripheral events on pins. Tracing is performed without CPU intervention, because PPI is used to connect events with tasks in GPIOTE.

PPI trace can be used to debug a single event or a pair of complementary events. When tracing a single event, every occurrence of the event toggles the state of the pin (see ppi_trace_config()). When tracing a pair of complementary events (for example, the start and end of a transfer), the pin is set when one of the events occurs and cleared when the other event occurs (see ppi_trace_pair_config()).

The PPI trace module is used in the PPI trace sample.

API documentation

Header file: include/debug/ppi_trace.h
Source files: subsys/debug/ppi_trace/
group ppi_trace

Module for tracing hardware events on GPIO.

Functions

void *ppi_trace_config(uint32_t pin, uint32_t evt)

Configure a PPI trace pin for tracing a single event.

Note

If a hardware event is used by DPPI in the application, the PPI trace configuration must occur after the DPPI connection for the given event. The order is important because DPPI allows assigning events to only one channel. Therefore, PPI trace subscribes to the same channel.

Parameters
  • pin – Pin to use for tracing.

  • evt – Hardware event to be traced on the pin.

Returns

Handle, or NULL if the configuration failed.

void *ppi_trace_pair_config(uint32_t pin, uint32_t start_evt, uint32_t stop_evt)

Configure a PPI trace pin for tracing complementary events.

Note

Not supported on nRF51 Series. Requires presence of GPIOTE SET and CLR tasks.

Parameters
  • pin – Pin to use for tracing.

  • start_evt – Hardware event that sets the pin.

  • stop_evt – Hardware event that clears the pin.

Returns

Handle, or NULL if the configuration failed.

void ppi_trace_enable(void *handle)

Enable PPI trace pin.

Parameters
  • handle – Handle.

void ppi_trace_disable(void *handle)

Disable PPI trace pin.

Parameters
  • handle – Handle.