Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KakuteF4: Add BRD_ALT_CONFIG for serial RC_INPUT #26975

Closed
wants to merge 11 commits into from
Closed

KakuteF4: Add BRD_ALT_CONFIG for serial RC_INPUT #26975

wants to merge 11 commits into from

Conversation

menschel
Copy link
Contributor

@menschel menschel commented May 4, 2024

DO NOT MERGE

Hello,

I'd like to propose adding alternative board configuration for Holybro Kakute F4 to make the rc input pins available for bi-directional protocols like CRSF.

It does work on these pins in Betaflight. Reference commit in BetaFlight that upgraded the Kakute F4 board.
betaflight/betaflight#4427

It also is what Holybro suggests as wiring.

I used #13157 as a template.

From my experimentation, it does not work out but I ran out of ideas what the issue is.

menschel added 3 commits May 4, 2024 15:23
On Kakute F4 V2.4 there are pads R3, T3 intended for
rc input of ELRS, CRSF etc.

This is not possible with default configuration.
Therefore add it as alternative board config.

Signed-off-by: Patrick Menschel <[email protected]>
by try and error method.

Signed-off-by: Patrick Menschel <[email protected]>
Signed-off-by: Patrick Menschel <[email protected]>
@menschel
Copy link
Contributor Author

menschel commented May 4, 2024

I have to admit, it does not work yet and I have contacted the manufacturer to ask if there are any specialties with USART3. At least it does seem to work out on betaflight.

@menschel
Copy link
Contributor Author

menschel commented May 5, 2024

Not working yet, I was trying to verify correct connections by flashing back to BetaFlight and found out that DFU flashing is broken in Ardupilot.

@menschel
Copy link
Contributor Author

menschel commented May 6, 2024

I have verified, that exactly the same connections to R3, T3, 5V, GND works for Betaflight.

And I found a caveat in Kakute F4 V2.4, that basically Boot Button does NOT establish DFU mode when the ELRS receiver is connected this way.

@menschel
Copy link
Contributor Author

menschel commented May 7, 2024

I will revert and create new board file based on
https://github.com/betaflight/unified-targets/blob/master/configs/default/HBRO-KAKUTEF4V2.config

@Hwurzburg Hwurzburg added the WikiNeeded needs wiki update label May 7, 2024
@menschel
Copy link
Contributor Author

I have a working setup on UART3 with CRSF. I had to change the POL property to 0 for the inverter.

There is something fishy about the RC update rates and the not available telemetry from ArduCopter.

I'll try the NODMA option next.

@menschel
Copy link
Contributor Author

From what I learned by try&error. The Serial Options on Serial5 / Uart3 are not taken into account.

The only thing that changes something is changing the POL() property in hwdef file.

After that I get RC Input from the ELRS Receiver but the rates seem to be messed up and this ping failedshows that the TX part does not work as expected.

Obviously the only telemetry I get is from the ELRS Receiver, nothing from ardupilot.

I'll try flashing back to Betaflight and see if telemetry works.

This is my current log.

