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

'NRFX_TWI0_INST_IDX' undeclared in nrfx_twi.h

I started with the template app and added BLE services, and I'm continuing by adding a TWI sensor (I2C).  I know there is a TWI_sensor example, but I already had some working code for this particular sensor (accelerometer).  There's a couple of mentions of this compile error on devzone, but I have not been able to make their suggestions work for me.

../../../../../../modules/nrfx/drivers/include/nrfx_twi.h:73:35: error: 'NRFX_TWI0_INST_IDX' undeclared here (not in a function);

It looks like perhaps NRFX_TWI0_ENABLED is false or not defined?  But in my <sdk_config.h>, I have the following:

               #define NRFX_TWI_ENABLED 1
               #define NRFX_TWI0_ENABLED 1
               #define NRFX_TWI1_ENABLED 1

               #define TWI_ENABLED 1
               #define TWI0_ENABLED 1
               #define TWI1_ENABLED 1

I've tried only enabling the nRFX_TWI drivers and disabling the TWI driver.  I've also tried it the other way around.  But it didn't fix the issue.  Am I mis-interpreting the compile error?

Parents Reply Children
No Data
Related