Hello all,
My use of the nrf_drv_saadc causes failures due to incompatible (driver) state, and seeing that other people are having various issues with it, before spending too much time on this issue (or creating a distributable repro), would like to know the following:
- SDK API reference notes that one should check the PS in order to know when the offset calibration should be done. However, the latest PS does not contain any information on it (at least searching for 'calibration' did not yield any information on this). How often should offset calibration be done? If this is temperature related, what kind of temperature changes require rerunning the offset calibration?
- What is the impact of not ever doing offset calibration (PS data seems to be silent on this)? Ballbark of expected errors is acceptable at this point (we have other sources of errors in our system, so just trying to get a fix on priority at this point).
- Where to find the duration of the offset calibration (avg/max)? Not listed in PS.
- How long is an offset calibration valid? What if SAADC is uninitialized and then initialized later, is offset calibration lost during this time?
- My mode of operation is such that SAADC is uninitialized most of the time (uninit of the driver called). Once a while, SAADC is initialized, 4 channels are initialized, sampled and deinitialized in a row (BURST, x64-oversampling, one channel at a time, SCAN+DMA cannot be used since channels are swapped occasionally). I have extended this model by requesting for the offset calibration after SAADC is initialized, but before any channel is initialized. Calibration seems to take about 4ms and upon receiving callback on this the next conversion start will cause the failure code return. No nrf_drv_saadc -functions are called from within the callback (since it runs in ISR and nrf_drv_saadc does not look very safe to use from ISR), but instead are run later from regular context. Is there anything especially wrong in this process? I have tried sprinking "aborts" here and there, but nothing really changes much.
Driver versions tried: 12.1 (actual version of SDK) and I've backported all of the "bugfixes" that have targetted the SAADC driver all up to 14.1, but issue remains.
Without calibration, sampling works without issues (without SCAN).
Hints appreciated & br.