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

add DroneerF405 hwdef #28846

Merged
merged 3 commits into from
Jan 20, 2025
Merged

add DroneerF405 hwdef #28846

merged 3 commits into from
Jan 20, 2025

Conversation

DroneerUAV
Copy link

@DroneerUAV DroneerUAV commented Dec 12, 2024

Add DroneerF405 board from Droneer UAV

@andyp1per
Copy link
Collaborator

andyp1per commented Dec 12, 2024

I recommend these changes:

diff --git a/libraries/AP_HAL_ChibiOS/hwdef/DroneerF405/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/DroneerF405/hwdef.dat
index 4063f183a1..96d622b26a 100644
--- a/libraries/AP_HAL_ChibiOS/hwdef/DroneerF405/hwdef.dat
+++ b/libraries/AP_HAL_ChibiOS/hwdef/DroneerF405/hwdef.dat
@@ -34,14 +34,14 @@ PA12 OTG_FS_DP OTG1
 PC5 VBUS INPUT OPENDRAIN

 # USART1(VTX)
-PA9  USART1_TX USART1
-PA10 USART1_RX USART1
+PA9  USART1_TX USART1 NODMA
+PA10 USART1_RX USART1 NODMA
 define DEFAULT_SERIAL1_PROTOCOL SerialProtocol_Tramp

 # USART2, RC input
 PA2 USART2_TX USART2
-PA3 USART2_RX USART2 NODMA
-define DEFAULT_SERIAL2_PROTOCOL SerialProtocol_MAVLink2
+PA3 USART2_RX USART2
+define DEFAULT_SERIAL2_PROTOCOL SerialProtocol_RCIN

 # default to timer for RC input
 #PA3 TIM9_CH2 TIM9 RCININT PULLDOWN LOW
@@ -70,10 +70,10 @@ define DEFAULT_SERIAL5_PROTOCOL SerialProtocol_None

 # PWM output. 1 - 8 on ESC header
 # --------------------- PWM -----------------------
-PC6  TIM8_CH1   TIM8  PWM(1)  GPIO(50)
+PC6  TIM8_CH1   TIM8  PWM(1)  GPIO(50) BIDIR
 PC7  TIM8_CH2   TIM8  PWM(2)  GPIO(51)
 PC8  TIM8_CH3   TIM8  PWM(3)  GPIO(52)
-PC9  TIM8_CH4   TIM8  PWM(4)  GPIO(53)
+PC9  TIM8_CH4   TIM8  PWM(4)  GPIO(53) BIDIR
 PA15 TIM2_CH1   TIM2  PWM(5)  GPIO(54)
 PA8  TIM1_CH1   TIM1  PWM(6)  GPIO(55)
 PB10 TIM2_CH3   TIM2  PWM(7)  GPIO(56)
@@ -174,7 +174,7 @@ define HAL_OSD_TYPE_DEFAULT 1
 # Font for the osd
 ROMFS_WILDCARD libraries/AP_OSD/fonts/font*.bin

-DMA_PRIORITY TIM2* TIM3*
+DMA_PRIORITY TIM8* TIM3*

 # minimal drivers to reduce flash usage
 include ../include/minimize_fpv_osd.inc

Copy link
Collaborator

@andyp1per andyp1per left a comment

Choose a reason for hiding this comment

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

Needs a README.md
Suggest the changes I outlined

@DroneerUAV
Copy link
Author

我建议进行以下更改:

diff --git a/libraries/AP_HAL_ChibiOS/hwdef/DroneerF405/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/DroneerF405/hwdef.dat
index 4063f183a1..96d622b26a 100644
--- a/libraries/AP_HAL_ChibiOS/hwdef/DroneerF405/hwdef.dat
+++ b/libraries/AP_HAL_ChibiOS/hwdef/DroneerF405/hwdef.dat
@@ -34,14 +34,14 @@ PA12 OTG_FS_DP OTG1
 PC5 VBUS INPUT OPENDRAIN

 # USART1(VTX)
-PA9  USART1_TX USART1
-PA10 USART1_RX USART1
+PA9  USART1_TX USART1 NODMA
+PA10 USART1_RX USART1 NODMA
 define DEFAULT_SERIAL1_PROTOCOL SerialProtocol_Tramp

 # USART2, RC input
 PA2 USART2_TX USART2
-PA3 USART2_RX USART2 NODMA
-define DEFAULT_SERIAL2_PROTOCOL SerialProtocol_MAVLink2
+PA3 USART2_RX USART2
+define DEFAULT_SERIAL2_PROTOCOL SerialProtocol_RCIN

 # default to timer for RC input
 #PA3 TIM9_CH2 TIM9 RCININT PULLDOWN LOW
