I'm using custom board based on nrf9160 SoC. After migrating from SDK v3.1.1 to v3.2.1 two issues (but they are likely related) began to happen:
- Battery measurements started to produce values 1.5-2 times lower than actual voltage value. The board is supplied with 12V. See nrf9160_custom.log attached below.
- After calling
adc_readduring battery measurement, all consecutive transfers on spi1 fail with the following error:spi_nrfx_spim: Timeout waiting for transfer complete. This issue only happens with spi1 (spi2 and spi3 work fine).
I've created minimal reproducible example project and when I tested it on nrf9160dk, situation is the opposite: the exact same issue with adc measurements and spi1 happens on previous SDK versions (I've tested on v3.1.1 and v2.9.2), but everything is fine on v3.2.1, see nrf9160dk.log
I haven't found anything related to this problem in latest migration guides and release notes for the SDK itself and nrfx, so I would like to get some help understanding is it a bug on our side (and if so, what needs to be changed to restore the correct behavior from previous SDKs or where can I find the appropriate documentation) or is it a subtle regression in the SDK?
adc-spi-minimal-proj.zip
*** Booting nRF Connect SDK v2.9.2-4ab7b98fc76f *** *** Using Zephyr OS v3.7.99-aa34a5632971 *** [00:00:00.406,829] <inf> main: board: nrf9160_custom [00:00:00.406,951] <inf> main: spi_transceive_dt: ok [00:00:00.407,043] <inf> main: spi_transceive_dt: ok [00:00:00.455,261] <inf> main: battery: 11419mV [00:00:00.455,383] <inf> main: spi_transceive_dt: ok *** Booting nRF Connect SDK v3.1.1-e2a97fe2578a *** *** Using Zephyr OS v4.1.99-ff8f0c579eeb *** [00:00:00.385,894] <inf> main: board: nrf9160_custom [00:00:00.386,016] <inf> main: spi_transceive_dt: ok [00:00:00.386,138] <inf> main: spi_transceive_dt: ok [00:00:00.435,272] <inf> main: battery: 11401mV [00:00:00.435,424] <inf> main: spi_transceive_dt: ok *** Booting nRF Connect SDK v3.2.1-d8887f6f32df *** *** Using Zephyr OS v4.2.99-ec78104f1569 *** [00:00:00.378,784] <inf> main: board: nrf9160_custom [00:00:00.378,936] <inf> main: spi_transceive_dt: ok [00:00:00.379,058] <inf> main: spi_transceive_dt: ok [00:00:00.428,161] <inf> main: battery: 7359mV [00:00:00.628,295] <err> spi_nrfx_spim: Timeout waiting for transfer complete [00:00:00.628,753] <err> main: spi_transceive_dt: -116
*** Booting nRF Connect SDK v2.9.2-4ab7b98fc76f *** *** Using Zephyr OS v3.7.99-aa34a5632971 *** [00:00:00.524,658] <inf> main: board: nrf9160dk [00:00:00.524,780] <inf> main: spi_transceive_dt: ok [00:00:00.524,902] <inf> main: spi_transceive_dt: ok [00:00:00.573,883] <inf> main: battery: 8628mV [00:00:00.774,017] <err> spi_nrfx_spim: Timeout waiting for transfer complete [00:00:00.774,505] <err> main: spi_transceive_dt: -116 *** Booting nRF Connect SDK v3.1.1-e2a97fe2578a *** *** Using Zephyr OS v4.1.99-ff8f0c579eeb *** [00:00:00.520,477] <inf> main: board: nrf9160dk [00:00:00.520,629] <inf> main: spi_transceive_dt: ok [00:00:00.520,721] <inf> main: spi_transceive_dt: ok [00:00:00.570,800] <inf> main: battery: 8612mV [00:00:00.770,965] <err> spi_nrfx_spim: Timeout waiting for transfer complete [00:00:00.771,423] <err> main: spi_transceive_dt: -116 *** Booting nRF Connect SDK v3.2.1-d8887f6f32df *** *** Using Zephyr OS v4.2.99-ec78104f1569 *** [00:00:00.505,767] <inf> main: board: nrf9160dk [00:00:00.505,889] <inf> main: spi_transceive_dt: ok [00:00:00.506,011] <inf> main: spi_transceive_dt: ok [00:00:00.556,060] <inf> main: battery: 6mV [00:00:00.556,182] <inf> main: spi_transceive_dt: ok