Closed mkinney88 closed 10 months ago
I was able to solve the issue if you move the #include
Hi @mkinney88 , Thanks for making us aware of this issue. Glad you were able to find a work-around, but that does seem strange. We intend to try to duplicate this issue with hardware next week.
Maybe the micro is trying to print to the serial terminal before it is done enumerating the com port. Another solution that might be worth trying would be to put a while loop in the setup to wait for Serial to return true. Something like this:
while (! Serial);
Hi @mkinney88 , We were able to test out some hardware today with some success! We started a branch with the necessary tweaks to the library to work with a SAMD51 Thing Plus.
Three things needed to change:
while(!Serial);
was added to the top of setup(). Waiting for Serial to become alive is necessary for the native USB to enumerate properly.As a side note, we tried your suggestion to move the #include
The following branch is working for example 1. We will continue to update this branch to get the other examples working.
https://github.com/sparkfun/SparkFun_BNO08x_Arduino_Library/tree/samd51_support
Note, this example used with the SAMD51 does require wiring up INT and RST from GPIO pins to the sensor. For the example 1 code, we have chosen pins 4 and 22:
#define BNO08X_INT 4
#define BNO08X_RST 22
And these (along with the address and wire port) are passed into the begin function like so:
if (myIMU.begin(BNO08X_ADDR, Wire, BNO08X_INT, BNO08X_RST) == false) {
Serial.println("BNO08x not detected at default I2C address. Check your jumpers and the hookup guide. Freezing...");
while (1)
;
}
Serial.println("BNO08x found!");
If you could try this on your setup that would be very helpful. Let us know and thanks!
We'll report back as we get the remaining examples updated. Thanks, Pete
Testing out the examples is coming along. the following "checked" examples have been verified with a SAMD51.
Example_08_AdvancedConfig is not currently working on SAMD51. To use alternate pins for I2C on the SAMD51, it gets a little more complex (involving SERCOM stuff). This example is still working on the ESP32 IoT Redboard, so we are going to leave this alone for now.
If anyone comes across this comment and wants to pursue the AdvancedConfig example on a SAMD51, then we would recommend they check out our tutorial on utilizing SERCOM on SAMD Boards:
https://learn.sparkfun.com/tutorials/adding-more-sercom-ports-for-samd-boards/all#adding-an-i2c
Also note, Example_10_TimeStamp has an issue with the SAMD51 Arduino Boards package not being capable of printing a uint64_t (the timestamp type variable).
Because most examples are working now, we will go ahead and push these changes to the branch and soon after merge into main.
Hope this is helpful to you (and other SAMD51 users), please let us know how your setup is going,
Thanks, Pete
SAMD51 support added in release v1.0.3.
Subject of the issue
I have the SparkFun Thing Plus SAMD51 (Qwiic) and the SparkFun VR IMU Breakout - BNO086 (Qwiic). I downloaded all the required libraries. When i program the SAMD51 after the program uploads successfully the board reboots out of bootloader and then windows gives me a notification "USB device not recognized" and does not display a com port. If I upload the Adafruit BNO08x example it works as expected.
Your workbench
Steps to reproduce
Try to program a SparkFun Thing Plus SAMD51 with the SparkFun examples for the SparkFun VR IMU BNO08X.
Expected behavior
Should be able to view the Serial console with the data from the sensor.
Actual behavior
Windows says "USB device not recognized" and you cannot use the serial monitor.