Hello arurke,
Let me clear your issue.
Current issue is trigger_foc function doesn't work from your side for some reason.
Based on previous our communication, the reason could be i2c or SPI communication issue because you got wrong value from rslt = bmi160_get_regs(BMI160_STATUS_ADDR, &data, 1, dev);.
Therefore, I asked you rslt value to find the reason why you got some error value from that function.
Please give me rslt and logic analyzer log, it can analyze the root cause.
Thanks,
... View more