No external mag detection on NAZE32 Rev6 7DOF
When I install iNav 1.2.0 stable on a Naze Rev6 7DOF, ( e.g. this one: https://www.aliexpress.com/item/New-Arrival-REV6-NAZE32-7DF-Flight-Controller-For-RC-Multirotors-Baseflight-Configurator/32596170179.html?spm=2114.01010208.3.1.23mz9A&ws_ab_test=searchweb201556_0,searchweb201602_1_10065_10068_112_10069_110_111_10017_109_108_10060_10061_10062_10057_10056_10055_10037_10054_301_10033_10059_10032_10058_10073_10070_10052_10053_10050_10051,searchweb201603_3&btsid=a1c262fc-710c-4580-8969-2101bcbb86b0 ) which has a barometer BMP 280 but no magnetometer installed an external magnetometer sitting in my GPS is no longer recognized.
Is there any reason why the external mag is not shown anymore?
My own compiled NAZE.hex file (RC4) from 08.28.2016 shows my external magnetometer HMC5883 correctly.....
OK, looks like we have a problem with HMC5883 on Naze target. Looks like this is the same as #578
Try powering it from a different power rail - on one board I had simmilar issues and connecting it to 3.3v rail instead of 5v solved the problem. Probably there is some issues in timing?
Ok, I used my laboratory power supply, adjusted it to exactly 3.3V,connected it to the motor connectorsof the NAZE32 so that the NAZE was booted up with 3.3V.
Next I plugged in the USB plug from my PC and started the iNav configurator.
And again there was no magnetometer shown.
Again status showed 2 i2C errors :+1:
status
System Uptime: 43 seconds, Voltage: 0 * 0.1V (3S battery - OK), System load: 0.02 CPU Clock=72MHz, GYRO=MPU6500, ACC=MPU6500, BARO=BMP280 Cycle Time: 2005, I2C Errors: 2, config size: 1668
with the iNav version from 08.28.2016 I got no i2C errors and the magnetometer is detected and works! So it seems like this bug of detecting an external HMC5883 has been introduced after 08.28.2016.
See also #578, #586. Reverting https://github.com/iNavFlight/inav/commit/0f63bc68575f3ff03e5db5819f8e815545b334ea would be interesting. It was introduced late in the release cycle with little regression testing.
My Flip32 (Naze32 clone) (with 0f63bc6 ) detects internal HMC5883l , testing continues
External HMC5883l connected to Flip32 in INAV 1.2.0 is also detected without problems. Anybody else can run those tests? @jstremmler can you revert 0f63bc6 and try then?
No issue with my Afroflight Naze32 Rev6 and Beitian BN880 GPS: 2016-09-12 @ 21:38:31 -- Flight controller info, identifier: INAV, version: 1.2.0 2016-09-12 @ 21:38:31 -- Running firmware released on: Sep 7 2016 11:26:35 2016-09-12 @ 21:38:31 -- Board: AFNA, version: 2 version INAV/NAZE 1.2.0 Sep 7 2016 / 11:26:35 (6cc415a) status System Uptime: 171 seconds, Voltage: 0 * 0.1V (3S battery - OK), System load: 0.03 CPU Clock=72MHz, GYRO=MPU6500, ACC=MPU6500, BARO=BMP280, MAG=HMC5883 Cycle Time: 2000, I2C Errors: 1, config size: 1668 bootlog Time Evt Parameters 0: 0 0: 1 500: 19 (0, 0, 0, 0) 500: 19 (1, 0, 1, 3) 500: 19 (2, 0, 2, 3) 500: 19 (3, 1, 2, 2) 500: 19 (4, 2, 2, 2) 500: 19 (5, 3, 2, 2) 500: 19 (6, 4, 2, 2) 500: 19 (7, 5, 2, 2) 500: 19 (8, 6, 2, 2) 500: 18 (9, 6, 2, 1) 500: 18 (10, 6, 2, 1) 500: 2 551: 3 1087: 9 (7, 0, 0, 0) 1548: 10 (8, 0, 0, 0) 1600: 11 (4, 0, 0, 0) 1600: 12 (2, 0, 0, 0) 3259: 13 (0, 0, 0, 0) 3259: 4 3759: 5 3810: 8
My flip32 with inav 1.2 detects internal HMC5883l without problems but my naze32 rev6 from banggood has problems with inav 1.2 and internal HMC5883l as explained in #578
Just a hunch.
set i2c_highspeed = offUSE_I2C_PULLUPin target.h
EDIT: There were no USE_I2C_PULLUP for F1 targets...
@anbello @jflyper might have a clue here. Could you try attaching pullups to SCL and SDA lines and verify if that helped? 4.7kOhm should be enough
(just signed up on Github to post this, forgive me if I am not following proper technical grammar/jargon or procedures to contribute to this issue. I just simply wanted to get my name in the hat as another person who has this problem and the behavior i've personally noticed.)
iNav Naze 1.2 Final: My FC is actually a Dragonfly 32 w/ baro+mag. I physically removed the mag chip because my GPS puck has a HMC5883 mag in it. I then installed a BMP280 baro sensor into the GPS puck and tapped that BMP280's SDA/SCL/pwr/gnd lines right into the GPS puck's main harness internally so the puck is an all-in-one GPS/Baro/Mag. It has worked flawlessly since April.
Last night I upgraded to 1.2 Final from 1.2rc2 and now my Mag in the GPS puck won't work if I have BARO_HARDWARE = 4 (BMP280) using the baro i installed in the GPS puck. BUT, if i change to BARO_HARDWARE = 0 (FC onboard baro) then the mag in the GPS puck (HMC5883) works fine....
In regards to this problem, and in the spirit of trying to decipher typical Github procedure and understand that iNav is essentially built on top of Cleanflight, the fact that i'm seeing other people with this same type of issue with the newest Cleanflight is it safe to assume that the core Cleanflight code used in iNav 1.2rc2 is older than the core Cleanflight code used in iNav 1.2 Final and thus the problem stems from the newer core Cleanflight code?
@Snowboard-Nut
FYI, BARO_HARDWARE=0 does not mean on-board baro; it is another way of saying "Whatever found first". For NAZE (I believe you are using this target), INAV-1.2 (release) code probes baros in this order: BMP085, MS5611, then BMP280.
Some questions for clarification.
(1) I assume your on-boad baro is MS5611, correct? (2) Are you using any break out board for the external BMP280? (3) Can you tell us how you are wiring other pins of the external BMP280; especially the VDDIO and SDO pins. (4) Does your external BMP280 work with BARO_HARDWARE=4? (5) Does your internal baro work with BARO_HARDEARE=0? (6) It will be very helpful if you can attach result of CLI bootlog command for two cases under INAV-1.2 (Release).
In regards to this problem, and in the spirit of trying to decipher typical Github procedure and understand that iNav is essentially built on top of Cleanflight, the fact that i'm seeing other people with this same type of issue with the newest Cleanflight is it safe to assume that the core Cleanflight code used in iNav 1.2rc2 is older than the core Cleanflight code used in iNav 1.2 Final and thus the problem stems from the newer core Cleanflight code?
Changes in CF does not automagically change things in iNav. How did you know CF users having the same issue?
#465 Increase GPIO speed to 50MHz for I2C pins
May be non-related. Just a reminder.
@jflyper
BARO_HARDWARE=0 does not mean on-board baro; it is another way of saying "Whatever found first".
This screenshot is what led me to believe that baro_hardware = 0 would cause the firmware to default to the particular target's default expected mag chip normally found onboard, which in the case of a Naze is HMC5883 so on the I2C bus it should have seen my mag in the GPS puck that is connected via I2C considering the onboard HMC5883 is physically "removed" from the FC. My HMC5883 integrated into the current GPS puck has worked perfect for months running everything iNav 1.2RC2 and previous back to 1.1.

on a side-note; I tried all 7 values for baro_hardware with same failure each time. More answer's coming to your other questions...
@Snowboard-Nut I'm afraid the document is out dated...
@DzikuVx I tried with pullups on i2c lines and it works: on my naze32 rev6 (clone from banggood) without pullups on several reboot I have near half times internal mag detected and the other half not detected, with pullups always detected. I have to specify that with iNav 1.1 I have no such problems. Another thing that I don't understand is that even when the mag is detected I have: "I2C error: 1".
On spf3evo i constantly have 3 i2c errors on all the others i have 1 (pf3 deluxe and sparky)
Il 17/set/2016 14:55, "Andrea Belloni" [email protected] ha scritto:
@DzikuVx https://github.com/DzikuVx I tried with pullups on i2c lines and it works: on my naze32 rev6 (clone from banggood) without pullups on several reboot I have near half times internal mag detected and the other half not detected, with pullups always detected. I have to specify that with iNav 1.1 I have no such problems. Another thing that I don't understand is that even when the mag is detected I have: "I2C error: 1".
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/iNavFlight/inav/issues/594#issuecomment-247767949, or mute the thread https://github.com/notifications/unsubscribe-auth/ALSWipwXTRWam0nYg7qjfAZAuqXdOxxVks5qq-M5gaJpZM4J6NXY .
@anbello Thanks for the report. Can you give us the value of the pull-ups you gave?
@anbello @bk79 I2C errors could be ignored if they remain small; they are generated during the process of probing the I2C bus for possible device and ending up with timeouts.
Slow, but periodic error could be generated by turning on feature DISPLAY without connecting an appropriate OLED display.
However, errors that rises very rapidly, in hundreds per second, or sporadic errors should be noted.
@jflyper 4.7K on both scl and sda