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 Reply Children
  • natlynn said:
    thanks for the reply.

    No problem at all, I am happy to help! :) 

    natlynn said:

    I commented all the TWI_ENABLED defines and now I'm getting an error:

    NRF_DRV_TWI_INSTANCE undefined

    Or am I supposed to use another instance for the TWI Master?

    Are you registering an instance somewhere in your code?
    The nrf_drv_* calls are macro forwarded to the nrfx implementation in the nRF5 SDK v15 and up, so you can still use the nrf_drv_* calls as in the examples (but I would recommend updating them to their nrfx driver equivalent regardless).

    Best regards,
    Karl

Related