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

nRF52840 TWI library error

Hi,

I have included in my code the code from the twi_scanner example as a starting point for using TWI in my board. When compiling, I get the following error:

../../../../../../integration/nrfx/legacy/nrf_drv_twi.h:120:37: error: 'NRF_DRV_TWI_INSTANCE_0' undeclared here (not in a function)

The error happens in the exact same  nrf_drv_twi.h used by the example, and I am not finding any way to understand what is happening. Any help would be appreciated, thank you very mucn.

Best regards,

Alin

Parents
  • I am having the exact same problem with SPI, and I suspect it has something to do with sdk_config.h. I have backed up my project and tinkered a little with it, trying to copy and paste the parts that are missing in my sdk_config.h and that are present in the one in the example, but I still get the same result. I tried to use the big generic sdk_config.h from \config\nrf52840\config , and I got different errors, so the solution to this one must have something to do with sdk_config.h yet I cannot figure out what it is.

Reply
  • I am having the exact same problem with SPI, and I suspect it has something to do with sdk_config.h. I have backed up my project and tinkered a little with it, trying to copy and paste the parts that are missing in my sdk_config.h and that are present in the one in the example, but I still get the same result. I tried to use the big generic sdk_config.h from \config\nrf52840\config , and I got different errors, so the solution to this one must have something to do with sdk_config.h yet I cannot figure out what it is.

Children
No Data
Related