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

NRF_ERROR_DRV_TWI_ERR_ANACK in Blocking Mode

Hi, Nordic Forum!

I'm developing a product that relies heavily on the TWI in master mode. I was using SDK 11.0 and everything was working well.

I decided to port to SDK 13, and when I did, this unexpected bug appears.

Basically, what I'm doing is periodically reading a series of sensors, (through an I2C mux) and a coulomb counter (to check the battery state).

Everything works fine, but, a few samples after I reach the charging termination state, the other sensor starts failing with the error code 0x8201.

Does anyone know what the error means? I know it says NRF_ERROR_DRV_TWI_ERR_ANACK, but what does that mean exactly.

Thanks in advance.

  • The SDK docs say that this is a NACK that the master received in response to the address byte.

    Unless the sensor datasheet mentiones a timout period on the I²C bus where the device is not adressable, you may need to look at this with an oscilloscope or logic analyser.

    Note that this would also happen when your I²C mux is in a "wrong" state, i.e. trying to address a slave that the mux has currently not connected to the bus.

Related