Massive error in i2c
I flash the latest 1.3 RC2 , because the earlier have a problem to detect the magnetometer (BMP280) on my naze. i think this issue may be corrected. but now after 1 minute (aprox) the i2c error increase from 4 to a masive number (aprox +200 error per second) and Cycletime goes from 2000 to 11000. An of couse the FC freeze. thanks to all people who work to make inav/cleanfligth better
Sounds like a hardware error on the bus.
Please share details of your setup. What board, what sensors are connected? Do you have external compass connected to the board?
Looks like I2C timeout (#713, #720) it's not the only problem. I believe I2C driver requires a serious rewrite to properly handle all bus conditions. Or at least be simplified to the level of one used in F3. I'll look into it once I get INAV-1.3 released.
ok thanks, i had not seen the other entries. i believed that the problem with the magnetometer was already solved. im not a programer, sorry. My board is a NAZE32 rev6a 10DOF: MPU6500 BMP280 and external HMC5883 (on board disable by cut) Of course i try cleanfligth and fly good, and all sensor have very few i2c error.
Hello, im try the last release 1.3 and i have exactly the same problem. i2c error increase after 1 minute (or less). and the boad freeze because cycle time increase too. I think is not a hardware problem because with INAV 1.2.1 i have not this problem. I try CLEANFLIGTH and with the last release 1.14 i have this problem too. (earlier cleanfligth releases no problem),. i need to wait more time to try inav on my FC.. :(
@gendebeat this looks like hardware issue which current implementation is unable to cope with - looks like you're the only one having this problem.
I'm looking into making I2C driver more robust but that will take time.
I confirm this with dof6/rev6a naze32 INAV-1.3, 1.2 and 1.2.1. Baro connected - gy-68 (BMP180). MC time to time startup correct, and in most case after short time become very slow with many i2c errors. This can lead to cpu consumption (600-700%) with cycle time about 16000-17000.
Baro connected to MC pin's with short (2-3cm) wire on board.
@gendebeat, @brumbad Can you please test this hex https://www.dropbox.com/s/tc48euihxlugib0/inav_1.5.0_NAZE_a0207d0.hex?dl=0 ?
It has massive changes to i2c bus driver, maybe it will solve the issue for you.
@digitalentity hello, this hex work correct!! i not flying, i wil try this weekend. But now i can say that there some i2c error, but dont freeze. CPU load is allways at 2-3%. cycle time 2000 thanks!
@gendebeat if i2c error count increases over time it's an indication of unstable hardware. I wouldn't trust that setup. But still, good to know that a single bus glitch won't cause a crash with 100% probability.
I'm closing this issue now
Can confirm the latest 1.6-rc2, and 1.5.1 still have this problem on spracing f3 acro (clone) with external hmc5883 gyro. (so does betaflight 3.1.5). i2c errors go through the roof, cpu usage to 900%.
@AvengerIl It's very likely faulty hardware. I2C code in 1.6 is reasonably robust - if it doesn't work - 99% possibility that there is something wrong with the hardware.
@digitalentity FC or the ublox n7 gps with compass module more likely to be at fault? any external mags that are known to be good?
@AvengerIl you could go for a Naza gps then you won't require the I2C (mag and gps are encoded in one serial stream) and they work well in iNAV
@Redshifft thanks... do have one of those lying around... I tried a F1 NAZE32 rev6b with the same i2c mag and it worked fine, does not lock up... must be the spracing f3 clone w/ osd causing the problem.
too many options, too many decisions... i really want 8khz and dshot running.. AND GPS..
I hear an F4 calling you ;)
Using Omnibus F3 AIO and Neo 6m after a minute or two I get I2C errors and mag unhealthy warning. All works okay at reboot.
I'm troubled by the statement that it must be a hardware (mag) issue as I've tried two different GPS' with the same result, eventual failure (as indicated by Inaz or EZGUI) of mag on GPS module. These modules are known workers on APM 2.5 and 2.6 boards.
I saw this failure once in flight as I was setting up my copter. It just turned and augered in from low altitude.
Any chance for a rethink on the cause? Why would I2C be error free for more than a minute or and then start getting errors?
Hardware problems seems a bit too convenient but i'll admit, I'm far from an expert at these things.
Thoughts or further insight?
@Waltec I have the exact same problem with the same board and neo-m8n. Did you found a solution?
Not yet. I've been pointed in a couple of directions and I have my own theory. The one thing I tried was eliminating the overclocking of the I2C that someone suggested. That had no effect that I could tell.
Its been suggested that the mag should have 3.3v vs the 5v that my gps/mag module specifies but I've not explored that yet...I don't have a 3.3v source on the copter at present. Tough to wrap my head around that one as my module(s) call for 5v, and, they've worked fine on other FCs various APMs that is). I'll explore that at some point but I've not had any real time to get back to my bench.
My theory though is that (as I read somewhere) since the I2C bus shares resources with the UART3 (I think it's #3 is what I've read) there is some sort of data collision happening. I'm working from memory here so bear with me...
I think it was dronetrest.com that spells out this sharing issue specific to using ppm receivers (I'm using a knockoff Spektrum satellite receiver which connects via different pins than a standard ppm receiver but I'm guessing that qualifies). I'm guessing that the ppm data and the mag data "collide" on the shared resource and cause the I2C errors. Again on dronettest I think it is suggested to recompile the Inav firmware but doing so while uncommenting the "avoid_using _uart3" or somesuch statement. I'm a bit over my head on all this to begin with but recompiling is something I've not done before,so, I haven't tested this fix yet. Not sure if I will because recompiling is a whole new set of learning and as best I can tell requires a Linux setup which I don't have right now. Add to that that I'm wondering what problems you might be inviting by changing the firmware... why isn't Uart3 being "avoided" in the first place?
In looking at the Inav wiki I see that the Omnibus F3 AIO isn't in the fully supported category so I'm wondering if that's not a contributing factor on this issue.
I'll post back if I did pursue any of these fixes but for now I've opted to swap in an SP F3 board thinking it might be the quicker path to getting my copter back in the air again.
Not sure I've furthered the cause any but thanks for the question/response. Hopefully I've suggested something to go after if you are so inclined. If you do chose to tinker further, and something works or shows promise, I'd enjoy hearing about it!
Regards and Good Luck, Waltec
Sent from my iPhone
On Apr 20, 2017, at 2:53 AM, Michael Galler [email protected] wrote:
@Waltec I have the exact same problem with the same board and neo-m8n. Did you found a solution?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
I forgot to mention that along with the 3.3v question on the mag that there is also a question regarding having too many pull up resistors...one on the FC and one on the gps/mag module. I'm not entirely clear but to my understanding the FC having a resistor built in is what's causing the voltage problem since the module has one too.
Sent from my iPhone
On Apr 20, 2017, at 2:53 AM, Michael Galler [email protected] wrote:
@Waltec I have the exact same problem with the same board and neo-m8n. Did you found a solution?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.