rizacelik / STM32F411CEU6_INAV_Firmware

STM32F411CEU6 Board Firmware
124 stars 33 forks source link

GY91 SPI implementation #5

Closed synersignart closed 9 months ago

synersignart commented 1 year ago

I plug the board to SPI1 involving Pins A4 A5 A6 A7 on the GY91 MPU9250 as INAV implementation for these sensors are on ISP perhaps we can included as SPI sensors and let users plug in these sensors via SPI and retain the MP6050 as I2C MPU 6000 MPU 6500 MPU 9250 BMI160

some are moving away from the MPU6050 I2C sensor as it its old and prone to Horizon drift ,.

Solution is to implement the SPI sensors into the Target as these sensors I listed are also available as SPI boards too. why not make use of them.

rizacelik commented 1 year ago

Hi The latest firmware has been recompiled to use the sensors. I do not have SPI supported sensors, but I will add this support in the next firmware.

synersignart commented 1 year ago

hmm can you share the source target too of your STM32F411 along with the Forked INAV you moded. As it would be helpful for the INAV community to work bugs out . I'll see if i can work this out. also I do need info on the WS2811 Led strips where did you locate the pins. also my build now with the help of other community now supports SPI but id good to know that the to have the 6050 available.

Agusg666 commented 1 year ago

Let me share my experience using the mpu6050 gyro160 i2c, during the test of more than 100x flights never had a significant failure when using the inav Rizacelik firmware, now I tried the gy -87 mpu6050 and gy-6500 by cutting all sides of the PCB into small pieces and installed the soft mount right on the STM32f411ceu6 chip development board. sorry I use Google translate

synersignart commented 1 year ago

ah finally some update but due to chip market inconsistency on the MPU9250 Ive use the BMI160

fabriciosilveira-sjc commented 1 year ago

Hello @rizacelik. The INAV flash was a success of the STM32F411 (Black Pill). I'm using the GY-91 module, with MPU 9250 and a BMP280. In Arduino the GY-91 worked perfectly, but in INAV Accel and Gyro are not recognized, what can I do to solve it. I tried to use all the fw you made available, but without success. image

rizacelik commented 1 year ago

Hello; You have made the cable connections correctly and the BMP280 seems to be working. In the Configuration tab you should see the MPU-9250 in the sensor list. Select it if it is in the list.

fabriciosilveira-sjc commented 1 year ago

Hello @rizacelik I connected the GY-91 according to the image in your tutorial. In INAV (Configuration tab) tests with all MPUs (6000, 6500, 6050, 9250), in none of them INAV recognized. image

rizacelik commented 1 year ago

Your link is incorrect. See "Full wire connection" on the main page. Uses SPI Sensors cables B12,B13,B14. image

fabriciosilveira-sjc commented 1 year ago

I did that too and it didn't work either. Pins B12, B13, B14 and B15. I tried in I2C and SPI, and neither worked.

On the Arduino the GY-91 module worked perfectly.

rizacelik commented 1 year ago

How is your configuration screen? can I see.

fabriciosilveira-sjc commented 1 year ago

I'm using version 6.0 of INav.

When I connect the GY-91 with SPI the baro doesn't work.

image image image image

rizacelik commented 1 year ago

image Is the MPU9250 on this list? Or what sensors are there?

fabriciosilveira-sjc commented 1 year ago

Test with all flags in the image, none worked. image

fabriciosilveira-sjc commented 1 year ago

Using an Arduino Uno, I managed to use the GY-91 using I2C and the library for the MPU6050.

https://user-images.githubusercontent.com/73246642/227252395-2ae8322a-061f-45cf-854f-cd3abd33fc0c.mp4

rizacelik commented 1 year ago

OK GY-91 itis working I2C. No problem. INAV SPI connected support. Please select congigrasyon an test.

image

fabriciosilveira-sjc commented 1 year ago

Even putting it in AUTO doesn't work either.

WhatsApp Image 2023-03-23 at 14 22 11

https://user-images.githubusercontent.com/73246642/227288870-b0a07116-bb8e-466c-80d9-58cba68dd28d.mp4

fabriciosilveira-sjc commented 1 year ago

As MPU9250 does not work.

rizacelik commented 1 year ago

Is your wire connection as follows?

image

fabriciosilveira-sjc commented 1 year ago

Exactly, this is the connection.

This GY-91 module is only communicating with I2C (SCL and SDA), with SPI (MOSI, MISO...) it doesn't work.

rizacelik commented 1 year ago

Looks like the AK8963 magnetometer needs to be bypassed. I will work for it and post the result here.

fabriciosilveira-sjc commented 1 year ago

Riza, in this GY-91 module, has no magnetometer, only Gyro and Baro.

Sorry so many questions rs

rizacelik commented 1 year ago

I did a recompile, can you test it? inav_6.0.0_STM32F411CE.zip

fabriciosilveira-sjc commented 1 year ago

Hello Riza, I can't put Black Pill in DFU on INAV, the computer doesn't recognize it as STM Bootloader. I made the recording of the new fm that you compiled, via FTDI recorder. But it didn't work. I tried to do it in AUTO, MPU6050, MPU6000, MPU6500 and MPU9250, without success. image image

fabriciosilveira-sjc commented 1 year ago

I tried just now and the PC recognized it as DFU, I flashed it through INAV, but the GY-91 still didn't work.

rizacelik commented 1 year ago

Ok. MPU9250 is set to I2C1, DFU should work. Please test it.

I2C1

SCL -> PB8 SDA -> PB9