13.05.2024 18:54:01 : PreArm: Compass not calibrated
13.05.2024 18:54:01 : PreArm: 3D Accel calibration needed
13.05.2024 18:53:30 : PreArm: Compass not calibrated
13.05.2024 18:53:30 : PreArm: 3D Accel calibration needed
13.05.2024 18:53:30 : CRSFv2: custom telem init done, fw 0.00
13.05.2024 18:53:30 : CRSFv2: RX device ping failed
13.05.2024 18:53:27 : u-blox 1 HW: 000A0000 SW: ROM SPG 5.10 (7b202e)
13.05.2024 18:53:25 : CRSFv2: requesting RX device info
13.05.2024 18:53:20 : CRSFv2: requesting RX device info
13.05.2024 18:53:15 : CRSFv2: requesting RX device info
13.05.2024 18:53:13 : GPS 1: detected u-blox
13.05.2024 18:53:13 : GPS 1: probing for u-blox at 230400 baud
13.05.2024 18:53:10 : CRSFv2: requesting RX device info
13.05.2024 18:53:10 : CRSFv2: Link rate 4Hz, Telemetry rate 61Hz
13.05.2024 18:53:09 : EKF3 IMU0 MAG0 initial yaw alignment complete
13.05.2024 18:53:09 : EKF3 IMU0 tilt alignment complete
13.05.2024 18:53:07 : AHRS: EKF3 active
13.05.2024 18:53:07 : EKF3 IMU0 initialised
13.05.2024 18:53:06 : Frame: QUAD/BF_X
13.05.2024 18:53:06 : IMU0: fast sampling enabled 8.0kHz/1.0kHz
13.05.2024 18:53:06 : RCOut: OS125:1-4 NeoP:5
13.05.2024 18:53:06 : KakuteF4 002F0023 3032470F 34303838
13.05.2024 18:53:06 : ChibiOS: 8fc176ac
13.05.2024 18:53:06 : ArduCopter V4.6.0-dev (af1ab61)
13.05.2024 18:53:05 : AHRS: DCM active
13.05.2024 18:53:05 : ArduPilot Ready
13.05.2024 18:53:05 : Frame: QUAD/BF_X
13.05.2024 18:53:05 : IMU0: fast sampling enabled 8.0kHz/1.0kHz
13.05.2024 18:53:05 : RCOut: Initialising
13.05.2024 18:53:05 : KakuteF4 002F0023 3032470F 34303838
13.05.2024 18:53:05 : ChibiOS: 8fc176ac
13.05.2024 18:53:05 : ArduCopter V4.6.0-dev (af1ab61)
13.05.2024 18:53:05 : CRSFv2: requesting RX device info
13.05.2024 18:53:05 : Frame: QUAD/BF_X
13.05.2024 18:53:05 : IMU0: fast sampling enabled 8.0kHz/1.0kHz
13.05.2024 18:53:05 : RCOut: Initialising
13.05.2024 18:53:05 : KakuteF4 002F0023 3032470F 34303838
13.05.2024 18:53:05 : ChibiOS: 8fc176ac
13.05.2024 18:53:05 : ArduCopter V4.6.0-dev (af1ab61)
13.05.2024 18:53:05 : CRSFv2: RSSI now displays normally
13.05.2024 18:53:05 : CRSFv2: Link rate 4Hz, Telemetry rate 1Hz
13.05.2024 18:53:05 : Initialising ArduPilot
13.05.2024 18:53:04 : Barometer 1 calibration complete
13.05.2024 18:53:04 : RCInput: decoding CRSF(3)

@menschel
Copy link
Contributor Author

I just found an electrical issue on the tx cable from FC to ELRS receiver, seems to be a short to ground. Will investigate.

@menschel
Copy link
Contributor Author

OK, electrical issue solved.

On the Happymodel ES900RX, the Ground Plane apparently comes out of the board edge where they broke the pcb into separate receivers and soldering cables vertically into the groove seems to have bridged the RX PAD to GND.
https://www.expresslrs.org/quick-start/receivers/hmes900/

I now have working CRSF but the crucial thing was the POL(0) on the inverter. It does find nothing if the inverter is left with POL(1) setting.

Please advise how to handle this.

14.05.2024 16:42:33 : PreArm: Compass not healthy
14.05.2024 16:42:33 : PreArm: 3D Accel calibration needed
14.05.2024 16:42:13 : ELRS: Link rate 100Hz, Telemetry rate 47Hz
14.05.2024 16:42:12 : EKF3 IMU0 tilt alignment complete
14.05.2024 16:42:10 : AHRS: EKF3 active
14.05.2024 16:42:10 : EKF3 IMU0 initialised
14.05.2024 16:42:08 : AHRS: DCM active
14.05.2024 16:42:08 : ArduPilot Ready
14.05.2024 16:42:08 : ELRS: RSSI now displays normally
14.05.2024 16:42:08 : Initialising ArduPilot
14.05.2024 16:42:08 : Frame: QUAD/BF_X
14.05.2024 16:42:08 : RCOut: Initialising
14.05.2024 16:42:08 : KakuteF4 002F0023 3032470F 34303838
14.05.2024 16:42:08 : ChibiOS: 8fc176ac
14.05.2024 16:42:08 : ArduCopter V4.6.0-dev (af1ab61)
14.05.2024 16:42:07 : ELRS: custom telem init done, fw 1.00
14.05.2024 16:42:07 : RCInput: decoding CRSF(3)
14.05.2024 16:42:07 : Barometer 1 calibration complete
14.05.2024 16:42:07 : Frame: QUAD/BF_X
14.05.2024 16:42:07 : RCOut: Initialising
14.05.2024 16:42:07 : KakuteF4 002F0023 3032470F 34303838
14.05.2024 16:42:07 : ChibiOS: 8fc176ac
14.05.2024 16:42:07 : ArduCopter V4.6.0-dev (af1ab61)
14.05.2024 16:42:07 : Frame: QUAD/BF_X
14.05.2024 16:42:07 : RCOut: Initialising
14.05.2024 16:42:07 : KakuteF4 002F0023 3032470F 34303838
14.05.2024 16:42:07 : ChibiOS: 8fc176ac
14.05.2024 16:42:07 : ArduCopter V4.6.0-dev (af1ab61)
14.05.2024 16:42:07 : Frame: QUAD/BF_X
14.05.2024 16:42:07 : RCOut: Initialising
14.05.2024 16:42:07 : KakuteF4 002F0023 3032470F 34303838
14.05.2024 16:42:07 : ChibiOS: 8fc176ac
14.05.2024 16:42:07 : ArduCopter V4.6.0-dev (af1ab61)

