[APPROVED] Speedybee F405 V3 Flight Controller for Porting

Same result! Compass does not finish calibration.

12/4/2022 7:27:36 PM : PreArm: Battery 1 low voltage failsafe
12/4/2022 7:27:36 PM : PreArm: Compass calibration running
12/4/2022 7:27:36 PM : PreArm: RC not found
12/4/2022 7:27:05 PM : PreArm: Battery 1 low voltage failsafe
12/4/2022 7:27:05 PM : PreArm: Compass calibration running
12/4/2022 7:27:05 PM : PreArm: RC not found
12/4/2022 7:26:34 PM : PreArm: Battery 1 low voltage failsafe
12/4/2022 7:26:34 PM : PreArm: Compass calibration running
12/4/2022 7:26:34 PM : PreArm: RC not found
12/4/2022 7:26:03 PM : PreArm: Battery 1 low voltage failsafe
12/4/2022 7:26:03 PM : PreArm: Compass not calibrated
12/4/2022 7:26:03 PM : PreArm: RC not found
12/4/2022 7:26:03 PM : u-blox 1 HW: 00080000 SW: ROM CORE 3.01 (107888)
12/4/2022 7:26:01 PM : GPS 1: u-blox saving config
12/4/2022 7:25:46 PM : GPS 1: detected as u-blox at 230400 baud
12/4/2022 7:25:43 PM : EKF3 IMU0 MAG0 initial yaw alignment complete
12/4/2022 7:25:43 PM : EKF3 IMU0 tilt alignment complete
12/4/2022 7:25:42 PM : AHRS: EKF3 active
12/4/2022 7:25:42 PM : EKF3 IMU0 initialised
12/4/2022 7:25:40 PM : Frame: QUAD/X
12/4/2022 7:25:40 PM : RCOut: PWM:1-8 NeoP:9
12/4/2022 7:25:40 PM : speedybeef4v3 002F0044 32315111 35383730
12/4/2022 7:25:40 PM : ChibiOS: 4810ba51
12/4/2022 7:25:40 PM : ArduCopter V4.4.0-dev (0fd5c3c9)
12/4/2022 7:25:40 PM : Frame: QUAD/X
12/4/2022 7:25:40 PM : RCOut: PWM:1-8 NeoP:9
12/4/2022 7:25:40 PM : speedybeef4v3 002F0044 32315111 35383730
12/4/2022 7:25:40 PM : ChibiOS: 4810ba51
12/4/2022 7:25:40 PM : ArduCopter V4.4.0-dev (0fd5c3c9)
12/4/2022 7:25:40 PM : Frame: QUAD/X
12/4/2022 7:25:40 PM : RCOut: PWM:1-8 NeoP:9
12/4/2022 7:25:40 PM : speedybeef4v3 002F0044 32315111 35383730
12/4/2022 7:25:40 PM : ChibiOS: 4810ba51
12/4/2022 7:25:40 PM : ArduCopter V4.4.0-dev (0fd5c3c9)
12/4/2022 7:25:40 PM : RCOut: PWM:1-8 NeoP:9
12/4/2022 7:25:40 PM : AHRS: DCM active
12/4/2022 7:25:40 PM : ArduPilot Ready
12/4/2022 7:25:39 PM : Barometer 1 calibration complete

Ok so this time you donā€™t get the thread error - just that compass calibration keeps going?

Yes. No thread error. Just calibration runningā€¦ Same thing after disabling logging.

Ok, I saw this once but can no longer reproduce it - works fine with and without logging. Iā€™m pretty sure that this is again down to RAM usage - unfortunately the order in which things are initialized is a little bit random from an allocation perspective and memory can get fragmented in different ways from run to run, so I think what you need to do is get your accels properly calibrated and set FRAME_CLASS 1 and then reboot and run the compass cal. If that doesnā€™t work reboot and try again - Iā€™m pretty sure it will eventually work. Here is the firmware I was using just for reference:

arducopter.zip (603.0 KB)

Thanks a lot for all your help!
I will try this tonight and let you know how it behaves.
By the way, when I ran the first tests, I was using ELRS 3 and it was fine (telemetry, etc.). I had to change the radio and I installed a Frsky R-xsr and Sbus works, but telemetry does not work no matter whatā€¦ I tried Uart3 (TX) and changed all possible settings. Also tried uninverted pin on the receiver, but no luckā€¦
Do you have any hints? Should I open a new topic?
Thanks again for all your efforts!
Rgds,
Andre

SBUS and Fport both require inversion - there is no software inversion on this board so I think you would need to attach to the pads labelled sbus and telem

This receiver uses Sport. SBUS is attached to SUS pad on the board and is working fine. I understand there is no inversion, so I am using the uninverted pad from the receiver and soldered it on T3, which I assume is serial3. I tried changing every parameter possible with no luckā€¦

Sorry, I donā€™t do FrSky - you would need someone else to help you

Thank you!
Will open a new topic.
Rgds,

very often the uninverted internally grabbed (ie DIY) on an RX cannot drive the UART input protection circuitry on some boards since it is not buffered and often is clamped by the next devices it drives on the boardā€¦happens oftenā€¦I have even had issues with RXs that intentionally expose the uninverted on a pad with some autoplilots that have input protection circuits on their UARTS and expect healthy drive coming inā€¦

I see your point. Maybe this board is not made for this. Will have to go back to ELRSā€¦

Here is what I did:
Tried your firmware. Didnā€™t work again.
Loaded latest stable available (I am attaching to this message), disabled logging and compass calibration was normal.
latest-stable.zip (652.1 KB)
.
Loaded your firmware again. Compass went crazy and could not recalibrate it.
Put back latest stable ā†’ compass worked again and there was no need to recalibrate!
This is really crazy!

Can you do LOG_DISARMED = 1 and send me the log of the compass going crazy?

Ok, I found a bug in the driver. Try again with this version:

arducopter.zip (603.1 KB)

Fingers crossed!

Tried your new firmware. Same problem. Even after disabling logging.
I am trying to attach the log here, but I got error msg stating itā€™s too big (only 2mbā€¦).
Please send me your e-mail and I will mail it to you!
Tks

Nah. Post a link to the file on a Cloud service. Thatā€™s the wayā€¦

henke.com.br/nah/logs.zip

Iā€™m not seeing anything wrong in the logs other than very high offsets. What compass is this? Can you send a similar log for the stable firmware version?

Probably the offsets are high because I was moving the craft trying to calibrate the compass.
Itā€™s a BN880 Gps unit.
I donā€™t think I will be able to send you a log for the stable firmware because I have to disable logging in order to get the compass calibrated. Unless you want me to calibrate it, then reenable logging to get you a log after calibration (I donā€™t know if this is going to work).
Please let me know what you prefer.
Tks

One final one before I go to bed. There is a bug on the send side which this fixes - but I am still occasionally seeing baro glitches, so not sure this will sort things.

arducopter.zip (603.1 KB)