@ardisd Hi David,
Sorry it took me so long to get back to you. I was able to enlist @tridge help on this. He went through quite a bit of different things to figure out the issue. Here is what he thought could be the issue
Poor quality power being supplied to the board
RF interference from an antenna ( you could remove any antennas and see if the problem goes away)
Wiring to GPS causing a problem on I2C (if there is a long wire run to the GPS, you could use a shorter wire and temporarily move the GPS and install the GPS closer and see if the problem goes away)
Looking at the errors, both the compass and baro errors were occurring at exactly the same time which leads us to think it is a communication problem
he asked whether you could reproduce the problem on the bench using a LOG_DISARMED set to 1 and fast logging.
The other thing he suggested was seeing if you saw a similar problem if you put the same set up on another matek same model board. If you could reproduce the problem that way then it could be a board issue.
Along the lines of the problem being an I2C problem, he wondered if you installed a pull up on the I2C. He said that the directions on how to do it are provided by the manufacturer.
Sorry about the uncertainty of the diagnosis but there wasn’t any data that could point us to conclude on what the issue is.
Again I apologize for taking so long to get back to you.
I don’t have another F405 board but could get one.
On the Pull Up resistor issue I don’t see any reference to installing a pull up resistor. perhaps you have a link
I also did a put the scope on the I2C clock and data line below are links to the sreenshots
Clock looks good. But I think there might be an issue with the data. There is a sharp peak, the voltage might be low and the noise.
@ardisd I saw them but haven’t had a chance to enlist @tridge help. I need to get you to speak with Tridge directly as I am not a hardware guy. If you have a discord account, you could get on and speak to Tridge about your findings. I will try to catch him tonight and see what he feels the next step would be.
If the scope you are using has had its probe properly calibrated then that is a pretty bad I2C trace. We see a slow rise time, and we’re seeing crosstalk between the clock and data lines. Unfortunately this is also what it looks like when the scopes probe isn’t properly calibrated.
I don’t know if the F405 boards from Matek provide a pullup on the I2C lines. Many boards originally designed for the inav/betaflight community don’t do that as they want to be able to reconfigure the pins as uarts when desired. So they leave off the pullups and let the user add the pullup when they want to add an i2c device.
You’d need to ask Matek if they do have pullups on their boards. If they don’t, then you should put a 1.5kOhm resistor between the SCL and SDA lines and the 3.3v rail.
@tridge@bnsgeyer Calibrated the scope probes and they where out unfortunately when I checked the I2C Data line there is still crosstalk from the clock line.
Going to strip the Flight controller out and check all the wiring.
@bnsgeyer got a new Matek H743 Wing Flight Controller with a CAN GPS. Have done one test flight with no errors. Hopefully in the next few weeks will get the Trex 450 flying setup to fly as well as the other flight controller. Going to put the F405 flight controller in a plane and see if I get any errors.