This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2640R2F: I2C problem

Part Number: CC2640R2F


I am working with the CC2640R2F. I am testing a custom board and the I2C driver bundled with the RTOS keeps failing. When I test it with my own driver, it works meaning the Hardware is okay.

I2C driver used is within the SDK version 5.10. I have tested the I2C peripheral with my own code, which does not use interrupts...it all works well. Now I am trying to use the RTOS I2C API and I2C_transfer keeps failing in blocking mode. It works if I step through the code, but not when I let it run, hinting at some kind of timing issue.

I have added the following delay to I2CCC26XX.c and it works, but I would like the native code to function out of the box.

status = I2CCC26XX_primeTransfer(handle, transaction);
HwiP_enableInterrupt(hwAttrs->intNum);
for(int i = 0; i < 1000; i++);

The way I understand it, I2CCC26XX_primeTransfer triggers an I2C transfer which is then completed by the Hwi handler. In the meanwhile, the calling task waits on a sempahore. I have seen in the ROV that this Semaphore is also shared by the idle task. Is that normal? I see a couple of binary semaphores available but these are not used by anything.

A couple of things about my setup in case it helps. I have configured my system to run without a Cache as I need the extra RAM. I have added a thread to the simple peripheral example to perform the I2C functions. I have disabled the UART in the simple peripheral example as I don't use it.