@@ -70,10 +70,10 @@ define DEFAULT_SERIAL5_PROTOCOL SerialProtocol_None

 # PWM output. 1 - 8 on ESC header
 # --------------------- PWM -----------------------
-PC6  TIM8_CH1   TIM8  PWM(1)  GPIO(50)
+PC6  TIM8_CH1   TIM8  PWM(1)  GPIO(50) BIDIR
 PC7  TIM8_CH2   TIM8  PWM(2)  GPIO(51)
 PC8  TIM8_CH3   TIM8  PWM(3)  GPIO(52)
-PC9  TIM8_CH4   TIM8  PWM(4)  GPIO(53)
+PC9  TIM8_CH4   TIM8  PWM(4)  GPIO(53) BIDIR
 PA15 TIM2_CH1   TIM2  PWM(5)  GPIO(54)
 PA8  TIM1_CH1   TIM1  PWM(6)  GPIO(55)
 PB10 TIM2_CH3   TIM2  PWM(7)  GPIO(56)
@@ -174,7 +174,7 @@ define HAL_OSD_TYPE_DEFAULT 1
 # Font for the osd
 ROMFS_WILDCARD libraries/AP_OSD/fonts/font*.bin

-DMA_PRIORITY TIM2* TIM3*
+DMA_PRIORITY TIM8* TIM3*

 # minimal drivers to reduce flash usage
 include ../include/minimize_fpv_osd.inc

1734343967586(1)
Does the suggestion here need to be changed? Our hardware serial port 2 must be added with NODMA in order to work normally

@Hwurzburg Hwurzburg self-requested a review December 25, 2024 16:28
@andyp1per
Copy link
Collaborator

我建议进行以下更改:

diff --git a/libraries/AP_HAL_ChibiOS/hwdef/DroneerF405/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/DroneerF405/hwdef.dat
index 4063f183a1..96d622b26a 100644
--- a/libraries/AP_HAL_ChibiOS/hwdef/DroneerF405/hwdef.dat
+++ b/libraries/AP_HAL_ChibiOS/hwdef/DroneerF405/hwdef.dat
@@ -34,14 +34,14 @@ PA12 OTG_FS_DP OTG1
 PC5 VBUS INPUT OPENDRAIN

 # USART1(VTX)
-PA9  USART1_TX USART1
-PA10 USART1_RX USART1
+PA9  USART1_TX USART1 NODMA
+PA10 USART1_RX USART1 NODMA
 define DEFAULT_SERIAL1_PROTOCOL SerialProtocol_Tramp

 # USART2, RC input
 PA2 USART2_TX USART2
-PA3 USART2_RX USART2 NODMA
-define DEFAULT_SERIAL2_PROTOCOL SerialProtocol_MAVLink2
+PA3 USART2_RX USART2
+define DEFAULT_SERIAL2_PROTOCOL SerialProtocol_RCIN

 # default to timer for RC input
 #PA3 TIM9_CH2 TIM9 RCININT PULLDOWN LOW
@@ -70,10 +70,10 @@ define DEFAULT_SERIAL5_PROTOCOL SerialProtocol_None

 # PWM output. 1 - 8 on ESC header
 # --------------------- PWM -----------------------
-PC6  TIM8_CH1   TIM8  PWM(1)  GPIO(50)
+PC6  TIM8_CH1   TIM8  PWM(1)  GPIO(50) BIDIR
 PC7  TIM8_CH2   TIM8  PWM(2)  GPIO(51)
 PC8  TIM8_CH3   TIM8  PWM(3)  GPIO(52)
-PC9  TIM8_CH4   TIM8  PWM(4)  GPIO(53)
+PC9  TIM8_CH4   TIM8  PWM(4)  GPIO(53) BIDIR
 PA15 TIM2_CH1   TIM2  PWM(5)  GPIO(54)
 PA8  TIM1_CH1   TIM1  PWM(6)  GPIO(55)
 PB10 TIM2_CH3   TIM2  PWM(7)  GPIO(56)
@@ -174,7 +174,7 @@ define HAL_OSD_TYPE_DEFAULT 1
 # Font for the osd
 ROMFS_WILDCARD libraries/AP_OSD/fonts/font*.bin

-DMA_PRIORITY TIM2* TIM3*
+DMA_PRIORITY TIM8* TIM3*

 # minimal drivers to reduce flash usage
 include ../include/minimize_fpv_osd.inc

1734343967586(1) Does the suggestion here need to be changed? Our hardware serial port 2 must be added with NODMA in order to work normally

I don't think so. We discussed this on discord, you need to use an actual serial protocol

@DroneerUAV
Copy link
Author

@andyp1per I have addressed the requested changes,Please review the updated PR

Copy link
Collaborator

@andyp1per andyp1per left a comment

Choose a reason for hiding this comment

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

