From 21ad3c7ac1f88e37d9876c5cb2133670aab0f257 Mon Sep 17 00:00:00 2001 From: bugobliterator Date: Tue, 17 Aug 2021 13:06:20 +0530 Subject: [PATCH] AP_HAL_ChibiOS: add HereID board --- .../hwdef/HereCommon/hwdef-bl.inc | 68 +++++++++++++++ .../AP_HAL_ChibiOS/hwdef/HereCommon/hwdef.inc | 84 +++++++++++++++++++ .../AP_HAL_ChibiOS/hwdef/HereID/hwdef-bl.dat | 9 ++ .../AP_HAL_ChibiOS/hwdef/HereID/hwdef.dat | 10 +++ 4 files changed, 171 insertions(+) create mode 100644 libraries/AP_HAL_ChibiOS/hwdef/HereCommon/hwdef-bl.inc create mode 100644 libraries/AP_HAL_ChibiOS/hwdef/HereCommon/hwdef.inc create mode 100644 libraries/AP_HAL_ChibiOS/hwdef/HereID/hwdef-bl.dat create mode 100644 libraries/AP_HAL_ChibiOS/hwdef/HereID/hwdef.dat diff --git a/libraries/AP_HAL_ChibiOS/hwdef/HereCommon/hwdef-bl.inc b/libraries/AP_HAL_ChibiOS/hwdef/HereCommon/hwdef-bl.inc new file mode 100644 index 0000000000..dc9b158b2b --- /dev/null +++ b/libraries/AP_HAL_ChibiOS/hwdef/HereCommon/hwdef-bl.inc @@ -0,0 +1,68 @@ +# hw definition file for processing by chibios_hwdef.py +# for H757 + +# MCU class and specific type +MCU STM32H7xx STM32H757xx + +define CORE_CM7 +define SMPS_PWR + +# setup build for a peripheral firmware +env AP_PERIPH 1 + +FLASH_SIZE_KB 2048 + +# reserve 256 bytes for comms between app and bootloader +RAM_RESERVE_START 256 + +# the location where the bootloader will put the firmware +# the H743 has 128k sectors +FLASH_BOOTLOADER_LOAD_KB 256 + +# bootloader is installed at zero offset +FLASH_RESERVE_START_KB 0 + +# crystal frequency +OSCILLATOR_HZ 24000000 + +PB14 USART1_TX USART1 +PB15 USART1_RX USART1 + +PA0 USART2_CTS USART2 +PA1 USART2_RTS USART2 +PA2 USART2_TX USART2 +PA3 USART2_RX USART2 + +PD9 USART3_RX USART3 +PD8 USART3_TX USART3 + +SERIAL_ORDER OTG1 USART1 USART2 USART3 + +PA4 MCU_DCD OUTPUT LOW +PA5 MCU_DTR OUTPUT LOW +PA6 MCU_POW_ON OUTPUT HIGH +PA7 MCU_IO_2 OUTPUT LOW + +# now we define the pins that USB is connected on +PA11 OTG_FS_DM OTG1 +PA12 OTG_FS_DP OTG1 + +define USB_USE_WAIT TRUE +define HAL_USE_USB_MSD TRUE + +PA13 JTMS-SWDIO SWD +PA14 JTCK-SWCLK SWD + +PB3 LED_BOOTLOADER OUTPUT HIGH +PB4 LED OUTPUT HIGH +PB13 LED_2 OUTPUT HIGH + +define HAL_LED_ON 0 + +# enable CAN support +PB8 CAN1_RX CAN1 +PB9 CAN1_TX CAN1 +PC7 SLEEPCAN OUTPUT PUSHPULL SPEED_LOW LOW + +define HAL_USE_EMPTY_STORAGE 1 +define HAL_STORAGE_SIZE 16384 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/HereCommon/hwdef.inc b/libraries/AP_HAL_ChibiOS/hwdef/HereCommon/hwdef.inc new file mode 100644 index 0000000000..3de5e2f35f --- /dev/null +++ b/libraries/AP_HAL_ChibiOS/hwdef/HereCommon/hwdef.inc @@ -0,0 +1,84 @@ +# hw definition file for processing by chibios_hwdef.py +# for H757 + +# MCU class and specific type +MCU STM32H7xx STM32H757xx + +define CORE_CM7 +define SMPS_PWR + +# setup build for a peripheral firmware +env AP_PERIPH 1 +define PERIPH_FW TRUE +define HAL_BUILD_AP_PERIPH + +FLASH_SIZE_KB 2048 + +# reserve 256 bytes for comms between app and bootloader +RAM_RESERVE_START 256 + +# the location where the bootloader will put the firmware +# the H743 has 128k sectors +FLASH_BOOTLOADER_LOAD_KB 256 +FLASH_RESERVE_START_KB 256 + +# crystal frequency +OSCILLATOR_HZ 24000000 + +PB14 USART1_TX USART1 +PB15 USART1_RX USART1 + +PA0 USART2_CTS USART2 +PA1 USART2_RTS USART2 +PA2 USART2_TX USART2 +PA3 USART2_RX USART2 + +PD9 USART3_RX USART3 +PD8 USART3_TX USART3 + +SERIAL_ORDER OTG1 USART1 USART2 USART3 + +PA4 MCU_DCD OUTPUT LOW +PA5 MCU_DTR OUTPUT LOW +PA6 MCU_POW_ON OUTPUT HIGH +PA7 MCU_IO_2 OUTPUT LOW + +# now we define the pins that USB is connected on +PA11 OTG_FS_DM OTG1 +PA12 OTG_FS_DP OTG1 + +define USB_USE_WAIT TRUE +define HAL_USE_USB_MSD TRUE + +PA13 JTMS-SWDIO SWD +PA14 JTCK-SWCLK SWD + +PB3 LED_BOOTLOADER OUTPUT HIGH +PB4 LED OUTPUT HIGH +PB13 LED_2 OUTPUT HIGH + +define HAL_LED_ON 0 + +# enable CAN support +PB8 CAN1_RX CAN1 +PB9 CAN1_TX CAN1 +PC7 SLEEPCAN OUTPUT PUSHPULL SPEED_LOW LOW + +# Now setup the pins for the microSD card, if available. +#PC8 SDMMC1_D0 SDMMC1 +#PC9 SDMMC1_D1 SDMMC1 +#PC10 SDMMC1_D2 SDMMC1 +#PC11 SDMMC1_D3 SDMMC1 +#PC12 SDMMC1_CK SDMMC1 +#PD2 SDMMC1_CMD SDMMC1 + +define HAL_USE_EMPTY_STORAGE 1 +define HAL_STORAGE_SIZE 16384 + +# analog input +define HAL_USE_ADC FALSE +define STM32_ADC_USE_ADC1 FALSE +define HAL_DISABLE_ADC_DRIVER TRUE + +define HAL_CAN_DEFAULT_NODE_ID 0 +define HAL_NO_GCS diff --git a/libraries/AP_HAL_ChibiOS/hwdef/HereID/hwdef-bl.dat b/libraries/AP_HAL_ChibiOS/hwdef/HereID/hwdef-bl.dat new file mode 100644 index 0000000000..3850c4d6cc --- /dev/null +++ b/libraries/AP_HAL_ChibiOS/hwdef/HereID/hwdef-bl.dat @@ -0,0 +1,9 @@ +include ../HereCommon/hwdef-bl.inc + +# board ID for firmware load +APJ_BOARD_ID 1043 + +# USB setup +USB_VENDOR 0x2DAE # ONLY FOR USE BY HEX! NOBODY ELSE +USB_PRODUCT 0x5012 +USB_STRING_MANUFACTURER "CubePilot" diff --git a/libraries/AP_HAL_ChibiOS/hwdef/HereID/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/HereID/hwdef.dat new file mode 100644 index 0000000000..bc19e96c2c --- /dev/null +++ b/libraries/AP_HAL_ChibiOS/hwdef/HereID/hwdef.dat @@ -0,0 +1,10 @@ +include ../HereCommon/hwdef.inc + +# board ID for firmware load +APJ_BOARD_ID 1043 + +# USB setup +USB_VENDOR 0x2DAE # ONLY FOR USE BY HEX! NOBODY ELSE +USB_PRODUCT 0x5012 +USB_STRING_MANUFACTURER "CubePilot" +