Hello guys.
We use NCS v1.4.2 and Zephyr RTOS to develop the application code for our nRF52840 SoC.
Thanks to your support, we were able to use Zephyr ADC APIs and take the readings from some ADC channels (thread).
However, we would like to benefit from some nRF ADC features like taking periodic samples in the background (timer + PPI + ADC) or calling an interrupt function when ADC values are above/below pre-defined limits (e.g. to use nrfx_saadc_limits_set() function to set the limits). For that features, it is needed to use nrfx drivers directly.
There is one example that shows how, in general, nrfx drivers are used - link. By following the analogy from that example, I tried to disable native Zephyr ADC driver and enable nrfx saadc driver with the following two lines in my prj.config file:
CONFIG_ADC=n CONFIG_ADC_NRFX_SAADC=y
I also included nrfx_saadc header file line in my main.cpp file:
#include <nrfx_saadc.h>
When I compile the code that contains some saadc related functions (init, config...), the compiler complaints about the undefined reference to nrfx_saadc_xxx() functions that are all declared in included nrfx_saadc.h file:
build/../src/main.cpp:187: undefined reference to `nrfx_saadc_channels_config' build/../src/main.cpp:190: undefined reference to `nrfx_saadc_advanced_mode_set' build/../src/main.cpp:197: undefined reference to `nrfx_saadc_buffer_set' build/../src/main.cpp:200: undefined reference to `nrfx_saadc_buffer_set' build/../src/main.cpp:203: undefined reference to `nrfx_saadc_mode_trigger'
Do you have any idea what I am missing here? Do I need to include something more in my prj.config file that will disable the usage of Zephyr ADC APIs and encourage the usage of NRFX SAADC driver?
Thanks in advance for your time and efforts.
Sincerely,
Bojan.