Looking good

Tools/AP_Bootloader/board_types.txt Outdated Show resolved Hide resolved
Copy link
Collaborator

@Hwurzburg Hwurzburg left a comment

Choose a reason for hiding this comment

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

in addition to changes listed, commits will need to be squashed and then split into one for Tools: add DronnerF405(for Tools library files)
and hwdef: add DroneerF405(for hwdef library files)

libraries/AP_HAL_ChibiOS/hwdef/DroneerF405/hwdef-bl.dat Outdated Show resolved Hide resolved
libraries/AP_HAL_ChibiOS/hwdef/DroneerF405/hwdef.dat Outdated Show resolved Hide resolved
libraries/AP_HAL_ChibiOS/hwdef/DroneerF405/README.md Outdated Show resolved Hide resolved
libraries/AP_HAL_ChibiOS/hwdef/DroneerF405/README.md Outdated Show resolved Hide resolved
libraries/AP_HAL_ChibiOS/hwdef/DroneerF405/README.md Outdated Show resolved Hide resolved
libraries/AP_HAL_ChibiOS/hwdef/DroneerF405/README.md Outdated Show resolved Hide resolved
libraries/AP_HAL_ChibiOS/hwdef/DroneerF405/README.md Outdated Show resolved Hide resolved
@DroneerUAV
Copy link
Author

in addition to changes listed, commits will need to be squashed and then split into one for Tools: add DronnerF405(for Tools library files) and hwdef: add DroneerF405(for hwdef library files)

I've made all the required changes, please review

@andyp1per
Copy link
Collaborator

Apologies, the commit messages need to match the module names so:
Tools -> bootloaders
hwdef->AP_HAL_ChibiOS

Copy link
Collaborator

@andyp1per andyp1per left a comment

Choose a reason for hiding this comment

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

Some changes needed

Tools/AP_Bootloader/board_types.txt Show resolved Hide resolved
@DroneerUAV
Copy link
Author

DroneerUAV commented Jan 16, 2025

Apologies, the commit messages need to match the module names so: Tools -> bootloaders hwdef->AP_HAL_ChibiOS

the commit message,like this?
Tools -> bootloaders: add DroneerF405
AP_HAL_ChibiOS->hwdef: add DroneerF405

@andyp1per
Copy link
Collaborator

andyp1per commented Jan 16, 2025

Like this:

bootloaders: add DroneerF405
AP_HAL_ChibiOS: add DroneerF405

and you actually need to split the bootloaders commit into two since the board id is in a separate module:

AP_Bootloader: add DroneerF405

@DroneerUAV
Copy link
Author

Like this:

bootloaders: add DroneerF405
AP_HAL_ChibiOS: add DroneerF405

and you actually need to split the bootloaders commit into two since the board id is in a separate module:

AP_Bootloader: add DroneerF405

ok,got it

@DroneerUAV
Copy link
Author

Like this:

bootloaders: add DroneerF405
AP_HAL_ChibiOS: add DroneerF405

and you actually need to split the bootloaders commit into two since the board id is in a separate module:

AP_Bootloader: add DroneerF405

I've made all the required changes, please review

@Hwurzburg Hwurzburg force-pushed the master branch 2 times, most recently from 1d269d1 to 0b1b959 Compare January 16, 2025 13:19
@Hwurzburg
Copy link
Collaborator

@DroneerUAV I have made a few changes that you had missed and cleaned up the RC section in the readme, rebased, and pushed here....should be good to go now

@DroneerUAV
Copy link
Author

@DroneerUAV I have made a few changes that you had missed and cleaned up the RC section in the readme, rebased, and pushed here....should be good to go now

ok, thank you,Is there anything else I need to do

@Hwurzburg
Copy link
Collaborator

I dont think so.. @andyp1per can you approve?

@Hwurzburg Hwurzburg added the WikiNeeded needs wiki update label Jan 17, 2025
Copy link
Collaborator

@andyp1per andyp1per left a comment

Choose a reason for hiding this comment

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

LGTM, needs a rebase

@DroneerUAV
Copy link
Author

LGTM, needs a rebase

I have rebase to the latest

@peterbarker peterbarker merged commit 1dae851 into ArduPilot:master Jan 20, 2025
50 checks passed
@peterbarker
Copy link
Contributor

Merged this, thanks @DroneerUAV . Please note in future you might want to create a topic branch to create your pull request from; using your master branch for this sort of thing isn't great :-) See https://ardupilot.org/dev/docs/git-branch.html

@DroneerUAV
Copy link
Author

Merged this, thanks @DroneerUAV . Please note in future you might want to create a topic branch to create your pull request from; using your master branch for this sort of thing isn't great :-) See https://ardupilot.org/dev/docs/git-branch.html

ok,got it,thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants