I use i2c software driver (fallback) in my project. But when i2c is used from different thread I am receiving chSysHalt
Stack:
Code: Select all
Thread #16 536912464 (Name: spindle, State: CURRENT) (Suspended : Signal : SIGTRAP:Trace/breakpoint trap)
chSysHalt() at chsys.c:199 0x801658e
chMtxLockS() at chmtx.c:216 0x80189ac
chMtxLock() at chmtx.c:124 0x80188d0
osalMutexLock() at osal.h:994 0x801153c
i2cAcquireBus() at hal_i2c.c:265 0x80117cc
TLV493D_A1B6_read_regs() at TLV_A1B6_driver.c:40 0x801e59c
TLV493D_A1B6_read_frame() at TLV_A1B6.c:232 0x801ea36
hall3d_read() at hall3d.c:47 0x801dea4
_spindle_handle_trigger_value() at spindle.c:51 0x8027c0e
spindle_thd() at spindle.c:81 0x8027cbe
<...more frames...>
Problem is because different threads.
Code: Select all
chDbgAssert(mp->owner == ctp, "not owner");
How to workaround this problem without additional threads?