Preface: External watchdog is used to feed dogs in RTOS tasks. During troubleshooting the issue of abnormal reset, it was found that I2C communication abnormalities can cause reset. The following is detailed information on simulation debugging.
I2C communication exception caused program crash, interrupt continues to I2C_lld_targetIsr, unable to enter task function, all tasks starved to death.
As shown in the above figure, there is another strange thing, why does the value of object ->current Transaction ->controller Mode equal 0x96 enter the else branch?
and then
The software is configured as a controller and the code has not been modified to a target anywhere.
Why is it that the value bit of I2C_CON register [10] MST becomes 0 and the device becomes the target?