BNO080 compatibility with SAMD?

Hi there,

This post has some slight overlap with my previous BNO080 post regarding I2C reliability, but I’m simply hoping to get an answer on whether the SparkFun BNO080 is compatible with SAMD-based microcontrollers.

I have tested two new BNO080 boards with several SAMD microcontrollers and Example1-RotationVector. In every test configuration, I experience the same issue with the sensor failing to initialize. In the event that the BNO080 does initialize properly, if the reset button is pushed, it will fail to reinitialize 99% of the time.

Boards tested:

  • - SparkFun Qwiic Micro (SAMD21)
  • - SparkFun MicroMod SAMD51
  • - Adafruit Feather M0 (SAMD21)
  • - Adafruit Adalogger M0 (SAMD21)
  • - Adafruit Feather M0 Express (SAMD21)
  • - Moteino M0 (SAMD21)
  • It’s clear there’s an issue using the BNO080 with SAMD-based boards, but I’d really like to know if it is caused by the BNO080 hardware (i.e. are my boards faulty?), firmware or the library?

    Cheers,

    Adam

    I do not own an BN0080 but if it works on other boards, the library should be OK. I see it is using clock stretching. not sure this is supported on SAMD. After Wire.begin() in the sketch set Wire.setClock(25000), speed only 25K, before calling myIMU.begin(). If Clockstretching is the issue often the clock is slow enough to handle a clock stretch wanted by the device. Who knows??

    Thanks Paul,

    I had read that clock stretching could be an issue.

    Changing the I2C bus speed to 25000 kHz didn’t seem to make a difference. It doesn’t appear that the BNO080 actually recognizes that it has failed to initialize, as the code never makes it to the Serial.print() command. I believe the entire I2C bus crashes, causing a non-recoverable failure.

      Serial.begin(115200);
      while (!Serial);
      Serial.println("BNO080 Read Example");
    
      Wire.begin();
      Wire.setClock(25000); //Increase I2C data rate to 400kHz
    
      delay(1000);
      if (myIMU.begin() == false)
      {
        Serial.println("BNO080 not detected at default I2C address. Check your jumpers and the hookup guide. Freezing...");
        //while (1);
      }
    

    Seen in Serial Monitor:

    BNO080 Read Example
    BNO080 Read Example
    BNO080 Read Example
    BNO080 Read Example