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

NRF52: Legacy TWI Driver not linking on SDK15 (undefined reference)

Hello, 

I am trying to use the Legacy TWI Driver in SDK 15. I have setup my my sdk_config.h file to remove all references to NRFX (New TWI Driver). Only enabling the "nrf_drv_twi" driver via CMSIS configuration wizard, unfortunately the linker fails to find reference to many of the TWI functions. As referenced here: https://devzone.nordicsemi.com/f/nordic-q-a/34317/undefined-reference-to-nrfx_twi_tx/132496 ; there are quirks in associating the older legacy functions. I have also experimented with combinations of enabling the NRFX driver, enabling TWIM, enabling EASY DMA (legacy TWIM), etc. to no avail. 

Compiler Output: 

Linker Error

Here is my sdk_config.h file: 

sdk_config.h

Any ideas on how to resolve this would be appreciated.

Thanks  

Parents
  • Hi,

    Did you include the source files in your project? Note that you need to add the following files to you project, in addition to enable the modules in sdk_config.h:

    • integration\nrfx\legacy\nrf_drv_twi.c
    • modules\nrfx\drivers\src\nrfx_twi.c / nrfx_twim.c

    Best regards,
    Jørgen

  • Based on your guidance, I investigated further and realised my preprocessor directories were inconsistent. I have now got it working. I really should have picked up on this. Sometimes it's the really basic errors you overlook. 

    Thanks for your help.

Reply
  • Based on your guidance, I investigated further and realised my preprocessor directories were inconsistent. I have now got it working. I really should have picked up on this. Sometimes it's the really basic errors you overlook. 

    Thanks for your help.

Children
No Data