-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
Conversation
ZeroOne-Aero
commented
Jun 11, 2024
- ZeroOneX6 flight control adopts open source FMU v6X architecture.
- Separate flight control core design.
- Support CAN FD to increase the communication rate to 8Mbps.
- Support PWM 3.3V 5V voltage switching, adapt to more peripherals and large-size models .
- BalancedGyro™ technology, low noise and more shock-resistant.
- IMU constant temperature heating, stable as always.
- CAN bus dual power supply redundancy.
- Adopt industrial-grade magnetic compass.
- Customized shock-absorbing sponge, full-surround shock-absorbing design.
- Support 100M Ethernet interface.
- All external interfaces have port anti-static and filtering protection.
- High-voltage over-current and over-voltage protection.
There was a problem hiding this 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
There was a problem hiding this 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
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. |
Thank you. I'm in the process of organizing docs, and I'll upload the docs soon. |
@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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 | |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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...
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. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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.
@ZeroOne-Aero is this still an active project...no changes as requested for a while...also needs bootloader...where can this be obtained? |
@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. |
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.
Hello, I have submitted the bootloader binary in PR#27596. |
There was a problem hiding this 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
## 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: |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 | |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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...
There was a problem hiding this 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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we sure????
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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...
Added some comments. The commits all need squashing as well. |
Duplicate of #27596 |