iNavFlight / inav

INAV: Navigation-enabled flight control software
https://inavflight.github.io
GNU General Public License v3.0
3.12k stars 1.47k forks source link

Matek F405OSD i2C bootloop problem #2501

Closed Skillertheking closed 6 years ago

Skillertheking commented 6 years ago

hey

sorry my english ist not very good, i come from germany

but i have the problem with the matek board an a GY-91 (10Dof) MPU9250 (acc,gyro) with integrated AK8963 mag and a BMP280

i have a fresh flashed inav 1.8 and no function activated at usart3 then i solder SCL on tx and SDA on rx of USART 3 + 3,3V and GND

put the usb cable in the fc an i have a nice bootloop

can anyone help me ?

digitalentity commented 6 years ago

Internally MPU9250 has the same gyro sensor as Matek board (MPU6500). Having the same gyro sensor on internal and external bus probably messes something up. If you want to use baro + compass you'll beter chose a board without gyro/acc sensor.

Skillertheking commented 6 years ago

ok i understand you.

hmm but i have gps module with compass (Ublox neo-m8n) but the compass was not found from the fc :( but the gps compass makes no bootloop

do you have a recommendation of a BARO/Compass board like a GY-?? that really works too

is the soft-i2c really on usart3 ?? I already read that it is on the motor pin S5-S6, but on other post is ledpin on S5. I´m confused :( the documentation ist very bad of this matek f405 board´s, no schematic/pinout,

straferr commented 6 years ago

hi Skiller,

I have the same F405OSD and it is working fine on iNav 1.8.0, using soft i2c (UART3) with external BMP280 baro board (GY-BMP280) and HMC5883 mag board (GY-273). RX3=SDA, TX3=SCL. You can easily buy these boards cheaply on eBay. If you use a BMP280 board, please be careful: the modules usually cannot accept 5V input and you must power it using only 3.3V (refer to my diagram below on where to get 3.3V from the Matek F405OSD - pay attention to the green boxes). The usual HMC5883 modules can accept either 5V or 3.3V power.

You did not mention what kind of M8N module you are using, but many of them have a built in mag. Usually, if a GPS module has a built-in compass, it will have 6 connection wires. Otherwise, if is GPS-only and no mag, it will only have 4 wires. If your GPS module has a built-in mag, you must determine which wires are for GPS(TX/RX), and which wires are the mag(i2c SDA/SCL). There is no "standard" wire colod coding, finding out the wires are may take some trial and error, or, you may need to open up your GPS module and look at the circuit board labels. Once you know what the wires are, the GPS wires should go to a spare UART (UART1 works well... ie. TX1/RX1), and the mag wires must go to UART3 where soft i2c is exposed.

Also, please note that the iNav configurator GUI v1.8.1 has a bug that gives the appearance that things are not working if you use a HMC5883 mag like I do. To make it work, first connect your sensors as described above. After that, in the GUI, the baro should be working OK, but the compass must be set to "AUTO". After rebooting, the GUI will show the compass as "FAKE" instead of HMC5883, but you will find that the sensors tab shows the compass working OK. This is the bug I mentioned earlier (I have reported it on iNav Configurator Github already - hopefully they will fix this in the next version of GUI). Don't worry - this is only a "visual" bug and the mag works OK (I have tested this).

Lastly, regarding where to connect stuff, I made this diagram for myself, but maybe this will be useful for you too. Good Luck!

straferr_f405osd_inavsensors_01

Skillertheking commented 6 years ago

your picture is very great 👍

okey with my gy-91 it will not work with the two basically identical MPU -> bootloop can i deactivate the internal i2c/mpu6500 ????

my gps has 6 wires and a AKM8975 compass (3,3/5, gnd, rx, tx,)gps /// (scl, sda) compass..... all wires are connected and NOTHING

at the top the mag symbol is red and at sensor tab show nothing an i can´t click this mag checkbox

straferr commented 6 years ago

Unfortunately, I don't believe you can deactivate the i2c on your GY-91 module unless you cut the PCB traces, or desolder the MPU6500. i2c is a bus, so if you "switch it off", your baro won't work either. I strongly recommend you use some other board, such as those I recommended above.

How exactly have you connected your GPS module? Any pictures? For the GPS, the GPS RX must go to TX1, and GPS TX must go to RX1. For the mag, try switching the SCL/SDA wires around. Also, make sure you have correctly set things up in the GUI (ie. GPS on UART1 and "AUTO" for mag type). If "AUTO" does not correctly detect your mag, try forcing it in the CLI. Also make sure your GPS module works with 5V (usually it does, but you need to make sure).

If that still doesn't work, what kind of GPS module did you buy? Not all Neo M8N modules are the same. Some work with Naze32/CC3D....etc and some are for APM/DJI Naza. There possibly other kinds out there too. If you bought a GPS module for APM/DJI-Naza (or something else, using SPI bus, for example), then I'm afraid you will need to ask someone else for help because I have no experience with those.

Skillertheking commented 6 years ago

i´m really confused

the sda/scl is on usart3 on cpu port C10 and C11 right?

when i look in cli under resource, print the fc at C10/C11 # FREE is that right? free

port (gps is on uart4 connected)

so when i activate usart3 MSP with dissconected mag(gpsmag) look the cli like this uart

I have already tried all i2c speeds (800,400,200,100) do I have to assign any parameters to the port? (C10/C11) people what am I doing wrong??

lossUAVes commented 6 years ago

I used Gy-91 (15x15mm CJMCU board) with Matek F405 MINI connecting A-DA and A-CL to SDA and SCL pads (IMU board pads). It uses IMU accelerometers. It works fine in 1.7.3 and 1.8 firmware versions, but only works the baro in 1.9 firmware version.

shlapion commented 6 years ago

Hello,

facing the same problem as @Skillertheking . Followed the guide provided by @straferr however the mag logo is still red. My setup is as follows

The GPS connected on UART 4 works. When setting the mag to AUTO detect, after rebooting it defaults back to NONE.

Is there any update on the problem?

Skillertheking commented 6 years ago

I think the problem is the emulated/software i2c of the f405osd.... i'm not a friend of "emulated" thinks ... many people have the same Problems ...

I purchase the f405 aio with real i2c and Works great

shlapion commented 6 years ago

Thanks for the info @Skillertheking

digitalentity commented 6 years ago

Emulated I2C works very well. It's either lack of pull-up resistors of issue with power supply to external sensor board.

shlapion commented 6 years ago

Hello @digitalentity,

the external sensor board is supplied with 5 V from the FC's 5v port. The GPS puck has 5v input so i didn't give it much thought. Will look into it and get back.

Thx for the pointer.

shlapion commented 6 years ago

So i have looked into the issue over the weekend. Sadly with no positive result. I have also changed the power supply of the external sensor to 3.3 V, because I read in the data sheet of the compass that the it can handle max 3,3 V. However the board on which the GPS module and the compass are mounted gave a voltage regulator. @digitalentity could you provide any further info on where and what type of pull up resistors i should mount.

shlapion commented 6 years ago

Answering my own question. Issue has been discussed in #1583.

stale[bot] commented 6 years ago

This issue / pull request has been automatically marked as stale because it has not had any activity in 60 days. The resources of the INAV team are limited, and so we are asking for your help. This issue / pull request will be closed if no further activity occurs within two weeks.

stale[bot] commented 6 years ago

Automatically closing as inactive.