borenis:
Hi Gregory !Fisrt, I'm sorry for my long silence, I've had urgent problems to solve and my MPU9250 was not my priority since september !
I yesterday downloaded your last version of avrcopter, and... It doesn' workI use an Arduino UNO, just like you.
When using I2C-scanner, I can find a device at I2C adress 0x68.I do not use the makefile, but the ide compiler... Is that a problem ?
In your code, I've add #define MPU9250 in inv_mpu.h, and #define MPU_DEBUG in all .hI get this :
MPU init: 3
Free mem: 208I've searched were the error comes from.
It happens at the very beginning of the program, at the call of ret = mympu_open(200);
I've searched a bit more...
In mpu.cpp, function mympu_open(...), call to mpu_init(NULL) returns -7Then, I've found that comes from inv_mpu.cpp, function mpu-read_mem, in wich
st->chip_cfg.sensors equal 0Have you any Idea of the origin of the problem ?
Many thanks !
PS : have you tryed the MPU9250 ? If not, and if you are interested, I'd be happy to send you one on a breakout board !
Hi,
The key issue in here is mpu_init which returns -7.
the chip_cfg.sensors is correct to be 0 at this stage. It will change its value after mpu_set_sensor is called: ArduinoMotionSensorExample/mpu.cpp at master · rpicopter/ArduinoMotionSensorExample · GitHub
As you rightly point out the value -7 comes due to an error on mpu_read_mem:
What makes me think that the address (0x17) might not be correct. I do not have the datasheet in front but google tells me that there are devices with revision address of 0x16. Can you please try changing the address?
Thanks,
Gregory
P.S. Alternatively, you might want to just comment out/delete lines 720-729.