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

Speedybee f405wing with bidirectional dshot #28070

Closed
Closed
Binary file added Tools/bootloaders/SpeedyBeeF405WING-bd_bl.bin
Binary file not shown.
23 changes: 23 additions & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/SpeedyBeeF405WING-bd/defaults.parm
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# WS2812 LED
NTF_LED_LEN,4
SERVO12_FUNCTION,120

#Serial Port defaults
SERIAL1_PROTOCOL 23
SERIAL4_PROTOCOL -1
SERIAL6_PROTOCOL 2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# WS2812 LED
NTF_LED_LEN,4
SERVO12_FUNCTION,120
#Serial Port defaults
SERIAL1_PROTOCOL 23
SERIAL4_PROTOCOL -1
SERIAL6_PROTOCOL 2
@include ../SpeedyBeeF405WING/defaults.parm


#dshot-bidir
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you should be setting any of these. This could be used on a quadplane, etc, etc. Best to let the user configure them.

SERVO_BLH_AUTO 1
SERVO_BLH_MASK 1
SERVO_BLH_OTYPE 6
SERVO_DSHOT_ESC 4
SERVO_AUTO_TRIM 1
SERVO_BLH_BDMASK 1
OSD1_ESC_IDX 1
OSD1_ESCRPM_EN 1
OSD1_ESCRPM_X 3
OSD1_ESCRPM_Y 13
OSD1_ESCTEMP_EN 1
OSD1_ESCTEMP_X 3
OSD1_ESCTEMP_Y 12
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# hw definition file for processing by chibios_pins.py
# for SpeedyBeeF405WING bootloader

include ../SpeedyBeeF405WING/hwdef-bl.dat
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this file and the compiled bootloader (you've done well in this PR if you were creating an entirely new board, BTW - but you're not :-)

10 changes: 10 additions & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/SpeedyBeeF405WING-bd/hwdef.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Bi-directional dshot version of SpeedyBeeF405WING

include ../SpeedyBeeF405WING/hwdef.dat
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
include ../SpeedyBeeF405WING/hwdef.dat
include ../SpeedyBeeF405WING/hwdef.dat
USE_BOOTLOADER_FROM_BOARD SpeedyBeeF405WING

undef PB6 PB0 PC8 PC9

PB6 TIM4_CH1 TIM4 PWM(2) GPIO(51) BIDIR
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you check the DMA allocation here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell you don't lose anything with this config so why not just support it in the main firmware?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

absolutely...should be a change to the existing hwdef instead of new target

Copy link
Author

@setupfpv setupfpv Sep 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because i send to speedebee a version of the firmware for them, and also a modified source code for their target. and they answered month ago "..We have scheduled the testing of this target for next week. Following the successful completion of these tests, we intend to submit the target to the ArduPilot developers for approval.." and as a result, a month passed, no movement. Every time I download the source code of a stable new version, compile the firmware, and post it in my group (and as I understand, people using it), I got tired of it, it’s easier to have the ability to update via MP right away.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you check the DMA allocation here?

as an example I took an almost complete copy of matek405wing-bdshot
and there was:

# Bi-directional dshot version of MatekF405

include ../MatekF405-Wing/hwdef.dat

undef PB7 PB6 PB0 PB1 PC8 PC9

PB7  TIM4_CH2  TIM4 PWM(1) GPIO(50)
PB6  TIM4_CH1  TIM4 PWM(2) GPIO(51) BIDIR
PB0  TIM3_CH3  TIM3 PWM(3) GPIO(52) BIDIR
PB1  TIM3_CH4  TIM3 PWM(4) GPIO(53)

# Can only do bdshot on M1-4, so give up DMA channel on M5/M6 to get full DMA on USART3
PC8  TIM8_CH3  TIM8 PWM(5) GPIO(54) NODMA
PC9  TIM8_CH4  TIM8 PWM(6) GPIO(55) NODMA

DMA_NOSHARE TIM3_UP

PB0 TIM3_CH3 TIM3 PWM(3) GPIO(52) BIDIR
PC8 TIM8_CH3 TIM8 PWM(5) GPIO(54) NODMA
PC9 TIM8_CH4 TIM8 PWM(6) GPIO(55) NODMA
DMA_NOSHARE TIM3_UP
Loading