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.
Can we get a solution to this issue ? This is easy to recreate using standard MCU+ SDK and AM263x control card ?
Just access do a rd or wr on a non-existing I2C device say 7b addres 0x61 and then do a vali I2C transaction on the LED IO expander on AM263x control card at address 0x60 and you will need that the valid access fails.
Hi kedar,
we have already replicated the issue and confirmed this as a valid bug on SDK I2C Driver. We'll fix this in our upcoming 09.02v release.
Team is working on the fix. We'll share the fix in 3-4 days.
Regards,
Abishek S S
Hi Kedar,
As per the current driver in case of a NACK condition when in BLOCKING mode, the Semaphore gets posted before the STOP is initiated.
After initiating the STOP condition the interrupts are disabled; therefore, no further interrupts occur.
Checking whether the bus is busy is one way of solving the problem although is a quite primitive way.
A better way would be to handle the nack in a different way, Below is one such way.
- NACK Happens
- Object State becomes I2C_ERROR
- Store the interrupt in intStatusErr
- Clear and disable all interrupts except STOP
- Initiate STOP
- Controller interrupt fires again due to stop completion
- In I2C_ERROR/I2C_IDLE_STATE check whether NACK happened from intStatusErr
- Clear and Disable Stop interrupt
- Post Semaphore
In this way, by the time the semaphore is posted, the bus will be free.
I have attached the patch file. Could you please try applying it to your code and let me know if it works?
Regards,
Abishek S S