02-06-2023 03:07 PM - edited 02-06-2023 03:13 PM
Hello, the title is quite self explanatory, but here is the story.
I am reading quaternion data from a BHI260+BMM150 using I2C at 400 Hz, along with Accelerometer and Gyroscope WU. Yet I'm reading every now and then a FIFO overflow with some seconds of data loss.
Why is that happening? The while(true) loop is basically empty, I only have a led toggling and the BHI reading. Even if I flush the FIFO before the get_and_process, I will overflow it just after the flush. How is that I'm not able to empty the FIFO fast enough?
I'm using an NRF5340 as a host microcontroller.
02-06-2023 03:32 PM
Hi dariosortino,
Did you refer this example code https://github.com/boschsensortec/BHY2-Sensor-API/blob/master/examples/euler/euler.c?
02-06-2023 03:46 PM
Yes, the structure is exacly the same. The only thing is that I enabled not Euler, but Quaternion, Gyro and Acc as sensors.
It seems that I just that it takes too much time to print everything that I'm parsing, so that the next call to the get_and_process has too much to process, eventually overflowing the FIFO. But that's just my guess, I have no clue of what I can do
02-07-2023 03:54 AM
Hi dariosortino,
You can turn off some unnecessary print information to save time consumption of MCU. If FIFO overflow occurs when print is rare, you need to check whether the printing speed is too slow.
02-17-2023 01:36 PM
Without printing anything, it takes 10 to 100 ms for the function bhy2_get_and_process_fifo to end.
Consider that I set 3 sensors at 100 Hz each (ideally I would run at 400 Hz).
My goal is to just have the latest sample available for my 3 sensors whenever I issue a command (I guess with bhy2_get_and_process_fifo).