Issues about mbed and using a MPU9250 in Arduino


#1

I’ve got a BLE nano v2 and I have tested with blink and simplechat via BLE in Arduino IDE.

I am considering to use this board with an IMU to transmit data via BLE.

When trying to use a Sparkfun MPU9250 (https://learn.sparkfun.com/tutorials/mpu-9250-hookup-guide) with the provided code example, there are all errors when uploading the code. The error message is pasted at the end. Any idea about how do I fix this?

And another issue is about how to use mbed? In the mbed editor, only BLE Nano (version 1, nRF51) is available. If I change the board to nRF52-DK, errors when compiling any code.
What should be the usual procedure to use mbed to compile code?

Thank you.

Part of the error message is as following:

C:\Users\Owner\Documents\Arduino\libraries\SparkFun_MPU-9250_9_DOF_IMU_Breakout\src/MPU9250.h:204:22: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]

     uint8_t Gscale = GFS_250DPS;

                      ^

C:\Users\Owner\Documents\Arduino\libraries\SparkFun_MPU-9250_9_DOF_IMU_Breakout\src/MPU9250.h:205:22: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]

     uint8_t Ascale = AFS_2G;

                      ^

C:\Users\Owner\Documents\Arduino\libraries\SparkFun_MPU-9250_9_DOF_IMU_Breakout\src/MPU9250.h:207:22: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]

     uint8_t Mscale = MFS_16BITS;

                      ^

C:\Users\Owner\Documents\Arduino\libraries\SparkFun_MPU-9250_9_DOF_IMU_Breakout\src/MPU9250.h:209:21: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]

     uint8_t Mmode = 0x02;

                     ^

C:\Users\Owner\Documents\Arduino\libraries\SparkFun_MPU-9250_9_DOF_IMU_Breakout\src/MPU9250.h:215:23: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]

     uint32_t delt_t = 0; // Used to control display output rate

                       ^

C:\Users\Owner\Documents\Arduino\libraries\SparkFun_MPU-9250_9_DOF_IMU_Breakout\src/MPU9250.h:217:22: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]

     uint32_t count = 0, sumCount = 0; // used to control display output rate

                      ^

C:\Users\Owner\Documents\Arduino\libraries\SparkFun_MPU-9250_9_DOF_IMU_Breakout\src/MPU9250.h:217:36: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]

     uint32_t count = 0, sumCount = 0; // used to control display output rate

                                    ^

#2

Again errors with mbed tutorial in github:https://github.com/redbear/nRF5x/blob/develop/nRF52832/docs/Mbed_IDE_User_Guide.md

But the hex examples in the GitHub works.


#3

Hi @hanspond,

The build message shows no fatal errors. Was the sketch uploaded successfully? And if the Nano works as expected?

The Nano2 does not support programming using mbed. But you can select the nRF52-DK as the target platform, while you should refer to the Nano2 pin mapping to make sure that the pins you’ve defined in your application is the same as you actually wired.

Best regards,
Guohui


#4

Hi hanspond,
I have exaclty the same issue as you describe. I don’t why I have those error. Maybe its from the custom Wire.h lib in nrf5x file?
Any starting point would be welcome.
Thank you in advance
Michel