Part Number: AM2434
Other Parts Discussed in Thread: SYSCONFIG
Hi,
We are using TI's lld for I2C on AM243x to read out data of a bunch of ICs on a custom board. Some of these ICs are supplied by a separate power supply that can be switched off by the user. In that case the device is not available on I2C, of course. Sometimes this leads to a situation where the driver code gets stuck. We are using mcu_plus_sdk_am243x_11_01_00_19 .
To narrow it down I was able to reproduce it with a modified TI example and the AM243x launch pad.
Example: i2c_temperature_interrupt_lld_am243x-evm_r5fss0-0_nortos_ti-arm-clang
I attached the changed files i2c_temperature_interrupt_lld.c and a picture of the logic analyzer:

I run the code on a launch pad without temperature sensor. I get this output:
[I2C] I2C Temperature Read test Started in interrupt mode ... !!!
ERROR: i2c_temperature_main:105: [I2C] Temperature sensor not found at device address 0x48
[I2C] Sample 0: 0.000000 (celcius)
[I2C] Sample 1: 0.000000 (celcius)
[I2C] Sample 2: 0.000000 (celcius)
[I2C] Sample 3: 0.000000 (celcius)
[I2C] Sample 4: 0.000000 (celcius)
[I2C] Sample 5: 0.000000 (celcius)
[I2C] Sample 6: 0.000000 (celcius)
[I2C] Sample 7: 0.000000 (celcius)
[I2C] Sample 8: 0.000000 (celcius)
[I2C] Sample 9: 0.000000 (celcius)
[I2C] Sample 10: 0.000000 (celcius)
From here the code get's stuck.
My changes in code does the following:
It jumps over the check for the device address due to the reasons I stated above.
It simulates an ISR with higher priority or a code region with disabled interrupts of 8us right at the end of the transmission of the first byte, the device address.
This period of time is shown by the signal J1_8_PIN in the attached picture.
After this the transfer complete callback is not called and the loop around the mutex will not be left.
My questions:
Is this intentional behavior?
How can I avoid or break this situation?
How do I get aware of a failed transaction?
Thanks in advance.