Skip to content

Commit a97ba91

Browse files
ankunsrlubos
authored andcommitted
debug: ppi_trace: use nrfx_gppi to support nRF54L
This commit changes implementation of the ppi_trace module so that it is based on nrfx_gppi as provided since nrfx 3.8.0. The functions provided by nrfx_gppi library on the nRF54L devices provide ability to connect events and tasks which cross the power domains through PPIB bridges. Most of the functions simply use the nrfx_gppi API, but `ppi_trace_dppi_ch_trace` is a special one. The nRF54L devices have multiple DPPIC controllers, so the function `ppi_trace_dppi_ch_trace` is given an additional parameter that identifies the DPPIC controller. The channel number is not enough. The function prototype must now be provided conditionally only for SoCs equipped with DPPI. GPIOTE can directly subscribe only to DPPI channels of this DPPIC controller which is in the same power domain. Neither Device Tree nor nrfx provide such information. That's why `get_dppic_for_gpiote` function is used internally. It allows handling the case within `ppi_trace_dppi_ch_trace` function where GPIOTE can subscribe to DPPI channel directly. The nrfx_gppi API cannot be used for this purpose. Signed-off-by: Andrzej Kuros <andrzej.kuros@nordicsemi.no>
1 parent 631b0ad commit a97ba91

File tree

3 files changed

+161
-140
lines changed

3 files changed

+161
-140
lines changed

include/debug/ppi_trace.h

+12-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
#define __PPI_TRACE_H
99

1010
#include <stdint.h>
11+
#include <nrfx.h>
12+
13+
#if defined(DPPI_PRESENT)
14+
#include <nrfx_dppi.h>
15+
#endif
1116

1217
#ifdef __cplusplus
1318
extern "C" {
@@ -48,6 +53,8 @@ void *ppi_trace_config(uint32_t pin, uint32_t evt);
4853
*/
4954
void *ppi_trace_pair_config(uint32_t pin, uint32_t start_evt, uint32_t stop_evt);
5055

56+
#if defined(DPPI_PRESENT)
57+
5158
/** @brief Configure and enable a PPI trace pin for tracing a DPPI channel.
5259
*
5360
* This function allows to trace DPPI triggers without knowing any events being the source of the
@@ -60,12 +67,16 @@ void *ppi_trace_pair_config(uint32_t pin, uint32_t start_evt, uint32_t stop_evt)
6067
*
6168
* @param pin Pin to use for tracing.
6269
* @param dppi_ch DPPI channel number to be traced on the pin.
70+
* @param dppic Identifies the instance of DPPIC controller that the @c dppi_ch channel
71+
* belongs to.
6372
*
6473
* @retval 0 The configuration succeeded.
6574
* @retval -ENOMEM The configuration failed, due to lack of necessary resources.
6675
* @retval -ENOTSUP The function is not supported on current hardware platform.
6776
*/
68-
int ppi_trace_dppi_ch_trace(uint32_t pin, uint32_t dppi_ch);
77+
int ppi_trace_dppi_ch_trace(uint32_t pin, uint32_t dppi_ch, const nrfx_dppi_t *dppic);
78+
79+
#endif /* DPPI_PRESENT */
6980

7081
/** @brief Enable PPI trace pin.
7182
*

subsys/debug/ppi_trace/Kconfig

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,13 @@
77
config PPI_TRACE
88
bool "Enable PPI trace"
99
select NRFX_GPIOTE
10+
select NRFX_GPPI
1011
select NRFX_PPI if HAS_HW_NRF_PPI
11-
select NRFX_DPPI if HAS_HW_NRF_DPPIC
12+
select NRFX_DPPI0 if SOC_SERIES_NRF53X
13+
select NRFX_DPPI00 if SOC_SERIES_NRF54LX
14+
select NRFX_DPPI10 if SOC_SERIES_NRF54LX
15+
select NRFX_DPPI20 if SOC_SERIES_NRF54LX
16+
select NRFX_DPPI30 if SOC_SERIES_NRF54LX
1217
help
1318
Enable PPI trace module which enables forwarding hardware events to
1419
GPIOs.

0 commit comments

Comments
 (0)