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

AP_HAL_ChibiOS: add hwdef for LongBowF405WING #27009

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

Conversation

HiRCBro
Copy link

@HiRCBro HiRCBro commented May 7, 2024

hi
lefeirc PR new board with F405

Copy link
Contributor

@magicrub magicrub left a comment

Choose a reason for hiding this comment

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

Looks pretty good, thanks! This needs a bootloader. You can compile it by running:
./Tools/scripts/build_bootloaders.py LongBowF405WING

define AP_BATTMON_SMBUS_ENABLE 0

include ../include/minimize_fpv_osd.inc
include ../include/save_some_flash.inc
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be removed. It's not compiling

MCU STM32F4xx STM32F405xx

# board ID for firmware load
APJ_BOARD_ID 1422
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to be added to Tools/AP_Bootloader/board_types.txt

@magicrub
Copy link
Contributor

magicrub commented May 7, 2024

The commits should also be squashed

@tridge
Copy link
Contributor

tridge commented May 7, 2024

@HiRCBro I've fixed up the commits in your PR

@Hwurzburg Hwurzburg added the WikiNeeded needs wiki update label May 7, 2024
@Hwurzburg Hwurzburg self-requested a review May 7, 2024 22:27
@Hwurzburg
Copy link
Collaborator

In order to review I will need pinout/board image.....also, any UART intended for RC operation needs DMA so UART2 in alt configuration will not support CRSF/ELRS and perhaps even SRXL2 ptotocols....so those need to be on another UART...but no others have full DMA either...so RC protocols using bidir serial will have an issue with current definition I beleive

@Hwurzburg
Copy link
Collaborator

Hwurzburg commented May 7, 2024

the pinnout of each back side jst-gh connector is missing, labeled solder pads are clear, but what signals are in each JST-GH are not indicated on the back....

@HiRCBro
Copy link
Author

HiRCBro commented May 8, 2024

In order to review I will need pinout/board image.....also, any UART intended for RC operation needs DMA so UART2 in alt configuration will not support CRSF/ELRS and perhaps even SRXL2 ptotocols....so those need to be on another UART...but no others have full DMA either...so RC protocols using bidir serial will have an issue with current definition I beleive

SBUS connect to UART2 with an inverter, if you use SBUS then UART2 cant work. if you use CRSF you cant connect to SBUS you need connect to UART2 or other UART

@Hwurzburg
Copy link
Collaborator

UART2 and all other UARTs do not have full DMA required for CRSF/ELRS for sure...so you cant make those RC systems work reliably with this hwdef

@HiRCBro
Copy link
Author

HiRCBro commented May 8, 2024

UART2 and all other UARTs do not have full DMA required for CRSF/ELRS for sure...so you cant make those RC systems work reliably with this hwdef


So i need change
PA2 USART2_TX USART2 NODMA
PA3 USART2_RX USART2 NODMA ALT(1)
to:
PA2 USART2_TX USART2
PA3 USART2_RX USART2ALT(1)

@Hwurzburg
Copy link
Collaborator

unfortunately dma does not get assigned to alternate function pins....so that wont do it....I dont know of a way to do it on a uart whose primary pin function is RCINT for RC .....best to get one of the other UARTs DMA enabled....UART6 unfortunately was not assigned a DMA channel in the resolver....maybe @tridge can make a suggestion, or you cna play with NODMA on some UARTS and see what the resolver produces for the others....you have to look at the hwdef.h file in the build directory after to waf configure for you board

@HiRCBro
Copy link
Author

HiRCBro commented May 8, 2024

se primary pin function is RCINT

i am confused, i test uart2 with CRSF is OK, do you mean, CRSF must work with a full DMA uart, i check hwdef.h only uart1 is full DMA with RX and TX.

@HiRCBro
Copy link
Author

HiRCBro commented May 8, 2024

se primary pin function is RCINT

i am confused, i test uart2 with CRSF is OK, do you mean, CRSF must work with a full DMA uart, i check hwdef.h only uart1 is full DMA with RX and TX.

if uart2 not suitbale for CRSF, we can use UART1, it is full DMA with RX and TX

@Hwurzburg
Copy link
Collaborator

yes UART1 is the only one that can support CRSF/ELRS...so SBUS->RX2 s RCINT and all single wire RC, and UART1 can handle the two wire protocols

SERIAL4_PROTOCOL -1
SERIAL1_PROTOCOL 23
SERIAL2_PROTOCOL -1
SERIAL6_PROTOCOL 2
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_PROTOCOL 2
SERIAL5_PROTOCOL 42
SERIAL6_PROTOCOL 2
#Enable second OSD Type as DisplayPort
OSD_TYPE2 5

