AP_HAL_ChibiOS: hwdef add support for Networking
This commit is contained in:
parent
f66327d97d
commit
291226eb5d
@ -84,17 +84,22 @@ IOMCU_UART USART6
|
||||
# uart6, RX only, RC input, if no IOMCU
|
||||
# PC7 USART6_RX USART6
|
||||
|
||||
# ethernet (not implemented yet)
|
||||
#PA1 ETH_REF_CLK
|
||||
#PA2 ETH_MDIO
|
||||
#PA7 ETH_CRS_DV
|
||||
#PB11 ETH_TX_EN
|
||||
#PC1 ETH_MDC
|
||||
#PC4 ETH_RXD0
|
||||
#PC5 ETH_RXD1
|
||||
#PG12 ETH_TXD1
|
||||
#PG13 ETH_TXD0
|
||||
#PG15 ETH_POWER_EN
|
||||
# Ethernet
|
||||
PB11 ETH_RMII_TX_EN ETH1
|
||||
PG13 ETH_RMII_TXD0 ETH1
|
||||
PG12 ETH_RMII_TXD1 ETH1
|
||||
PC4 ETH_RMII_RXD0 ETH1
|
||||
PC5 ETH_RMII_RXD1 ETH1
|
||||
PA7 ETH_RMII_CRS_DV ETH1
|
||||
PA1 ETH_RMII_REF_CLK ETH1
|
||||
PC1 ETH_MDC ETH1
|
||||
PA2 ETH_MDIO ETH1
|
||||
|
||||
PG15 GPIO_ETH_ENABLE OUTPUT HIGH GPIO(113)
|
||||
define HAL_GPIO_ETH_ENABLE 113
|
||||
|
||||
define BOARD_PHY_ID MII_LAN8742A_ID
|
||||
define BOARD_PHY_RMII
|
||||
|
||||
# ADC
|
||||
PA0 SCALED1_V3V3 ADC1 SCALE(2)
|
||||
@ -211,7 +216,6 @@ PI11 VDD_3V3_SENSORS1_EN OUTPUT HIGH
|
||||
PF4 VDD_3V3_SENSORS2_EN OUTPUT HIGH
|
||||
PE7 VDD_3V3_SENSORS3_EN OUTPUT HIGH
|
||||
PG8 VDD_3V3_SENSORS4_EN OUTPUT HIGH
|
||||
PG15 ETH_PWR_EN OUTPUT LOW # disable power on ethernet
|
||||
|
||||
# start peripheral power off, then enable after init
|
||||
# this prevents a problem with radios that use RTS for
|
||||
|
@ -155,17 +155,18 @@ PF15 I2C4_SDA I2C4
|
||||
I2C_ORDER I2C2 I2C4
|
||||
|
||||
# Ethernet
|
||||
# PA1 ETH_RMII_REF_CLK ETH1
|
||||
# PA2 ETH_MDIO ETH1
|
||||
# PA7 ETH_RMII_CRS_DV ETH1
|
||||
# PB11 ETH_RMII_TX_EN ETH1
|
||||
# PB12 ETH_RMII_TXD0 ETH1
|
||||
# PB13 ETH_RMII_TXD1 ETH1
|
||||
# PC1 ETH_MDC ETH1
|
||||
# PC4 ETH_RMII_RXD0 ETH1
|
||||
# PC5 ETH_RMII_RXD1 ETH1
|
||||
# define BOARD_PHY_ID MII_LAN8720_ID
|
||||
# define BOARD_PHY_RMII
|
||||
PC1 ETH_MDC ETH1
|
||||
PA2 ETH_MDIO ETH1
|
||||
PC4 ETH_RMII_RXD0 ETH1
|
||||
PC5 ETH_RMII_RXD1 ETH1
|
||||
PB12 ETH_RMII_TXD0 ETH1
|
||||
PB13 ETH_RMII_TXD1 ETH1
|
||||
PB11 ETH_RMII_TX_EN ETH1
|
||||
PA7 ETH_RMII_CRS_DV ETH1
|
||||
PA1 ETH_RMII_REF_CLK ETH1
|
||||
|
||||
define BOARD_PHY_ID MII_LAN8720_ID
|
||||
define BOARD_PHY_RMII
|
||||
|
||||
# RCIN
|
||||
PB7 TIM4_CH2 TIM4 RCININT PULLDOWN
|
||||
|
@ -37,17 +37,22 @@ PA9 VBUS INPUT OPENDRAIN
|
||||
PA13 JTMS-SWDIO SWD
|
||||
PA14 JTCK-SWCLK SWD
|
||||
|
||||
# ethernet (not implemented yet)
|
||||
#PA1 ETH_RMII_REF_CLK ETH
|
||||
#PA2 ETH_MDIO ETH
|
||||
#PA7 ETH_RMII_CRS_DV ETH
|
||||
#PB11 ETH_RMII_TX_EN OUTPUT LOW
|
||||
#PB13 ETH_RMII_TXD1 ETH
|
||||
#PC1 ETH_MDC ETH
|
||||
#PC4 ETH_RMII_RXD0 ETH
|
||||
#PC5 ETH_RMII_RXD1 ETH
|
||||
#PG15 ETH_PWR_EN OUTPUT LOW
|
||||
#PG13 ETH_RMII_TXD0 ETH
|
||||
# Ethernet
|
||||
#PC1 ETH_MDC ETH1
|
||||
#PA2 ETH_MDIO ETH1
|
||||
#PC4 ETH_RMII_RXD0 ETH1
|
||||
#PC5 ETH_RMII_RXD1 ETH1
|
||||
#PG13 ETH_RMII_TXD0 ETH1
|
||||
#PB13 ETH_RMII_TXD1 ETH1
|
||||
#PB11 ETH_RMII_TX_EN ETH1
|
||||
#PA7 ETH_RMII_CRS_DV ETH1
|
||||
#PA1 ETH_RMII_REF_CLK ETH1
|
||||
|
||||
#PG15 GPIO_ETH_ENABLE OUTPUT HIGH GPIO(113)
|
||||
#define HAL_GPIO_ETH_ENABLE 113
|
||||
|
||||
#define BOARD_PHY_ID MII_LAN8720_ID
|
||||
#define BOARD_PHY_RMII
|
||||
|
||||
# ADC
|
||||
PA0 SCALED1_V3V3 ADC1 SCALE(2)
|
||||
|
@ -86,16 +86,22 @@ IOMCU_UART USART6
|
||||
# PC7 USART6_RX USART6
|
||||
|
||||
# ethernet (not implemented yet)
|
||||
#PA1 ETH_REF_CLK
|
||||
#PA2 ETH_MDIO
|
||||
#PA7 ETH_CRS_DV
|
||||
#PB11 ETH_TX_EN
|
||||
#PC1 ETH_MDC
|
||||
#PC4 ETH_RXD0
|
||||
#PC5 ETH_RXD1
|
||||
#PG12 ETH_TXD1
|
||||
#PG13 ETH_TXD0
|
||||
#PG15 ETH_POWER_EN
|
||||
PC1 ETH_MDC ETH1
|
||||
PA2 ETH_MDIO ETH1
|
||||
PC4 ETH_RMII_RXD0 ETH1
|
||||
PC5 ETH_RMII_RXD1 ETH1
|
||||
PG13 ETH_RMII_TXD0 ETH1
|
||||
PG12 ETH_RMII_TXD1 ETH1
|
||||
PB11 ETH_RMII_TX_EN ETH1
|
||||
PA7 ETH_RMII_CRS_DV ETH1
|
||||
PA1 ETH_RMII_REF_CLK ETH1
|
||||
#PG15 ETH_POWER_EN ETH1
|
||||
|
||||
PG15 Ethernet_PWR_EN OUTPUT HIGH # disable power on ethernet
|
||||
|
||||
define BOARD_PHY_ID MII_LAN8742A_ID
|
||||
define BOARD_PHY_RMII
|
||||
|
||||
|
||||
# ADC
|
||||
PA0 SCALED1_V3V3 ADC1 SCALE(2)
|
||||
@ -220,7 +226,6 @@ PI11 VDD_3V3_SENSORS1_EN OUTPUT HIGH
|
||||
PF4 VDD_3V3_SENSORS2_EN OUTPUT HIGH
|
||||
PE7 VDD_3V3_SENSORS3_EN OUTPUT HIGH
|
||||
PG8 VDD_3V3_SENSORS4_EN OUTPUT HIGH
|
||||
PG15 ETH_PWR_EN OUTPUT LOW # disable power on ethernet
|
||||
|
||||
# start peripheral power off, then enable after init
|
||||
# this prevents a problem with radios that use RTS for
|
||||
|
168
libraries/AP_HAL_ChibiOS/hwdef/kha_eth/hwdef.dat
Normal file
168
libraries/AP_HAL_ChibiOS/hwdef/kha_eth/hwdef.dat
Normal file
@ -0,0 +1,168 @@
|
||||
# hw definition file for processing by chibios_hwdef.py
|
||||
# for H743
|
||||
|
||||
# MCU class and specific type
|
||||
MCU STM32H7xx STM32H743xx
|
||||
|
||||
AUTOBUILD_TARGETS None
|
||||
|
||||
env OPTIMIZE -O2
|
||||
|
||||
# USB setup
|
||||
USB_STRING_MANUFACTURER "ArduPilot"
|
||||
USB_STRING_PRODUCT "%BOARD%"
|
||||
|
||||
#define WATCHDOG_DISABLED
|
||||
|
||||
# crystal frequency
|
||||
OSCILLATOR_HZ 25000000
|
||||
|
||||
|
||||
FLASH_SIZE_KB 2048
|
||||
|
||||
# setup build for a peripheral firmware
|
||||
env AP_PERIPH 1
|
||||
|
||||
define HAL_BUILD_AP_PERIPH
|
||||
|
||||
# bootloader is installed at zero offset
|
||||
FLASH_RESERVE_START_KB 128
|
||||
FLASH_BOOTLOADER_LOAD_KB 128
|
||||
|
||||
# reserve 256 bytes for comms between app and bootloader
|
||||
RAM_RESERVE_START 256
|
||||
|
||||
MAIN_STACK 0x2000
|
||||
PROCESS_STACK 0x6000
|
||||
|
||||
# board ID for firmware load
|
||||
APJ_BOARD_ID 1315
|
||||
|
||||
PA13 JTMS-SWDIO SWD
|
||||
PA14 JTCK-SWCLK SWD
|
||||
|
||||
###########################
|
||||
|
||||
# CAN setup
|
||||
PB8 CAN1_RX CAN1
|
||||
PB9 CAN1_TX CAN1
|
||||
|
||||
###########################
|
||||
|
||||
# UART 1 - Avionics
|
||||
PA9 USART1_TX USART1
|
||||
PA10 USART1_RX USART1
|
||||
|
||||
# UART 2 - Avionics
|
||||
PD5 USART2_TX USART2
|
||||
PD6 USART2_RX USART2
|
||||
|
||||
# UART 3 - unused, J2 (2 pin)
|
||||
PC10 UART4_TX UART4
|
||||
PC11 UART4_RX UART4
|
||||
|
||||
# UART 4 - debug console, J6 (4 pin)
|
||||
PE7 UART7_RX UART7
|
||||
PE8 UART7_TX UART7
|
||||
|
||||
# Now we define the pins that USB is connected on.
|
||||
PA11 OTG_FS_DM OTG1
|
||||
PA12 OTG_FS_DP OTG1
|
||||
|
||||
# order of UARTs (and USB)
|
||||
SERIAL_ORDER OTG1 USART1 USART2
|
||||
#SERIAL_ORDER OTG1 USART1 USART2 OTG2
|
||||
#SERIAL_ORDER OTG1 USART1 USART2 UART4 UART7
|
||||
#SERIAL_ORDER OTG1 USART1 USART2 UART4 UART7 OTG2
|
||||
|
||||
define AP_CAN_SLCAN_ENABLED 0
|
||||
|
||||
###########################
|
||||
# storage
|
||||
###########################
|
||||
define HAL_STORAGE_SIZE 32768
|
||||
STORAGE_FLASH_PAGE 14
|
||||
###########################
|
||||
|
||||
|
||||
# Ethernet
|
||||
PC1 ETH_MDC ETH1
|
||||
PA2 ETH_MDIO ETH1
|
||||
PC4 ETH_RMII_RXD0 ETH1
|
||||
PC5 ETH_RMII_RXD1 ETH1
|
||||
PB12 ETH_RMII_TXD0 ETH1
|
||||
PB13 ETH_RMII_TXD1 ETH1
|
||||
PB11 ETH_RMII_TX_EN ETH1
|
||||
PA7 ETH_RMII_CRS_DV ETH1
|
||||
PA1 ETH_RMII_REF_CLK ETH1
|
||||
|
||||
PA15 GPIO_ETH_ENABLE INPUT FLOATING GPIO(113)
|
||||
define HAL_GPIO_ETH_ENABLE 113
|
||||
|
||||
define BOARD_PHY_ID MII_LAN8742A_ID
|
||||
define BOARD_PHY_RMII
|
||||
|
||||
###################
|
||||
|
||||
# Refer to https://maclookup.app/vendors/cubepilot-pty-ltd
|
||||
# A8-B0-28-??-??-?? where the ?? is the lower 3 bytes from the STM32 UUID
|
||||
define AP_NETWORKING_DEFAULT_MAC_ADDR0 0xA8
|
||||
define AP_NETWORKING_DEFAULT_MAC_ADDR1 0xB0
|
||||
define AP_NETWORKING_DEFAULT_MAC_ADDR2 0x28
|
||||
|
||||
###################
|
||||
|
||||
#Communications and debug
|
||||
# use DNA
|
||||
define HAL_CAN_DEFAULT_NODE_ID 0
|
||||
define CAN_APP_NODE_NAME "com.kha.eth"
|
||||
#################################
|
||||
|
||||
# Multi-purpose pins like SPI, I2C, GPIO, PWMs, LEDs, ADC
|
||||
|
||||
I2C_ORDER I2C4
|
||||
PD12 I2C4_SCL I2C4
|
||||
PD13 I2C4_SDA I2C4
|
||||
|
||||
|
||||
# LEDs
|
||||
PE11 LED1 OUTPUT LOW GPIO(3)
|
||||
PE12 LED2 OUTPUT LOW GPIO(4)
|
||||
define HAL_GPIO_PIN_LED HAL_GPIO_PIN_LED1
|
||||
#define HAL_GPIO_PIN_LED_CAN1 HAL_GPIO_PIN_LED2
|
||||
define HAL_LED_ON 1
|
||||
|
||||
define HAL_USE_ADC FALSE
|
||||
define STM32_ADC_USE_ADC1 FALSE
|
||||
define HAL_DISABLE_ADC_DRIVER TRUE
|
||||
|
||||
#################################
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------------------------
|
||||
# AP_Periph - boiler-plate configurations that all HW AP-Periph need
|
||||
# ---------------------------------------------------------------------------------------------
|
||||
define DISABLE_SERIAL_ESC_COMM TRUE
|
||||
define HAL_NO_RCIN_THREAD
|
||||
#define HAL_NO_GPIO_IRQ
|
||||
define HAL_DISABLE_LOOP_DELAY
|
||||
|
||||
|
||||
define PERIPH_FW TRUE
|
||||
#define NO_DATAFLASH TRUE
|
||||
define HAL_LOGGING_ENABLED TRUE
|
||||
|
||||
#################################
|
||||
# AP_Periph - configurations specific to this App
|
||||
#################################
|
||||
|
||||
env DISABLE_SCRIPTING 1
|
||||
|
||||
# listen for reboot command from uploader.py script
|
||||
# undefine to disable. Use -1 to allow on all ports, otherwise serial number index defined in SERIAL_ORDER starting at 0
|
||||
define HAL_PERIPH_LISTEN_FOR_SERIAL_UART_REBOOT_CMD_PORT 0
|
||||
#################################
|
||||
|
||||
|
||||
DMA_NOSHARE USART1* USART2* CAN1*
|
||||
|
Loading…
Reference in New Issue
Block a user