04-16-2022 12:59 AM
I am trying to bring up a board with a BHI160B. Is the library found at https://github.com/BoschSensortec/BoschSensorHub known to work for this sensor?
The circuit involves a BHI160B with no attached secondary devices, should I be using the Bosch_PCB_7183_di03_BMI160-7183_di03.2.1.11696_170103.h firmware? The application only requires reading the accelerometer and gyroscope virtual sensors.
Solved! Go to Solution.
07-27-2022 10:48 AM
Hi bgfas,
Thank for your feedback.
We checked the I2C waveform. It looks fine from the I2C bus after I parsed the FIFO data and suddenly stopped reading FIFO data. The second reading of bytes remaining is 0x1523 while only 7*32 + 26 = 250 bytes is read out.
Could you check why the host did not read the complete FIFO data?
07-27-2022 07:09 PM
Thanks for looking over the capture. I enabled debut output and saw the following output (clipped to the relevant portion):
Bytes waiting in sensor FIFO: 4545
Current available buffer capacity: 256 Number of bytes to read: 250
Buffer space available for this read: 256
Number of bytes in this transaction: 32
Buffer space available for this read: 224
Number of bytes in this transaction: 32
Buffer space available for this read: 192
Number of bytes in this transaction: 32
Buffer space available for this read: 160
Number of bytes in this transaction: 32
Buffer space available for this read: 128
Number of bytes in this transaction: 32
Buffer space available for this read: 96
Number of bytes in this transaction: 32
Buffer space available for this read: 64
Number of bytes in this transaction: 32
Buffer space available for this read: 32
Number of bytes in this transaction: 26
Buffer State: i= 0 ... 250; using 250
Current available buffer capacity: 7 No read possible.
Status=0
The final line ("Status=0") is one I added to print the output of updateBuffer after the 'No read possible' message which causes updateBuffer to exit before reading the fifo. It appears that if the fifo size exceeds the buffer the code will silently fail, the fifo will not be read and the code will not recover.