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 ZeroOneX6 Flight Controller Bootloader File. #27282

Closed
wants to merge 31 commits into from

Conversation

ZeroOne-Aero
Copy link
Contributor

  1. ZeroOneX6 flight control adopts open source FMU v6X architecture.
  2. Separate flight control core design.
  3. Support CAN FD to increase the communication rate to 8Mbps.
  4. Support PWM 3.3V 5V voltage switching, adapt to more peripherals and large-size models .
  5. BalancedGyro™ technology, low noise and more shock-resistant.
  6. IMU constant temperature heating, stable as always.
  7. CAN bus dual power supply redundancy.
  8. Adopt industrial-grade magnetic compass.
  9. Customized shock-absorbing sponge, full-surround shock-absorbing design.
  10. Support 100M Ethernet interface.
  11. All external interfaces have port anti-static and filtering protection.
  12. High-voltage over-current and over-voltage protection.

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.

Needs README file, images, pin diagram, etc. and bootloader binaries....like https://github.com/ArduPilot/ardupilot/tree/master/libraries/AP_HAL_ChibiOS/hwdef/BlitzWingH743

moved before the MCU line
moved before the MCU line
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.

This is ok from a hwdef point of view I think, but Henry will still want the docs

@rmackay9
Copy link
Contributor

We need to squash the commits together as well and also the commits should be prefixed with "AP_HAL_ChibiOS:" like we always do to ease back porting.

@ZeroOne-Aero ZeroOne-Aero changed the title Add ZeroOneX6 Flight Controller Bootloader File. AP_HAL_ChibiOS: Add ZeroOneX6 Flight Controller Bootloader File. Jun 17, 2024
@ZeroOne-Aero
Copy link
Contributor Author

This is ok from a hwdef point of view I think, but Henry will still want the docs

Thank you. I'm in the process of organizing docs, and I'll upload the docs soon.

@ZeroOne-Aero ZeroOne-Aero requested a review from Hwurzburg June 20, 2024 02:51
@ZeroOne-Aero
Copy link
Contributor Author

@Hwurzburg Updated README file, Pinout and default parm file. Please help review the document. Looking forward to your reply.


CAN_P1_DRIVER 1
BATT_MONITOR 8
GPS1_TYPE 9
Copy link
Collaborator

Choose a reason for hiding this comment

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

unless you are supplying a DroneCAN GPS I would not do this...most use an autodetected GPS..I would remove this line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We will supply a DroneCAN GPS ,and we have removed this line already.

Copy link
Collaborator

Choose a reason for hiding this comment

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

if you supply a dronecan gps I would add GPS_TYPE =9

libraries/AP_HAL_ChibiOS/hwdef/ZeroOneX6/defaults.parm Outdated Show resolved Hide resolved
| Name | Function |
| ------- | -------- |
| SERIAL0 | OTG1 |
| SERIAL1 | UART7 |
Copy link
Collaborator

Choose a reason for hiding this comment

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

all uarts should also say if TX/RX or both have DMA assigned

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have supplemented all uarts if TX/RX or both have DMA assigned.

Copy link
Collaborator

Choose a reason for hiding this comment

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

which UART is Telem3? its protocol has not been set...

libraries/AP_HAL_ChibiOS/hwdef/ZeroOneX6/README.md Outdated Show resolved Hide resolved
The remote control signal should be connected to the SBUS RC IN port or DSM/PPM RC Port.Support three types of remote control signal inputs, SBUS/DSM and PPM signals.

## PWM Output
The X6 flight controller supports up to 16 PWM outputs. All 16 outputs support normal PWM output formats. All FMU outputs, except 7 and 8, also support DShot.
Copy link
Collaborator

Choose a reason for hiding this comment

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

which outputs correspond to IOMCU and which to FMU?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Should also have a section relating GPIO assignments for each motor output

Copy link
Contributor Author

@ZeroOne-Aero ZeroOne-Aero Jul 19, 2024

Choose a reason for hiding this comment

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

