undefined reference to `nrfx_twim_init'

Hi there, I am trying to access a TWI device using the TWIM driver. 

I have done the following in sdk_config.h:

#define NRFX_TWIM_ENABLED 1
#define NRFX_TWIM0_ENABLED 1

#define TWI_ENABLED 1
#define TWI0_ENABLED 1
#define TWI0_USE_EASY_DMA 1

and included these files:

nrfx_twi.c, nrfx_twim.c, nrf_drv_twi.c nrf_drv_twi.h, and nrfx_twim.h 

However I encounter the following error:

nrf_drv_twi.c:184: undefined reference to `nrfx_twim_init'
nrf_drv_twi.h:516: undefined reference to `nrfx_twim_enable'

I'm using SDK v17.

Can someone please help?

Parents
  • Hello,

    Please make sure to comment out or remove the legacy TWI_ENABLED define when you are working with the nrfx TWIM driver - the apply_old_config file will overwrite your nrfx definitions with the legacy TWI_* definitions in the case that the TWI_ENABLED is left defined in your sdk_config.h.

    Please remove the legacy definitions and let me know if this resolves your issue! :)

    Best regards,
    Karl

Reply
  • Hello,

    Please make sure to comment out or remove the legacy TWI_ENABLED define when you are working with the nrfx TWIM driver - the apply_old_config file will overwrite your nrfx definitions with the legacy TWI_* definitions in the case that the TWI_ENABLED is left defined in your sdk_config.h.

    Please remove the legacy definitions and let me know if this resolves your issue! :)

    Best regards,
    Karl

Children
Related