Code: Select all
osalDbgCheck(chk);
osalDbgAssert(i2cp->state == I2C_READY, "not ready");
if(wkup){
chprintf((BaseSequentialStream *)&SERIAL_PORT, "%s: %d\n\r",__func__,i++);
chThdSleepMilliseconds(250);
}
osalSysLock();
i2cp->errors = I2C_NO_ERROR;
i2cp->state = I2C_ACTIVE_TX;
if(wkup){
chprintf((BaseSequentialStream *)&SERIAL_PORT, "%s: %d\n\r",__func__,i++);
chThdSleepMilliseconds(250);
}
rdymsg = i2c_lld_master_transmit_timeout(i2cp, addr, txbuf, txbytes,
rxbuf, rxbytes, timeout);
The above code appears to be violating ChibiOS state policy. Check out http://chibios.sourceforge.net/docs3/rt/concepts.html for what is possible after entering an I-Locked context. Do you have the state checker enabled?