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

hwdef: add Lumenier LUX F765 - NDAA #29377

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

djmorvay
Copy link
Contributor

Hello All!

The following is a submission for our new Lumenier flight controller - LUX F765 - NDAA!

The LUX F765 - NDAA flight controller has the following features:

  • Processor: MCU STM32F765, 216MHz, 512KB RAM, 2MB Flash
  • ICM42688 IMU
  • BMP280 Barometer
  • microSD Card Slot
  • 12 PWM Outputs
  • I2C Ports for External Sensors
  • CANbus Support
  • 8 UART Ports
  • Buzzer Control
  • LED Strip Control
  • Analog Current Sensor Input
  • Analog Battery Sensor Input
  • USB Type-C (2.0)
  • Blackbox Storage - SD Card and Flash (128Mbit/16Mbyte)
  • Camera Control Output
  • AT7456E OSD
  • 10V Regulator for VTX Power
  • 5V Regulator for Accessories
  • NDAA compliant
  • Power Supply: 3S to 6S Battery Voltage

Please see the board's README for additional details!

Added in this pull request are the flight controller's hwdef and bootloader files. Please let me know if there are any questions, concerns, or issues!

LUXF765_NDAA_Slim_Graphic

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

PR Overview

This PR adds the hardware definition and bootloader documentation for the new Lumenier LUX F765 - NDAA flight controller.

  • Added a comprehensive README with features, pinouts, and port mappings.
  • Included detailed tables for SPI, UART, connector, and PWM mappings that document the board's capabilities.

Reviewed Changes

File Description
libraries/AP_HAL_ChibiOS/hwdef/LumenierLUXF765-NDAA/README.md Added README documenting board features, pinouts, signal mappings, and firmware loading instructions

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.


## PWM Output

The Lumenier LUX F7865 NDAA supports 12 PWM outputs.
Copy link
Preview

Copilot AI Feb 27, 2025

Choose a reason for hiding this comment

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

Inconsistent model number: 'LUX F7865' appears on line 338, but the PR title and other references use 'LUX F765'. Please correct this to maintain consistency.

Suggested change
The Lumenier LUX F7865 NDAA supports 12 PWM outputs.
The Lumenier LUX F765 NDAA supports 12 PWM outputs.

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
Comment on lines 340 to 341
The 4 auxilliary outputs are labeled S1 through S4.

Copy link
Preview

Copilot AI Feb 27, 2025

Choose a reason for hiding this comment

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

Typo detected: 'auxilliary' should be corrected to 'auxiliary'.

Suggested change
The 4 auxilliary outputs are labeled S1 through S4.
The 4 auxiliary outputs are labeled S1 through S4.

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
</tr>
<tr>
<td>3</td>
<td>AT756E</td>
Copy link
Preview

Copilot AI Feb 27, 2025

Choose a reason for hiding this comment

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

SPI mapping inconsistency: 'AT756E' on line 69 does not match 'AT7456E OSD' mentioned in the features; please verify and correct the part number.

Suggested change
<td>AT756E</td>
<td>AT7456E</td>

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
@andyp1per
Copy link
Collaborator

Here are my suggested changes:

diff --git a/libraries/AP_HAL_ChibiOS/hwdef/LumenierLUXF765-NDAA/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/LumenierLUXF765-NDAA/hwdef.dat
index cf2098f43c..24f40402d3 100755
--- a/libraries/AP_HAL_ChibiOS/hwdef/LumenierLUXF765-NDAA/hwdef.dat
+++ b/libraries/AP_HAL_ChibiOS/hwdef/LumenierLUXF765-NDAA/hwdef.dat
@@ -69,42 +69,46 @@ I2C_ORDER I2C3

 # UARTs

-# USART1 for telem1
+# USART1 for telem1 (RX)
 PA10 USART1_RX USART1
 PA9  USART1_TX USART1
+define DEFAULT_SERIAL1_PROTOCOL SerialProtocol_RCIN

 # USART2 for ESC telemetry
-PD6 USART2_RX USART2
-PD5 USART2_TX USART2
+PD6 USART2_RX USART2 NODMA
+PD5 USART2_TX USART2 NODMA
+define DEFAULT_SERIAL5_PROTOCOL SerialProtocol_ESCTelemetry

 # USART3 for GPS1
 PD9 USART3_RX USART3
 PD8 USART3_TX USART3
+define DEFAULT_SERIAL3_PROTOCOL SerialProtocol_GPS

 # UART4 spare uart
