-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initialization of the sensor returned: Data Underflow #7
Comments
@limgm Thanks for reaching out! This question would fit better on the SparkFun forums because it is not necessarily an issue with the software. Here's a link to the Inertial Measurement Units subforum where you can (and should) continue this inquiry. Please first search that forum to see if there are similar topics, and if there is not please make a new post. When you do it would be useful to know more details about your situation such as:
From what I can see ("Initialization of the sensor returned: Data Underflow") I suspect I2C communications trouble. Perhaps wiring or using the wrong I2C address? I'd be happy to keep helping you on the forums -- that way the information can be easily accessible to all SparkFun customers. If we end up finding out that this is caused by a problem with the library then we can move back here and fix it. Thanks! |
@oclyke Thank you for your suggestions, I tried to remove and reinstall the board definition for esp32 by espressif and now the sensor is able to output the data correctly. Thanks for your help! |
to make it work on an arduino NANO the AD0_VAL has to be 0. AD0_VAL = 1 does not work on an NANO: #define AD0_VAL 0 // The value of the last bit of the I2C address. |
thank you very much I ended up also using the sparkfun esp32 thing plus 9DoF IMU Breakout // Sparkfun ESP32 Thing Plus Just using the Qwiic cable didn't work |
This works to read both, the accel, gyro and calculates roll pitch ... temp // Basic demo for accelerometer readings from Adafruit ICM20948 #include <Adafruit_ICM20X.h> Adafruit_ICM20948 icm; float GyroErrorX, GyroErrorY, GyroErrorZ; int c = 0; void setup(void) { Serial.begin(9600);
// Try to initialize!
} // icm.setGyroRange(ICM20948_GYRO_RANGE_2000_DPS); // icm.setAccelRateDivisor(4095); //Serial.print("Accelerometer data rate divisor set to: "); // icm.setGyroRateDivisor(255); //Serial.print("Gyro data rate divisor set to: "); // icm.setMagDataRate(AK09916_MAG_DATARATE_10_HZ); // to calculate IMU error void calculate_IMU_error() { // We can call this funtion in the setup section to calculate the accelerometer and gyro data error. From here we will get the error values used in the above equations printed on the Serial Monitor.
}
} //////////////////////////// loop //////////////////////// void loop() { // Get a new normalized sensor event AccX = accel.acceleration.x; // Sum all readings // === Read gyroscope data === // // correct the gyro.gyro.x, y and z values // Currently the raw values are in degrees per seconds, deg/s, so we need to multiply by sendonds (s) to get the angle in degrees // Print the values on the serial monitor //Serial.print(" roll: "); // Display the results (acceleration is measured in m/s^2) //Display the results (acceleration is measured in m/s^2) //Serial.println(); // Serial.print("Temperature"); //Serial.println(); //delay(500); // Serial.print(temp.temperature); // Serial.println(); /* // Get a new normalized sensor event Serial.print("\t\tTemperature "); // Display the results (acceleration is measured in m/s^2) Serial.print("\t\tMag X: "); //Display the results (acceleration is measured in m/s^2) //delay(500); // Serial.print(temp.temperature); // Serial.println(); |
Hello, @limgm I am facing the same similar issue on esp32. What you mean with "remove and reinstall the board definition for esp32" |
Hey, @jonra1993. Did you solve your problem? I am also having a similar issue on esp32. |
Same issue on Lilygo T-Display S3 (ESP32), I guess it will be just a cry in the void... |
Please give us a few more details... Are you using I2C or SPI? Which 20948 board are you using? If you are using I2C, it could be pull-up related. The ICM-20948 works really well with ESP32, but you do need pull-ups on the I2C bus. And I don't see any on the T-Display schematic... |
I have a "SparkFun 9DoF IMU Breakout - ICM-20948" connected to the device via Qwiic on I2C, I uploaded the basic example code on my device, but it keeps giving me errors:
Some info about the T-Display S3: |
OK. Thanks. This is probably an I2C pin definition issue. The ESP32S3 module defines the I2C pins as 8 and 9: But LilyGO seem to use 17 and 18: You will - I think - need to define a custom Wire port using the correct pin numbers. I hope this helps, |
Hi Fabrizio (@Fabryz ), It might be as simple as changing line 43 from Best wishes, |
Hi @PaulZC thanks for your help, I've just learned that I can find some useful information just by giving a look at the headers files inside the libraries, this will be helpful to debug stuff in the future. I've changed that line with the initialization on SDA and SCL pins, but nothing changed, I still have the same error. |
Hi @Fabryz , OK. Thanks for the feedback. Which board definition are you using? ESP32S3 Dev Module? A logic analyzer would help you debug this. Just to make sure you see correct activity on the SDA and SCL pins. Do you have a different I2C device you can try? Again that would help confirm you are using the correct port / pin definitions. Best wishes, |
@PaulZC Yes, I'm using "ESP32S3 Dev Module" with all the settings suggested by the official docs for this device. I don't have a logic analyzer, I'm just a beginner on this. I also have a "SparkFun Qwiic Haptic Driver - DA7280", again I've already used its basic example, I've just tried to set the pins for SDA and SCL, here actually I don't even get any output on the serial monitor. I've created a thread on sparkfun's forums for both sensors, but so far there were no answers, I will update with your suggestions, just to keep track also there for the posterity Thanks for your time |
@PaulZC I've managed to find the solution! Thanks to this guy https://github.com/VolosR/TemperatureTDisplay/blob/main/TemperatureTDisplay.ino#L43 The correct settings are:
But why? As we saw here: #7 (comment) |
Hi Fabrizio (@Fabryz ), Excellent detective work! This does all make sense... On the T-Display pinout diagram, they do show 43 and 44 next to the Qwiic connector: And looking closely at the schematic, they have used U0RXD and U0TXD: It's puzzling as I would have expected them to connect using 18 and 17 (I2C SDA and SCL) like they do on the breakout pins: Anyway, problem solved! Glad that's working for you, |
Thank you for creating this useful library.
I have just bought a new set of SparkFun ICM-20948 and SparkFun Thing Plus - ESP32 WROOM, after successfully compiling and uploading the Example1_Basics, I got the error on the Serial Monitor:
Did I miss out anything?
Thank you for your help.
The text was updated successfully, but these errors were encountered: