Compass MMC5983 not working on Ardupilot

Hi,

I’m currently testing an MMC5983 magnetometer on a Pixhawk 6X flight controller running ArduPilot.

Using a Lua script to scan the I2C bus, I was able to detect the device at address 48 (decimal), which corresponds to 0x30 in hex. This matches the expected I2C address for the MMC5983, so it seems the sensor is connected correctly.

However, ArduPilot does not detect the compass during startup. I built a custom firmware with AP_COMPASS_MMC5XX3_ENABLED enabled, but the compass still does not appear in the list of detected compasses, and I don’t see any related messages in the boot logs.

Here is what I’ve confirmed so far:

  • The I2C scan via Lua shows the device at decimal address 48 (hex 0x30)
  • The wiring is correct
  • The custom firmware build includes AP_COMPASS_MMC5XX3_ENABLED = 1
  • COMPASS_ENABLE = 1

Is there anything else I should configure to allow ArduPilot to detect the MMC5983? Or is the driver not yet fully supported on the Pixhawk 6X?

Thanks in advance for your help!

Hi,

Were you able to fix the issue? I also have the same issue with my external MMC5983 compass being detected with CubeOrange.

Were you ever able to fix this problem?
I am running into the same problem with a Mateksys H743 mini v3 board to which I connected the MMC5983. I specifically selected this device as it appears to be supported by the firmware, however, it appears to be completely ignoring the device.
I have been able to validate with an oscilloscope with decode mode that the FC is going over a large number of I2C addresses after boot in order to find devices. It does cover address 0x30 as well, which is the only one that is responding with an ACK.
However, subsequently the FC appears to be sending 0x0D and 0xFF. Which is strange as the datasheet of the MMC5983 does not specify the existence of a register address at 0x0D.
It finally does a write action and it writes 0x05.
Finally it reads a single byte (0x00) from the device. After that it never appears to attempt any further communication.

If anybody has more information this would be greatly appreciated!

I think these issues are likely related to this open PR:

https://github.com/ArduPilot/ardupilot/pull/29722

I’ll see what I can do to get it a little more attention.

Great! Thanks for your quick reply! Is there anything you’d need from me to assist in sorting out the issue?
Possibly additional measurements of the I2C interaction between the flightcontroller and sensor? Or things you’d like me to try/test?
Or figure out the initialisation procedure for the MMC5983MA?

No. The code is written. It just needs final polish and approval.

Awesome, thanks guys!
I would also like to let you know that I took the changes from the commit and added them into my local 4.6.2 version with some minor alterations, built it and flashed into my FC and can report that the sensor is now recognized! It shows however as a MMC5883 in Missionplanner instead of the MMC5983, but I don’t think that will pose any serious issues.
Thanks guys! I’m really over the moon with this!

Is there any update currently?
I am also putting this sensor with my pixhawk1 (2mb) . Will it work without having to build from source?

I see it is merged so it will work on copter 4.6.3 default?