- SERIAL2 -> USART2 (RX tied to inverted SBUS RC input, but can be used as normal UART if :ref:`BRD_ALT_CONFIG<>` =1)
- SERIAL3 -> UART3 (GPS) (TX DMA capable)
- SERIAL4 -> UART4 (User) (TX DMA capable)
- SERIAL5 -> UART5 (User, available on DJI air unit connector) (TX DMA capable)
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
- SERIAL5 -> UART5 (User, available on DJI air unit connector) (TX DMA capable)
- SERIAL5 -> UART5 (DisplayPort, available on DJI air unit connector) (TX DMA capable)


## OSD Support

The LongBowF405WING supports using its internal OSD using OSD_TYPE 1 (MAX7456 driver). External OSD support such as DJI or DisplayPort is supported using UART5 or any other free UART5. See :ref:`common-msp-osd-overview-4.2` for more info.
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 LongBowF405WING supports using its internal OSD using OSD_TYPE 1 (MAX7456 driver). External OSD support such as DJI or DisplayPort is supported using UART5 or any other free UART5. See :ref:`common-msp-osd-overview-4.2` for more info.
The LongBowF405WING supports using its internal OSD using OSD_TYPE 1 (MAX7456 driver). External OSD support such DisplayPor is setup by default using UART5. Simultaneous use of the internal OSD and Displayport is allowed. See :ref:`common-msp-osd-overview-4.2` for more info.

- BATT_MONITOR 4
- BATT_VOLT_PIN 10
- BATT_CURR_PIN 11
- BATT_VOLT_MULT 11.5
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
- BATT_VOLT_MULT 11.5
- BATT_VOLT_MULT 11.0

per hwdef


## VTX power control

GPIO 81 controls the VTX BEC output to pins marked "9V". Setting this GPIO high removes voltage supply to pins.
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
GPIO 81 controls the VTX BEC output to pins marked "9V". Setting this GPIO high removes voltage supply to pins.
GPIO 81 controls the VTX BEC output to pins marked "9V" and "Vs1". Setting a RELAY function to this pin and turning it "ON" will remove the supply from these pins.

## VTX power control

GPIO 81 controls the VTX BEC output to pins marked "9V". Setting this GPIO high removes voltage supply to pins.

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
# Camera Switch
GPIO 82 controls which camera input (CC1 or C2 is applied to the internal OSD. A RELAY function can be enabled to control the switching.
# Buzzer
An active buzzer output is provided and is controlled as GPIO 80

# LongBowF405WING Flight Controller

The LongBowF405WING is a flight controller produced by [lefei rc](http://www.lefeirc.com/).

Copy link
Collaborator

Choose a reason for hiding this comment

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

insert link to images here
also need an image of the PDB since it has external connections (probably ESCpwer out and VBAT in)

define HAL_BATT_VOLT_SCALE 11.0 # matched to PDB board
define HAL_BATT_CURR_SCALE 50 # matched to PDB board

# analog rssi pin
Copy link
Collaborator

Choose a reason for hiding this comment

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

I cannt find that pinned out anywhere

Copy link
Author

Choose a reason for hiding this comment

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

I cannt find that pinned out anywhere
This hardware has not been introduced, it is only reserved.

Copy link
Collaborator

Choose a reason for hiding this comment

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

so this is just a strawman at this point....please let me/us know if and when its real hardware and we will review it then

Copy link
Author

@HiRCBro HiRCBro May 10, 2024

Choose a reason for hiding this comment

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

so this is just a strawman at this point....please let me/us know if and when its real hardware and we will review it then

HI, The current hardware does not have an interface, if it is not suitable, you can delete it first。
1,analog rssi pin
2. analog airspeed pin

@Hwurzburg
Copy link
Collaborator

se primary pin function is RCINT

i am confused, i test uart2 with CRSF is OK, do you mean, CRSF must work with a full DMA uart, i check hwdef.h only uart1 is full DMA with RX and TX.

its a matter of RELIABILITY.....CRSF and to a lesser extent ELRS will work without DMA, but not reliably...

@HiRCBro
Copy link
Author

HiRCBro commented May 10, 2024

se primary pin function is RCINT

i am confused, i test uart2 with CRSF is OK, do you mean, CRSF must work with a full DMA uart, i check hwdef.h only uart1 is full DMA with RX and TX.

its a matter of RELIABILITY.....CRSF and to a lesser extent ELRS will work without DMA, but not reliably...

Understood, DMA can reduce CPU load and improve data processing capabilities

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.

None yet

4 participants