I have a drone which flys well, in loiter, stab and auto. PID are perfect, very stable. But, almost every boot my I get compass not calibrated, so I have to move the drone a little and reboot, sometimes I have to do this 5 times in a row to finally be able to arm and fly.
I’m using dual Here2 as compasses (can mode), I’ve disabled internal compass by using a bitmask, so I only have both external as reconized compass, I have 2 more drones with the exactly same config and hardware and they dont have this issue.
I tried to recalibrate my compass a lot of times, but, even with compass calibrated when I reboot, I have a prearm: compass not calibrated, so I move the drone a little and reboot until the error gone.
Check HW ID of both compasses after boot. I faced the same issue. It said Compass not calibrated when Compass 2 was getting detected as compass 3 and vice versa. Happens once or twice in 10 boots.
I think the fix is in 4.0.4-rc4, check “Compass startup reordering based on compass priorities fix” as given in release notes. Update to 4.0.4 Stable and check.
Also, try changing the boot delay as @xfacta has suggested.