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

nrf52832 undefined reference to `nrfx_comp_init'

Hello guys,

I'm trying to use the new NRFX library but I've hit the wall with the following error when trying to use the comparator API:

undefined reference to `nrfx_comp_init'

This happens during the link stage. I can see the nrfx_comp.c being compiled, I've set the #define NRFX_COMP_ENABLED 1 in sdk_config.h but the error still persists.

I've included #include "nrfx_comp.h" in my project.

I'm using GCC. Any help is appreciated.

Regards,

L. B.

Parents Reply
  • This means you might have the nrf_drv_comp (obsolete) COMP_ENABLED present in your sdk_config.h (which overrides NRFX_COMP_ENABLED)

    Look at your sdk_config.h for this

    //==========================================================
    // <e> COMP_ENABLED - nrf_drv_comp - COMP peripheral driver - legacy layer
    //==========================================================
    #ifndef COMP_ENABLED
    #define COMP_ENABLED 0
    #endif

    And comment it out.

Children
Related