sparkfun / SparkFun_BNO080_Arduino_Library

An Arduino Library for the BNO080 IMU combination triple axis accelerometer/gyro/magnetometer packaged with an ARM Cortex M0+ running powerful algorithms.
Other
81 stars 62 forks source link

Can't get example to work on SAMD21 #23

Closed simon-rob closed 5 years ago

simon-rob commented 5 years ago

I have tried the Example - Rotation Vector.ino on a Genuino Uno and it worked flawlessly.

However if I try the same code on an Adafruit feather M0 proto or Adafruit Circuit Playground Express it just hangs.

Enabling myIMU.enableDebugging(Serial) shows "I2C timeout".

I have tried adding a startup delay to give the BNO080 time to start up but still the same.

I am confused why it doesn't work on both SAMD21 boards!

simon-rob commented 5 years ago

Answer my own question:

Commenting out Line 55 /56 in SparkFun_BNO080_Arduino_Library.h and it works.

//SAMD21 uses RingBuffer.h //#define I2C_BUFFER_LENGTH SERIAL_BUFFER_SIZE

nseidle commented 5 years ago

Thanks for coming back to report! Hmm, I wonder how SERIAL_BUFFER_SIZE is defined in the SAMD core that you're using and what's changed. I'll try to test on our core shortly.

nseidle commented 5 years ago

I suspect Adafruit is change how the ring buffer is defined. I've removed the define from the library. The catch all define gate will work for SAMD21.