saadc changing modes hangs on nrfy_saadc_stop(NRF_SAADC, true)

Hi,

I have a project where I use nrfx_saadc and need to change channels and simple/advanced mode in runtime

If I start with simple mode, samples, move to advanced mode using timer and ppi to sample than move back to simple mode, my program hangs on nrfy_saadc_stop(NRF_SAADC, true)

My channels for each mode are different (sync mode channels and async moe channels)

While doing async sampling in adv mode I enable and disable the timer in NRFX_SAADC_EVT_READY and NRFX_SAADC_EVT_FINISHED events.

Before I move back to simple mode I uninit the timer and release the dppi channels.

This are my actions:

1. init saadc (including IRQ)

2. set sync channels and set simple mode

3. trigger some samples --> samples are valid

4. deconfig channels

5. config async channels and set advanced mode

6. init timer and ppi channels

7. start conversion using timer and ppi

8. after some time - stop the conversion (disables the timer)

9. deconfig channels

10. uninit timer, release ppi channels

11. config sync channels and set simple_mode -------> HANGS on `nrfy_saadc_stop(NRF_SAADC, true)`

Do I have anything wrong here?

Thank you!

 

Related