@menschel
Copy link
Contributor Author

I have just verified, that BRD_ALT_CONFIG = 0 still works for SBUS with my latest patchset.

I tested with a Turnigy Evolution + TGY-iA6C. I don't know why SBUS does not turn up in the log though.

14.05.2024 17:09:04 : PreArm: Compass not healthy
14.05.2024 17:09:04 : PreArm: 3D Accel calibration needed
14.05.2024 17:08:33 : PreArm: Compass not healthy
14.05.2024 17:08:33 : PreArm: 3D Accel calibration needed
14.05.2024 17:08:02 : PreArm: Compass not healthy
14.05.2024 17:08:02 : PreArm: 3D Accel calibration needed
14.05.2024 17:07:40 : Frame: QUAD/BF_X
14.05.2024 17:07:40 : IMU0: fast sampling enabled 8.0kHz/1.0kHz
14.05.2024 17:07:40 : RCOut: OS125:1-4 NeoP:5
14.05.2024 17:07:40 : KakuteF4 002F0023 3032470F 34303838
14.05.2024 17:07:40 : ChibiOS: 8fc176ac
14.05.2024 17:07:40 : ArduCopter V4.6.0-dev (af1ab61)
14.05.2024 17:07:40 : Frame: QUAD/BF_X
14.05.2024 17:07:40 : IMU0: fast sampling enabled 8.0kHz/1.0kHz
14.05.2024 17:07:40 : RCOut: OS125:1-4 NeoP:5
14.05.2024 17:07:40 : KakuteF4 002F0023 3032470F 34303838
14.05.2024 17:07:40 : ChibiOS: 8fc176ac
14.05.2024 17:07:40 : ArduCopter V4.6.0-dev (af1ab61)
14.05.2024 17:07:40 : Frame: QUAD/BF_X
14.05.2024 17:07:40 : IMU0: fast sampling enabled 8.0kHz/1.0kHz
14.05.2024 17:07:40 : RCOut: OS125:1-4 NeoP:5
14.05.2024 17:07:40 : KakuteF4 002F0023 3032470F 34303838
14.05.2024 17:07:40 : ChibiOS: 8fc176ac
14.05.2024 17:07:40 : ArduCopter V4.6.0-dev (af1ab61)
14.05.2024 17:07:38 : EKF3 IMU0 tilt alignment complete
14.05.2024 17:07:37 : AHRS: EKF3 active
14.05.2024 17:07:37 : EKF3 IMU0 initialised

Anyway, please advise on the next steps.

@menschel
Copy link
Contributor Author

@Holybro Please add your thoughts on this.
Is the inverter for R3 (PB11) via PB15 correct this way?

I mean Ardupilot does not use UART for SBUS in general, so what is the point in having the inverter.

@andyp1per
Copy link
Collaborator

@Holybro Please add your thoughts on this. Is the inverter for R3 (PB11) via PB15 correct this way?

This is literally what the betaflight config does - no need to consult Holybro.

#define INVERTER_PIN_UART3   PB15

I mean Ardupilot does not use UART for SBUS in general, so what is the point in having the inverter.

You are incorrect, ArduPilot can use a UART for SBUS just fine.

@menschel
Copy link
Contributor Author

You are incorrect, ArduPilot can use a UART for SBUS just fine

OK, what are the configuration Parameters necessary? I can test it.

@menschel
Copy link
Contributor Author

I realized this change is a stupid idea since USART2 has no DMA. Sorry for the noise.

@menschel menschel closed this Jul 10, 2024
@menschel menschel deleted the dev_kakutef4v2.4 branch July 10, 2024 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WikiNeeded needs wiki update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants