I have been trying to upload the basic openlog artemis firmware from arduino gui into my IMU cnnected via usb cable. It gets compled and uploaded successfully, but istead of accelerometer and gyroscope data, I see following message on serial monitor:
Initialization of the sensor returned: Data Underflow
Trying again…
when I upload the same firmware in the form of .bin file from artemis firmwar uploader gui, it successfully uploads and also shows the expected output data on serial monitor.
Does anyone know what might be wrong ? or has anyone faced similar issues previously?
Can you give us more details about your OpenLog Artemis hardware and how you have your software configured?
That error indicates that the ICM-20948 IMU is not starting correctly.
If you have a Red (SparkFun) OLA then the code will work for you without changes. But if you have the Black (SparkX) OLA then you need to set HARDWARE_VERSION_MAJOR to 0 and HARDWARE_VERSION_MINOR to 4:
If you are trying to compile the latest firmware (version 2.0), you need to use version v2.1.0 of the Apollo3 core (Artemis board package) and you must select “Redboard Artemis ATP” as the board.
Finally, if you want to use the IMU “DMP”, you will need to change one line in the ICM-20948 library too. See this link for more details:
Please make sure you are using “Redboard Artemis ATP” as the board. The “ATP” is important.
Please tell us more about your hardware and software configuration. Do you have a red or black OLA? Are you trying to compile v2.0 of the OLA firmware? Which version of the Apollo3 boards do you have selected?
I have one more doubt , if OLA does not have a board definition of its own, why is it that it works fine with redboard artemis ATP only and not any other board selection from Apollo3?
The board selection is to do with the pin mapping from the digital pin numbers (D0, D1, etc.) to the physical pads on the Artemis package. On the ATP, the pin mapping is 1:1; D0 = Pad 0; D1 = Pad 1; etc… That is not always true for the other Artemis boards.
If you are seeing the Quaternion data, then the code and the DMP are working correctly. It may be a calibration issue? Please try: rotating the sensor slowly around all three axes; holding it stationary in all six orientations for a few seconds.
We know that the DMP does not behave perfectly. You will find discussions about this in the ICM-20948 repository. E.g.:
The two FIRMWARE_VERSION values show what version of the code you are using. You will see it on the serial monitor when you first start the OLA.
The OLA_IDENTIFIER tells the code what version of the code was running when the settings were written to SD card or into EEPROM memory. If the code knows the FIRMWARE_VERSION is v2.0 but it sees that OLA_IDENTIFIER is 0x117 (v1.7), then it knows the settings on SD card or in EEPROM memory are invalid, and so it will use the default values.
If you are using the OpenLog Artemis firmware, you will only see the Quaternion data from the DMP if you enable it. Use Menu option 3 to configure the IMU, then use option 12 to enable the DMP.