We have modified it in Readme file.

## PWM Output
The X6 flight controller supports up to 16 PWM outputs. All 16 outputs support normal PWM output formats. All FMU outputs, except 7 and 8, also support DShot.

The 8 FMU PWM outputs are in 4 groups:
Copy link
Collaborator

Choose a reason for hiding this comment

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

there is a similar table required for the IOMCU outputs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have supplemented the table of IOMCU outputs.

Copy link
Collaborator

@Hwurzburg Hwurzburg Jul 19, 2024

Choose a reason for hiding this comment

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

I think Dshot is now possible with F103 IOMCU... @andyp1per ?

# enable support for dshot on iomcu
ROMFS io_firmware_dshot.bin Tools/IO_Firmware/iofirmware_dshot_highpolh.bin

define HAL_WITH_IO_MCU_DSHOT 1

Copy link
Collaborator

Choose a reason for hiding this comment

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

and the GPIO assignments for the FMU outputs are not listed...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have listed it to the README file.

Ensure normal communication for telem3.
@Hwurzburg
Copy link
Collaborator

@ZeroOne-Aero is this still an active project...no changes as requested for a while...also needs bootloader...where can this be obtained?

@ZeroOne-Aero
Copy link
Contributor Author

@Hwurzburg Sorry, this project is still in progress, and I will make the submission after I finish modifying the README file. Could you clarify what you mean by 'bootloader'?The hwdef-bl.dat file has already been submitted in this Pull Request.

@Hwurzburg
Copy link
Collaborator

Hwurzburg commented Jul 17, 2024

read step 4 of this :https://ardupilot.org/dev/docs/porting.html

needs bootloader binary added here https://firmware.ardupilot.org/Tools/Bootloaders/

Pin for PWM Voltage Selection Update.
Pin for PWM Voltage Selection Updater.
Add ZeroOneX6_bl.bin and ZeroOneX6_bl.hex.
@ZeroOne-Aero
Copy link
Contributor Author

read step 4 of this :https://ardupilot.org/dev/docs/porting.html

needs bootloader binary added here https://firmware.ardupilot.org/Tools/Bootloaders/

Hello, I have submitted the bootloader binary in PR#27596.

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.

also remove the JPG from the Tools/Bootloaders folder

libraries/AP_HAL_ChibiOS/hwdef/ZeroOneX6/hwdef.dat Outdated Show resolved Hide resolved
## PWM Output
The X6 flight controller supports up to 16 PWM outputs. All 16 outputs support normal PWM output formats. All FMU outputs, except 7 and 8, also support DShot.

The 8 FMU PWM outputs are in 4 groups:
Copy link
Collaborator

@Hwurzburg Hwurzburg Jul 19, 2024

Choose a reason for hiding this comment

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

I think Dshot is now possible with F103 IOMCU... @andyp1per ?

# enable support for dshot on iomcu
ROMFS io_firmware_dshot.bin Tools/IO_Firmware/iofirmware_dshot_highpolh.bin

define HAL_WITH_IO_MCU_DSHOT 1


CAN_P1_DRIVER 1
BATT_MONITOR 8
GPS1_TYPE 9
Copy link
Collaborator

Choose a reason for hiding this comment

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

if you supply a dronecan gps I would add GPS_TYPE =9

| Name | Function |
| ------- | -------- |
| SERIAL0 | OTG1 |
| SERIAL1 | UART7 |
Copy link
Collaborator

Choose a reason for hiding this comment

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

which UART is Telem3? its protocol has not been set...

## PWM Output
The X6 flight controller supports up to 16 PWM outputs. All 16 outputs support normal PWM output formats. All FMU outputs, except 7 and 8, also support DShot.

The 8 FMU PWM outputs are in 4 groups:
Copy link
Collaborator

Choose a reason for hiding this comment

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

and the GPIO assignments for the FMU outputs are not listed...

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.

will need some squashes and clean up besides the pending changes

CAN_P2_DRIVER 1

