This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Add SAADC peripheral (and others) to example project

I am using SES and nRF5 SDK v17.0.2.

I am tying to add a few peripherals (SAADC, I2C, SPI, etc.) to the peripheral UART example with EVK (ble_app_uart_pca10040_s112). 

To add SAADC, I modified the SDK_config.h file line 3298 to "#define NRFX_SAADC_ENABLED 1" but this had no effect until I also added .c and .h files to project files.  So far so good, after tracking down some compiling errors to make sure everything was included.

Then, I got a linking error which I traced to "NRFX_CHECK(NRFX_SAADC_ENABLED)" failiing in nrfx_saadc.c.  Commenting out that check allowed the build to complete.

Then, reverting link 3298 in SDK_config.h to #define NRFX_SAADC_ENABLED 0" and cleaning/rebuilding, and the build still succeeded!

My questions are:

  1. How to properly add peripherals to a project -- the documentation and Devzone are very incomplete on this topic.
  2. Why does NRFX_CHECK() fail in the case I described above?  
  3. Why does build succeed even with SDK_config.h disabling SAADC?  

Thanks,

Jackson

Related