inav_6.0.0_STM32F411CE.zip

fabriciosilveira-sjc commented 1 year ago

I made the connection via I2C. Barometer okay. I tested all the Acc options, without success. image

rizacelik commented 1 year ago

The GY-91 Module is unfortunately seen as MPU9255, not MPU9250. Registers are different. Necessary warning has been made at this address. https://github.com/ricardozago/GY91-MPU9250-BMP280 I recompiled based on this information, I hope it will be successful this time. Please test and post the result. inav_6.0.0_STM32F411CE.zip

fabriciosilveira-sjc commented 1 year ago

I flashed the new fw. I tested all MPUs to no avail. The connection is in I2C.

rizacelik commented 1 year ago

What's the result? failed?

rizacelik commented 1 year ago

Can you try for the last time? inav_6.0.0_STM32F411CE.zip

fabriciosilveira-sjc commented 1 year ago

Hello Riza, INAV has the Baro symbol in blue (BMP280). But the Acc didn't work out. I've tried every version of INAV you sent me.

rizacelik commented 1 year ago

I tried a lot but unfortunately it didn't work. It may be chip sourced or the INAV libraries may not be written for it. I made you test it by changing the registers, but it still didn't work. Take care of yourselves.

fabriciosilveira-sjc commented 1 year ago

It worked...!!!!!!!! https://user-images.githubusercontent.com/73246642/227620307-c4cc3b31-6a8f-41eb-a06a-8b064ad21ff5.mp4 Thanks Riza....

rizacelik commented 1 year ago

It's great, we did it together. :) Did you use the latest firmware? If the latest firmware I sent, I will distribute accordingly.

fabriciosilveira-sjc commented 1 year ago

I used the latest firmware you provided.

synersignart commented 1 year ago

Riza, in this GY-91 module, has no magnetometer, only Gyro and Baro.

Sorry so many questions rs

yes oddly the MPU9250 or GY91 has the Gyro and Acc available in SPI how ever INAV doesnt have the means to get the Mag and Baro in SPI as well in my case I use the seperate Mag and Baro to run i2c

synersignart commented 1 year ago

Hello Riza, I can't put Black Pill in DFU on INAV, the computer doesn't recognize it as STM Bootloader. I made the recording of the new fm that you compiled, via FTDI recorder. But it didn't work. I tried to do it in AUTO, MPU6050, MPU6000, MPU6500 and MPU9250, without success. image image

1st the BackPill (Weact Studio warns of Clone Black pills that wont flash or operate as intended) pls not of sources 2nd the STM32F411 has this weird perk that at 25mhz can cause issues getting in DFU mode the work around is to preheat 25c the chip buy plugging it in for a few mins before plugging it to attempt to DFU mode. (this the reason most FCs that uses this chip runs with a 24mhz crystal) Blackpill is an oddity that runs on 25mhz

rizacelik commented 1 year ago

Hello sinersignart; There are three different MPU9250 modules on the market. WHOMI records are 0x71 , 0x73, and 0x75. INAV only uses the real WHOMI record with 0x71. Other modules are column products. Let's test with you as we did with mr fabriciosilveira-sjc. I recompiled according to the FIRMWARE 0x71 , 0x73, and 0x75 values I will post below. We can get around this problem if you test it and report the result. inav_6.0.0_STM32F411CE.zip

synersignart commented 1 year ago

Hello sinersignart; There are three different MPU9250 modules on the market. WHOMI records are 0x71 , 0x73, and 0x75. INAV only uses the real WHOMI record with 0x71. Other modules are column products. Let's test with you as we did with mr fabriciosilveira-sjc. I recompiled according to the FIRMWARE 0x71 , 0x73, and 0x75 values I will post below. We can get around this problem if you test it and report the result. inav_6.0.0_STM32F411CE.zip

I see , which one was adjusted in the the drivers accgyro_mpu9250.c

synersignart commented 1 year ago

where does the file IMU registries (HOMI record) are stored in INAV ?

can you point out the location of the file please

rizacelik commented 1 year ago

It's in the gyro_mpu.h file. Did the Firmware I sent sinersignart work?

synersignart commented 1 year ago

It's in the gyro_mpu.h file. Did the Firmware I sent sinersignart work?

ah the reason id ask is that im using our board which has very different Pin assignments hence I required to rebuild the INAV

so I just change #define MPU9250_WHO_AM_I_CONST (0x71)

the #define MPU9255_WHO_AM_I_CONST (0x73) might conflict from INAV default?

rizacelik commented 1 year ago

Your English is not fully understandable. No, conflict from INAV default.

fabriciosilveira-sjc commented 1 year ago

Hello Riza... once again many thanks for your help with connection and firmware for the GY-91. Another question, does the HC-SR04 signal work with the STM32F411 (Black pill) running INAV 6?

rizacelik commented 1 year ago

Hello. Sory. deprecated, will not work with INAV 2.0 and later.

fabriciosilveira-sjc commented 1 year ago

Olá. Sory, preterido, não funcionará com INAV 2.0 e posterior.

OK. I have two questions:

  1. Does STM32F103 (Blue Pill) run INAV 1.7.3? I couldn't make it work. That's for me to try using sonar.

  2. Is there a compatible sonar for A STM32F411 (Black Pill)?

Lalbabu2001 commented 10 months ago

I tried just now and the PC recognized it as DFU, I flashed it through INAV, but the GY-91 still didn't work.

How did you manage to get back dfu mode mine has same problem after flashing this crappy firmware.