-PD0 UART4_RX UART4
-PD1 UART4_TX UART4
+PD0 UART4_RX UART4 NODMA
+PD1 UART4_TX UART4 NODMA

 # UART5 for telem2
 PD2 UART5_RX UART5
 PB6 UART5_TX UART5

 # USART6 spare uart
-PC7 USART6_RX USART6
-PC6 USART6_TX USART6
+PC7 USART6_RX USART6 NODMA
+PC6 USART6_TX USART6 NODMA

 # UART7 spare uart
-PE7 UART7_RX UART7
-PE8 UART7_TX UART7
+PE7 UART7_RX UART7 NODMA
+PE8 UART7_TX UART7 NODMA

 # UART8 GPS2
-PE0 UART8_RX UART8
-PE1 UART8_TX UART8
+PE0 UART8_RX UART8 NODMA
+PE1 UART8_TX UART8 NODMA
+define DEFAULT_SERIAL4_PROTOCOL SerialProtocol_GPS

 # PWM AUX channels
-PA0 TIM2_CH1 TIM2 PWM(1) GPIO(50)
+PA0 TIM2_CH1 TIM2 PWM(1) GPIO(50) BIDIR
 PA1 TIM2_CH2 TIM2 PWM(2) GPIO(51)
-PA2 TIM2_CH3 TIM2 PWM(3) GPIO(52)
+PA2 TIM2_CH3 TIM2 PWM(3) GPIO(52) BIDIR
 PA3 TIM2_CH4 TIM2 PWM(4) GPIO(53)
 PD12 TIM4_CH1 TIM4 PWM(5) GPIO(54)
 PD13 TIM4_CH2 TIM4 PWM(6) GPIO(55)
@@ -151,7 +155,7 @@ PB8 CAN1_RX CAN1
 PB9 CAN1_TX CAN1

 # SPI devices
-SPIDEV icm42688 SPI1 DEVID1 ICM42688_CS  MODE3  2*MHZ  8*MHZ
+SPIDEV icm42688 SPI1 DEVID1 ICM42688_CS  MODE3  2*MHZ  16*MHZ
 SPIDEV dataflash SPI2 DEVID1 FLASH_CS  MODE3 32*MHZ 32*MHZ
 SPIDEV osd       SPI3 DEVID1 AT7456E_CS MODE0 10*MHZ 10*MHZ
 SPIDEV sdcard    SPI4 DEVID2 SDCARD_CS MODE0 400*KHZ 25*MHZ

@Hwurzburg Hwurzburg added the WikiNeeded needs wiki update label Feb 27, 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.

See comment

@djmorvay djmorvay force-pushed the LUMENIER_LUX_F765_NDAA branch 2 times, most recently from 10f9b06 to eda7132 Compare February 28, 2025 21:36
@djmorvay djmorvay closed this Feb 28, 2025
@djmorvay djmorvay reopened this Feb 28, 2025
@djmorvay
Copy link
Contributor Author

@andyp1per - Could you please elaborate on the BIDIR tags? Can we do BIDIR with a TIMx_UP peripheral or is it channel based? I guess we could be limited on DMA too...

@djmorvay djmorvay requested a review from andyp1per February 28, 2025 22:05
@andyp1per
Copy link
Collaborator

@andyp1per - Could you please elaborate on the BIDIR tags? Can we do BIDIR with a TIMx_UP peripheral or is it channel based? I guess we could be limited on DMA too...

It gives you bi-directional dshot on two channels - 1-2 or 3-4, doesn't matter which of each its attached to except that the DMA is allocated to that channel and on F7 the options are quite limited. If you look at the generated hwdef.h you can see the channels that were selected. UP is used for outbound, so applies to the whole timer. Ideally you would share the same channel between UP and CH but that is only an option for some channels.

@djmorvay
Copy link
Contributor Author

djmorvay commented Mar 1, 2025

@andyp1per - Could you please elaborate on the BIDIR tags? Can we do BIDIR with a TIMx_UP peripheral or is it channel based? I guess we could be limited on DMA too...

It gives you bi-directional dshot on two channels - 1-2 or 3-4, doesn't matter which of each its attached to except that the DMA is allocated to that channel and on F7 the options are quite limited. If you look at the generated hwdef.h you can see the channels that were selected. UP is used for outbound, so applies to the whole timer. Ideally you would share the same channel between UP and CH but that is only an option for some channels.

So, the Ardupilot implementation shares the TIMx_CHy DMA stream with two TIMx channels? I would assume the two channels per stream is the limit because there is some sort of multiplexing going on between the channels and DMA stream? I am also not quite following your last sentence.