BATT_MONITOR 8
GPS1_TYPE 9
Copy link
Collaborator

Choose a reason for hiding this comment

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

You should not be setting the GPS type - that is up to the user

Copy link
Collaborator

Choose a reason for hiding this comment

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

they supply a dronecan gps with the autopilot....should remain

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We primarily consider our users, aiming to reduce the difficulty in using our products. Our PMU and GPS communicate via dronecan, they can communicate with each other without requiring additional parameter configuration, so we have set default parameters: CAN P1 DRIVER=1, GPS1_TYPE=9.

Copy link
Collaborator

Choose a reason for hiding this comment

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

if the CAN PMU is also provided with autopilot , it should be setup also, not an analog PMU

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes , we alsp supply a dronecan PMU .

BATT_VOLT_PIN 12
BATT_CURR_PIN 13

CAN_P1_DRIVER 1
Copy link
Collaborator

Choose a reason for hiding this comment

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

These should be set automatically I believe

Copy link
Collaborator

Choose a reason for hiding this comment

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

are we sure????

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I suggest remain it, if customer uses their own analog PMU, they just need to configure BATT_MONITOR = 4, no need to further configure BATT VOLT PIN=12 and BATT CURR PIN=13, I think this would be more user-friendly.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think he was referring to the CAN line, and I am not sure it gets set just because a CAN port is configured....its used in many other autopilots with CAN in their defaults.param files

@@ -0,0 +1,8 @@
BATT_VOLT_PIN 12
Copy link
Collaborator

Choose a reason for hiding this comment

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

These can be done in the hwdef

Copy link
Contributor Author

@ZeroOne-Aero ZeroOne-Aero Jul 22, 2024

Choose a reason for hiding this comment

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

Could this be kept here?

SERIAL_ORDER OTG1 UART7 UART5 USART3

# default to all pins low to avoid ESD issues
DEFAULTGPIO OUTPUT LOW PULLDOWN
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you should just remove this line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

would this need remain to avoid ESD issues?

Copy link
Collaborator

Choose a reason for hiding this comment

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

it should not be used in the bootloader...can be used in main firmware...this prevents some peripherals from entering test modes during their power up


# telem1
PE8 UART7_TX UART7
PF6 UART7_RX UART7 OUTPUT HIGH
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 need OUTPUT HIGH here - what is the purpose?

PE5 LED_BOOTLOADER OUTPUT OPENDRAIN HIGH # blue
define HAL_LED_ON 0

define HAL_USE_EMPTY_STORAGE 1
Copy link
Collaborator

Choose a reason for hiding this comment

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

You don't need these in the bootloader

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, removed.

PB15 SDMMC2_D1 SDMMC2
PG11 SDMMC2_D2 SDMMC2
PB4 SDMMC2_D3 SDMMC2
define FATFS_HAL_DEVICE SDCD2
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 this is required in the main firmware

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hello, it needs to be retained, otherwise, there will be some compilation errors...

#define HAL_HEATER_MAG_OFFSET HAL_HEATER_MAG_OFFSET_RM3100

# IMU devices for ZeroOne X6
SPIDEV icm45686_1 SPI2 DEVID1 SP2_CS1 MODE3 2*MHZ 8*MHZ
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would probably make the max 16Mhz for the ICM45686's

PH13 UART4_TX UART4
PH14 UART4_RX UART4

# debug uart
Copy link
Collaborator

Choose a reason for hiding this comment

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

I haven't looked at the actual DMA output, but my guess is that there is a lot of sharing given the number of SPI buses and UARTs - I would think carefully about removing DMA from some of the UARTs if at all possible

Copy link
Collaborator

Choose a reason for hiding this comment

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

virtually all the uart TX are shared with a spi bus...

@andyp1per
Copy link
Collaborator

Added some comments. The commits all need squashing as well.

@peterbarker
Copy link
Contributor

Duplicate of #27596

@peterbarker peterbarker marked this as a duplicate of #27596 Jul 24, 2024
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