I see this errata: https://docs.nordicsemi.com/bundle/errata_nRF54L15_Rev2/page/ERR/nRF54L15/Rev2/latest/anomaly_L15_24.html#anomaly_L15_24
It says this:
"Symptoms
The PPI enabled by PUBLISH_COMPARE[n] is not generated.
Conditions
DPPI channel is using TIMER EVENTS_COMPARE as an event with CC[n]=1.
Consequences
The PPI is missing.
Workaround
- Do not use CC=1.
- Use SHORT register to stop and clear TIMER.
- Use PPI and START and CLEAR tasks at the same time."
First, I haven't been able to reproduce the issue, given the stated conditions. For example, I tried with this code but the event seems to be generated despite the conditions are satisfied:
#define DPPI_EN(chidx) ((chidx) | (1U << 31))
NRF_TIMER10->BITMODE = TIMER_BITMODE_BITMODE_32Bit;
NRF_TIMER10->PRESCALER = 4;
NRF_TIMER10->MODE = TIMER_MODE_MODE_Timer;
NRF_TIMER10->TASKS_CLEAR = 1;
NRF_TIMER10->TASKS_STOP = 1;
NRF_TIMER10->EVENTS_COMPARE[0] = 0;
NRF_TIMER10->CC[0] = 1;
NRF_EGU10->EVENTS_TRIGGERED[0] = 0;
NRF_TIMER10->PUBLISH_COMPARE[0] = DPPI_EN(0);
NRF_EGU10->SUBSCRIBE_TRIGGER[0] = DPPI_EN(0);
NRF_DPPIC10->CHENSET = DPPIC_CHENSET_CH0_Msk;
NRF_TIMER10->TASKS_START = 1;
while (!NRF_EGU10->EVENTS_TRIGGERED[0]) {
}
// this line is reached
Are there any additional conditions that need to be fulfilled in order to reproduce this?
In any case, the workarounds suggest/hint that the problem seem to relate to what happens when the timer is cleared (reset to 0) and the CC is set to 1, i.e. one tick just after. But is this the only scenario when the issue can be observed? I am particularly wondering about the scenario where the TIMER has been running for quite some time, then we set CC[n]=1 and wait for this event to be triggered just after the counter has wrapped around. Let's say we simply set CC[n] to current timer value + x, and this happens to be 1 modulo 2^32. Can the issue be observed also in this case? In that case, we need to always check when the result would be 1 modulo 2^32 and in that case, set some other value, e.g. 0 or 2 instead. Is this needed? Is this done e.g. by all the nrf sdks?