This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

IIC forzen

When debugging IIC, it always crashes here. what is the problem。

nrfx_twim.c,line 441.

else
{
while (!nrf_twim_event_check(p_twim, evt_to_wait))//forzen here
{
if (nrf_twim_event_check(p_twim, NRF_TWIM_EVENT_ERROR))
{
NRFX_LOG_DEBUG("TWIM: Event: %s.", EVT_TO_STR_TWIM(NRF_TWIM_EVENT_ERROR));
nrf_twim_event_clear(p_twim, NRF_TWIM_EVENT_ERROR);
nrf_twim_task_trigger(p_twim, NRF_TWIM_TASK_RESUME);
nrf_twim_task_trigger(p_twim, NRF_TWIM_TASK_STOP);
evt_to_wait = NRF_TWIM_EVENT_STOPPED;
}
}

Parents Reply
  • It didn't happen on the development board, it was my own board. I observed the oscilloscope when there was a problem, but the slave did not respond. I tried adding a watchdog, if the card is stuck in the loop, the system can be restarted. Even if the watchdog can restart the system, I do not want the system to restart when there is a problem with the slave. I would rather read the slave several times, rather than restarting the system frequently. It may be that the speed of the master is too fast, and too many slaves are mounted (3 slaves, some slaves can not reach the 400K rate) causing problems. However, I feel that even if there is a problem with the slave, the master should not keep looping somewhere.

Children
Related