@andyp1per
Copy link
Collaborator

So, the Ardupilot implementation shares the TIMx_CHy DMA stream with two TIMx channels? I would assume the two channels per stream is the limit because there is some sort of multiplexing going on between the channels and DMA stream?

Its an STM limitation on input capture. If you look at the reference manual for the chip you will see this. We rotate input capture between the two channels but share the DMA channel

I am also not quite following your last sentence.

On H7 because of DMAMUX we can allocate whichever we channels we like and the AP implementation is optimized to use the same DMA channel for outbound (UP) as inbound (CH) saving DMA resources. On F4 and F7 the DMA options are fixed, only certain channels can be assigned to certain peripherals but there are combinations where this still works.

@djmorvay
Copy link
Contributor Author

djmorvay commented Mar 1, 2025

So, the Ardupilot implementation shares the TIMx_CHy DMA stream with two TIMx channels? I would assume the two channels per stream is the limit because there is some sort of multiplexing going on between the channels and DMA stream?

Its an STM limitation on input capture. If you look at the reference manual for the chip you will see this. We rotate input capture between the two channels but share the DMA channel

I am also not quite following your last sentence.

On H7 because of DMAMUX we can allocate whichever we channels we like and the AP implementation is optimized to use the same DMA channel for outbound (UP) as inbound (CH) saving DMA resources. On F4 and F7 the DMA options are fixed, only certain channels can be assigned to certain peripherals but there are combinations where this still works.

Thank you for the explanation, really appreciate it! After examining the reference manual a bit closer, I better understand the implementation.

Anyway, I made those updates based on your comments. Thanks!

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 the changes below...remove comment in Top board image beside first ESC connector entirely.....its wrong

## UART Mapping

- SERIAL0 -> USB
- SERIAL1 -> USART1 (Telem1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- SERIAL1 -> USART1 (Telem1)
- SERIAL1 -> USART1 (RCinput, DMA enabled)

- SERIAL0 -> USB
- SERIAL1 -> USART1 (Telem1)
- SERIAL2 -> UART5 (Telem2)
- SERIAL3 -> USART3 (GPS1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- SERIAL3 -> USART3 (GPS1)
- SERIAL3 -> USART3 (GPS1, TX DMA enabled)


- SERIAL0 -> USB
- SERIAL1 -> USART1 (Telem1)
- SERIAL2 -> UART5 (Telem2)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- SERIAL2 -> UART5 (Telem2)
- SERIAL2 -> UART5 (Telem2, DMA enabled)

- SERIAL3 -> USART3 (GPS1)
- SERIAL4 -> UART8 (GPS2)
- SERIAL5 -> USART2 (ESC Telemetry)
- SERIAL6 -> UART4 (Spare)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- SERIAL6 -> UART4 (Spare)
- SERIAL6 -> UART4 (DisplayPort)

- PWM 1 through 4 (M1 - M4) are in TIM2
- PWM 5 through 8 (M5 - M8) are in TIM4

The 4 auxiliary PWM outputs are in 1 group:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
The 4 auxiliary PWM outputs are in 1 group:

The board can be easily transitioned from Betaflight to Ardupilot in a matter of minutes.
Please see the [product page](https://www.getfpv.com/lumenier-lux-f765-flight-controller-ndaa.html)
for firmware binaries and instructions on how to transition from Betaflight to Ardupilot.

Copy link
Collaborator

Choose a reason for hiding this comment

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

-needs section on where to find firmware
-needs sections for RC Input,Compass, OSD, Battery Monitor, and Camera Switch

See Wiki: https://ardupilot.org/dev/docs/readme_file.html (just merged give it a few hours to appear)

# USART3 for GPS1
PD9 USART3_RX USART3
PD8 USART3_TX USART3
define DEFAULT_SERIAL3_PROTOCOL SerialProtocol_GPS
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove, not needed, already default

# UART8 GPS2
PE0 UART8_RX UART8 NODMA
PE1 UART8_TX UART8 NODMA
define DEFAULT_SERIAL4_PROTOCOL SerialProtocol_GPS
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove, not needed, already default

# UART4 spare uart
PD0 UART4_RX UART4 NODMA
PD1 UART4_TX UART4 NODMA

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
define DEFAULT_SERIAL3_PROTOCOL SerialProtocol_MSP_DisplayPort


# setup for OSD
define OSD_ENABLED 1
define HAL_OSD_TYPE_DEFAULT 1
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
define HAL_OSD_TYPE_DEFAULT 1
define HAL_OSD_TYPE_DEFAULT 5

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.

4 participants