-
Notifications
You must be signed in to change notification settings - Fork 19.7k
ChibiOS: add CubeNode-vehicle hwdef #31410
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
Draft
IamPete1
wants to merge
6
commits into
ArduPilot:master
Choose a base branch
from
IamPete1:CubeNodeVehicle
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,636
−139
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
48803db
ChibiOS: CubeNode: move to hwdef includes
IamPete1 a29577a
ChibiOS: add CubeNode-vehicle hwdef
IamPete1 403ff7e
CubeNode: move `HAL_USE_ADC` from `.inc` to `.dat`
IamPete1 62cd08e
AP_HAL_ChibiOS: Analogin: move `MCU_MONITORING_PINS` into `HAL_ANALOG…
IamPete1 929c940
ChibiOS: Analogin: allow no pins on ADC1
IamPete1 1235ccc
ChibiOS: CubeNode-vehicle: disable software I2C pullups and add note
IamPete1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| include ../CubeNode/hwdef-bl.inc | ||
|
|
||
| # Add activity LEDs | ||
| PB1 LED_BOOTLOADER OUTPUT OPENDRAIN HIGH # Blue | ||
| PB0 LED_ACTIVITY OUTPUT OPENDRAIN HIGH # Green | ||
| define HAL_LED_ON 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| # hw definition file for processing by chibios_hwdef.py for H757 | ||
| # CubeNode pin descriptions can be found at https://docs.cubepilot.org/user-guides/cubenode/pin-descriptions | ||
|
|
||
| include ../CubeNode/hwdef.inc | ||
|
|
||
| # CAN2 | ||
| PB5 CAN2_RX CAN2 | ||
| PB6 CAN2_TX CAN2 | ||
|
|
||
| # SERIAL | ||
|
|
||
| # UART 1 | ||
| PE1 UART8_TX UART8 | ||
| PE0 UART8_RX UART8 | ||
|
|
||
| # UART 2 | ||
| PC6 USART6_TX USART6 | ||
| PC7 USART6_RX USART6 | ||
|
|
||
| # UART 3 | ||
| undef PE7 | ||
| undef PE8 | ||
| PE7 UART7_RX UART7 | ||
| PE8 UART7_TX UART7 | ||
| PE10 UART7_CTS UART7 | ||
| PE9 UART7_RTS UART7 | ||
|
|
||
| undef SERIAL_ORDER | ||
| SERIAL_ORDER OTG1 UART8 USART6 UART7 OTG2 | ||
|
|
||
| # I2C | ||
| PB8 I2C1_SCL I2C1 | ||
| PB7 I2C1_SDA I2C1 | ||
|
|
||
| I2C_ORDER I2C1 | ||
|
|
||
| # No Baro on the board, allow boot without | ||
| define HAL_BARO_ALLOW_INIT_NO_BARO | ||
|
|
||
| # LEDs | ||
| PB1 LED_BLUE OUTPUT LOW GPIO(0) | ||
| PB0 LED_GREEN OUTPUT LOW GPIO(1) | ||
| PE6 LED_RED OUTPUT LOW GPIO(2) | ||
|
|
||
| define AP_NOTIFY_GPIO_LED_3_ENABLED 1 | ||
| define HAL_GPIO_A_LED_PIN 0 | ||
| define HAL_GPIO_B_LED_PIN 1 | ||
| define HAL_GPIO_C_LED_PIN 2 | ||
|
|
||
| # PWM output for buzzer | ||
| PA15 TIM2_CH1 TIM2 GPIO(77) ALARM | ||
|
|
||
| # pins for SD card: | ||
| PB14 SDMMC2_D0 SDMMC2 | ||
| PB15 SDMMC2_D1 SDMMC2 | ||
| PB3 SDMMC2_D2 SDMMC2 | ||
| PB4 SDMMC2_D3 SDMMC2 | ||
| PD6 SDMMC2_CK SDMMC2 | ||
| PD7 SDMMC2_CMD SDMMC2 | ||
|
|
||
| # Enable FAT filesystem support (needs a microSD defined via SDMMC). | ||
| define HAL_OS_FATFS_IO 1 | ||
| define FATFS_HAL_DEVICE SDCD2 | ||
|
|
||
| # Defining some PWM pins. We also map these pins to GPIO | ||
| PE14 TIM1_CH4 TIM1 PWM(1) GPIO(50) | ||
| PE13 TIM1_CH3 TIM1 PWM(2) GPIO(51) | ||
| PE11 TIM1_CH2 TIM1 PWM(3) GPIO(52) | ||
| PD13 TIM4_CH2 TIM4 PWM(4) GPIO(53) | ||
| PD14 TIM4_CH3 TIM4 PWM(5) GPIO(54) | ||
| PD15 TIM4_CH4 TIM4 PWM(6) GPIO(55) |
115 changes: 115 additions & 0 deletions
115
libraries/AP_HAL_ChibiOS/hwdef/CubeNode-vehicle/readme.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| # CubeNode-vehicle | ||
|
|
||
| This build can be used to flash a vehicle code on a CubeNode. This will have to be loaded using dfu as the CubeNode ships with a Periph bootloader which cannot load a vehicle binary. | ||
|
|
||
| This can be used as a starting point for other configurations, pin functions can be add, removed, or changed as needed. | ||
|
|
||
| ## Serial | ||
|
|
||
| Three serial physical ports are available along with two USB endpoints. The ordering is: | ||
|
|
||
| #### SERIAL0 | ||
|
|
||
| First USB endpoint | ||
|
|
||
| #### SERIAL1 | ||
|
|
||
| | Pin name | Pin number | function | | ||
| | -------- | ---------- | -------- | | ||
| | PE1 | 3 | UART8_TX | | ||
| | PE0 | 4 | UART8_RX | | ||
|
|
||
| #### SERIAL2 | ||
|
|
||
| | Pin name | Pin number | function | | ||
| | -------- | ---------- | --------- | | ||
| | PC6 | 44 | USART6_TX | | ||
| | PC7 | 43 | USART6_RX | | ||
|
|
||
| #### SERIAL3 | ||
|
|
||
| UART 3 has flow control. | ||
|
|
||
| | Pin name | Pin number | function | | ||
| | -------- | ---------- | --------- | | ||
| | PE7 | 23 | UART7_RX | | ||
| | PE8 | 22 | UART7_TX | | ||
| | PE10 | 21 | UART7_CTS | | ||
| | PE9 | 72 | UART7_RTS | | ||
|
|
||
| ##### SERIAL4 | ||
|
|
||
| Second USB endpoint | ||
|
|
||
| # CAN | ||
|
|
||
| Two CAN busses are available, transceivers are within the Node itself but termination resistors are not. | ||
|
|
||
| #### CAN 1 | ||
|
|
||
| | Pin name | Pin number | function | | ||
| | -------- | ---------- | --------- | | ||
| | CAN1_H | 2 | CAN1 high | | ||
| | CAN1_L | 1 | CAN1 low | | ||
|
|
||
| #### CAN 2 | ||
|
|
||
| | Pin name | Pin number | function | | ||
| | -------- | ---------- | --------- | | ||
| | CAN2_H | 15 | CAN2 high | | ||
| | CAN2_L | 14 | CAN2 low | | ||
|
|
||
| # I2C | ||
|
|
||
| A single I2C bus is provided, software pullup resistors can be enabled but hardware pullup are recommended. | ||
|
|
||
| ##### I2C | ||
|
|
||
| | Pin name | Pin number | function | | ||
| | -------- | ---------- | -------- | | ||
| | PB8 | 5 | I2C1_SCL | | ||
| | PB7 | 6 | I2C1_SDA | | ||
|
|
||
| # LEDs | ||
|
|
||
| Three board LEDs are defined for use with notify to provide status feedback, these are active low. | ||
|
|
||
| | Pin name | Pin number | function | | ||
| | -------- | ---------- | --------- | | ||
| | PB1 | 45 | Blue LED | | ||
| | PB0 | 46 | Green LED | | ||
| | PE6 | 47 | Red LED | | ||
|
|
||
| # Buzzer | ||
|
|
||
| A Alarm output is provided for a buzzer, some external drive circuit is required. | ||
|
|
||
| | Pin name | Pin number | function | | ||
| | -------- | ---------- | -------- | | ||
| | PA15 | 60 | ALARM | | ||
|
|
||
| # SD Card | ||
|
|
||
| A SD can be connected via SDMMC | ||
|
|
||
| | Pin name | Pin number | function | | ||
| | -------- | ---------- | ---------- | | ||
| | PB14 | 102 | SDMMC2_D0 | | ||
| | PB15 | 101 | SDMMC2_D1 | | ||
| | PB3 | 106 | SDMMC2_D2 | | ||
| | PB4 | 107 | SDMMC2_D3 | | ||
| | PD6 | 110 | SDMMC2_CK | | ||
| | PD7 | 111 | SDMMC2_CMD | | ||
|
|
||
| ## PWM outputs | ||
|
|
||
| PWM output pins can also be used as GPIOs. They are in two groups. | ||
|
|
||
| | Pin name | Pin number | function | SERVO num | GPIO num | Group | | ||
| | -------- | ---------- | ---------- | --------- | -------- | ------| | ||
| | PE14 | 69 | TIM1_CH4 | 1 | 50 | A | | ||
| | PE13 | 70 | TIM1_CH3 | 2 | 51 | A | | ||
| | PE11 | 71 | TIM1_CH2 | 3 | 52 | A | | ||
| | PD13 | 34 | TIM4_CH2 | 4 | 53 | B | | ||
| | PD14 | 33 | TIM4_CH3 | 5 | 54 | B | | ||
| | PD15 | 32 | TIM4_CH4 | 6 | 55 | B | | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 a better summary, I think
UART Port Mapping:
Port UART Protocol TX DMA RX DMA
0 USB MAVLink2 ✘ ✘
1 UART8 MAVLink2 ✔ ✔
2 USART6 MAVLink2 ✔ ✔
3 UART7 GPS ✔ ✔
4 USB SLCAN ✘ ✘