How Do I Enable SAADC in SDK 14.2?

I am trying to use SAADC.

When viewing the contents of nrfx_saadc.c in SEGGER IDE all the code is greyed-out.

I verified it is enabled in sdk_config.h:

// <e> NRFX_SAADC_ENABLED - nrfx_saadc - SAADC peripheral driver
//==========================================================
#ifndef NRFX_SAADC_ENABLED
#define NRFX_SAADC_ENABLED 1
#endif

The file nrfx_saadc.c is defined in nRF_Drivers so it does try to build the file.

Where else to look?

Parents
  • Hello,

    Could you check whether the legacy SAADC_ENABLED is also defined in your sdk_config.h?
    If the legacy enable is defined then apply_old_config will overwrite your nrfx configuration, and replace it with the legacy configuration. This means that it is not enough to set the legacy SAADC_ENABLED to 0, it must be commented out or removed from the file, so that it is not longer defined.
    Therefore, if you are using the nrfx drivers you should make sure that the legacy defines and configurations for that particular peripheral is not defined in your sdk_config concurrently.

    Please try this, and let me know if it resolves the issue :) 

    Best regards,
    Karl

Reply
  • Hello,

    Could you check whether the legacy SAADC_ENABLED is also defined in your sdk_config.h?
    If the legacy enable is defined then apply_old_config will overwrite your nrfx configuration, and replace it with the legacy configuration. This means that it is not enough to set the legacy SAADC_ENABLED to 0, it must be commented out or removed from the file, so that it is not longer defined.
    Therefore, if you are using the nrfx drivers you should make sure that the legacy defines and configurations for that particular peripheral is not defined in your sdk_config concurrently.

    Please try this, and let me know if it resolves the issue :) 

    Best regards,
    Karl

Children
No Data
Related