MPU6050 Cloud compile and local compile both fail for Core

I found my old Spark Core and started playing around with it again. I’m trying to build a simple MPU6050 example to get started, but I can’t get it to build using any method.

My code includes MPU6050_6Axis_MotionApps20.h, and this gives me the following error:

lib/MPU6050/MPU6050.h:411:7: type 'struct MPU6050' violates one definition rule [-Werror=odr]

When Iinclude MPU6050.h instead, it will build just fine, but I need functions that are defined in MPU6050_6Axis_MotionApps20.h.

Meanwhile, I tried using the local build methods, but they don’t seem to support the core at all:

$ particle compile core src/imu.ino lib/MPU6050/src/ --target 1.4.4 --saveTo firmware.bin

Compiling code for core
Targeting version: 1.4.4

Including:
    src/imu.ino
    lib/MPU6050/src/helper_3dmath.h
    lib/MPU6050/src/I2Cdev.h
    lib/MPU6050/src/MPU6050_6Axis_MotionApps20.h
    lib/MPU6050/src/MPU6050_9Axis_MotionApps41.h
    lib/MPU6050/src/MPU6050.h
    lib/MPU6050/src/MPU6050/helper_3dmath.h
    lib/MPU6050/src/MPU6050/I2Cdev.h
    lib/MPU6050/src/MPU6050/MPU6050_6Axis_MotionApps20.h
    lib/MPU6050/src/MPU6050/MPU6050_9Axis_MotionApps41.h
    lib/MPU6050/src/MPU6050/MPU6050.h
    lib/MPU6050/src/I2Cdev.cpp
    lib/MPU6050/src/MPU6050.cpp
attempting to compile firmware 
Compile failed: Provide platform for compiling

(note that the compilation succeeds if I specify photon as the target platform.)

And VSCode doesn’t even let me choose core as my target platform. Am I out of luck because the core is so old at this point? Are there other options for manually invoking the toolchain? Can I edit the Makefile somewhere and move forward? All I want to do is use my core and IMU for a simple test using the MPU6050 libraries for data conversion.

Due to the memory limitations of the Core the last version supported on it is 0.8.0.

Are you sure? The web-based IDE allows me to select 1.4.4 as the highest version for my core:

Screen Shot 2020-05-04 at 9.29.01 AM

And further, if I choose a bogus version from the online interface, it includes 1.4.4 as the highest version that is supported in the help text:

$ particle compile core src/imu.ino lib/MPU6050/src/ --target 0.8.0 --saveTo firmware.bin

Compiling code for core
Compile failed: Invalid build target version.
Valid targets:
1.4.4
1.4.3
1.4.2
...

In any case, I tried with 0.8.0-rc.14 and I get the same error :frowning:

The ‘provide a platform’ message is because the Particle team forgot about the Core when updating the CLI. I don’t know whether this forgetting was unintentional or intentional.

Ah I see. So we have to wait for a new release… do you know if there’s an easier way to build? Several years ago when the core was still new, I the toolchain was really easy to use. I just had a Makefile and a cross-compiler and things Just Worked.

Actually I see they just released it today! The build goes through locally now! Except now I get the same error as I did from the web IDE:

lib/MPU6050/MPU6050.h:411:7: type 'struct MPU6050' violates one definition rule [-Werror=odr]

:confused:

Whenever I try to update I get a ‘timeout’…this happens on my Mac, my work laptop (Windows) and my work desktop (Windows. @jvanier @marekparticle - just tagging you guys in so you’re aware :slight_smile:
timeout

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.