I2C Communication random failure

Hi, 

I am developing a device using the nRF52832 mcu. I have written my application and have interfaced with an external I2C Sensor. It works perfectly on the NRF52-DK, I get regular data. But when I am flashing the same application to my custom HW, I see that the I2C communication is randomly failing in between. 

The only change between the code running on the NRF52DK and the custom HW is pin number. (I use pin 3,4 on the DK and use 3,2 on my device). Everything else is the same. To make sure nothing else interfares with I2C I have disabled all other functionalities. 

The weird thing is on my custom device the I2C Communication fails randomly at random places. Reading the same register will sometimes work, and will sometimes halt the bus.

I tried modifying the driver so that the communication is re-attempted when the bus is halted, but still sometimes that is causing a CPU hardfault, sometimes that is reading/writing wrong data to the sensor and weird things.

Do you have any guess if any SDK/IDE/HW configuration error can cause this type of issue? I am totally puzzled that this same code works flawlessly on the NRF52DK, with just the pin number change.

PS. Using Segger Embedded Studio

Parents Reply Children
No Data
Related