Firmware uploaded from artemis firmware uploader gui shows output but not when uploaded from arduino

Hello guys,

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?

Hi joadleena,

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:

https://github.com/sparkfun/OpenLog_Art … #L131-L132

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:

https://github.com/sparkfun/SparkFun_IC … by-default

Best wishes,

Paul

Hello Paul,

I am using the Redboard artemis board. Changing the line in ICM-20948 library worked !

Thanks.

Hello Paul,

I have one question, now the status is “All is well” but I am still not able to see the gyro and accelerometer data.

Do I need any more changes in order to see that?

Hi,

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?

Best wishes,

Paul

Hello Paul,

I am using Red OLA as the board. There is no more hardware or software config from our side, I have just copy pasted the firmware sketch provided here https://github.com/sparkfun/OpenLog_Art … Basics.ino

https://github.com/sparkfun/OpenLog_Art … og_Artemis

my bad…

Hello Paul,

Sorry to confuse you.

Initially I was trying to upload the Example sketch https://github.com/sparkfun/OpenLog_Art … Basics.ino

Making changes in h file worked for it and I am able to see the data also.

Now issue is with https://github.com/sparkfun/OpenLog_Art … og_Artemis

when I try to compile , I get error saying :

Arduino: 1.8.14 (Windows 10), Board: “SparkFun RedBoard Artemis ATP, 115200, Ambiq Secure Bootloader (Advanced)”

Firmware_v2:125:10: fatal error: settings.h: No such file or directory

#include “settings.h”

^~~~~~~~~~~~

compilation terminated.

exit status 1

settings.h: No such file or directory

This report would have more information with

“Show verbose output during compilation”

option enabled in File → Preferences.

Do I have to include only the open log artemis and settings or all other sketches also?

Thanks,

leena

Hi Leena,

If you want to compile the OpenLog Artemis firmware yourself, then, yes, you need all the files from this folder:

https://github.com/sparkfun/OpenLog_Art … og_Artemis

You will also need to install all the libraries used by the firmware. It is a lot:

https://github.com/sparkfun/OpenLog_Art … #L250-L274

Using the pre-compiled binary is much easier.

Best wishes,

Paul

Oh, I see…thanks a lot for quick replies Paul :slight_smile:

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?

Also, I do not see any gyro or accelero data when I compile and upload this (along with the change mentioned in .h file): https://github.com/sparkfun/OpenLog_Art … ensors.ino

Hi Leena,

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.:

https://github.com/sparkfun/SparkFun_IC … -831694628

Best wishes,

Paul

Okay, Thanks for the explanation !

I tried rotating the sensor manually and now I see this line :

Error while setting serial port parameters: 115,200 N 8 1

Does that have something to do with the DMP? or anything else, I am not sure !

-Leena

Hi Leena,

That’s a different issue - linked to the USB Serial connection. Maybe the connection moved or was interrupted while you were moving the board?

Best wishes,

Paul

Hello Paul,

Could you please tell me what is:

const int FIRMWARE_VERSION_MAJOR = 2;

const int FIRMWARE_VERSION_MINOR = 0;

in the firmware https://github.com/sparkfun/OpenLog_Art … rtemis.ino

and what would happen if we change those values?

Also, I do not understand about #define OLA_IDENTIFIER 0x120

what would be the effect if I change that value too?

Thanks,

Leena

Also, I do not see any Quaternion data :frowning:

Hi Leena,

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.

Best wishes,

Paul