Use our driver they said. It’ll be fun they said.

These past few days, I focused myself on making the IMU talking. Or the Bosch sensor should I say, since it embeds more sensors than a mere IMU.

I first tried to use the vendor driver provided by Bosch. Such wonder and joy when I discovered those 17293 lines of .c file and 7935 lines of .h ! I started to figure out how the API they designed would work, then carried on by coding a test function to try things out. Unfortunately, it didn’t go very well. I managed to collect some data, but they were all the same, regardless of the positions and movements I impelled to the board.

So I gave up on the driver, and today I took the matter in hand and wrote and read in the sensor’s register myself. It was all going very well but suddenly, guess what ? A wild bug appears ! Nothing worked anymore. Even after checking out to master. It seems that a nasty stack overflow has infiltrated our code, clearing its path right to the master branch !
Then I started to check all our code. Is there an array on the stack or a mistake allocating space for a ChibiOS object ? I’m still checking and reformatting and stumbling upon the overflow. Randomly by the way, it’s way more fun like that.

And…that’s it for now ! I’m looking forward to finding this bug so I can come back to the sensor. Maybe a fresh look tomorrow will bring some answers.

1 comment to Use our driver they said. It’ll be fun they said.