diff --git a/libraries/AP_HAL_ChibiOS/hwdef/CubeOrange/hwdef-bl.inc b/libraries/AP_HAL_ChibiOS/hwdef/CubeOrange/hwdef-bl.inc index 272295bf94..5da67a0bdf 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/CubeOrange/hwdef-bl.inc +++ b/libraries/AP_HAL_ChibiOS/hwdef/CubeOrange/hwdef-bl.inc @@ -63,3 +63,18 @@ PA8 nVDD_5V_PERIPH_EN OUTPUT LOW # enable DFU by default ENABLE_DFU_BOOT 1 + +# enable flashing from SD card: +include sdcard.inc +# enable FAT filesystem support (needs a microSD defined via SDMMC) +define HAL_OS_FATFS_IO 1 +define AP_BOOTLOADER_FLASH_FROM_SD_ENABLED 1 + +# FATFS support: +define CH_CFG_USE_MEMCORE 1 +define CH_CFG_USE_HEAP 1 +define CH_CFG_USE_SEMAPHORES 0 +define CH_CFG_USE_MUTEXES 1 +define CH_CFG_USE_DYNAMIC 1 +define CH_CFG_USE_WAITEXIT 1 +define CH_CFG_USE_REGISTRY 1 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/CubeOrange/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/CubeOrange/hwdef.dat index 3ae5a6ecb7..041af61713 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/CubeOrange/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/CubeOrange/hwdef.dat @@ -4,3 +4,6 @@ MCU STM32H7xx STM32H743xx include hwdef.inc + +# build ABIN for flash-from-bootloader support: +env BUILD_ABIN True diff --git a/libraries/AP_HAL_ChibiOS/hwdef/CubeOrange/hwdef.inc b/libraries/AP_HAL_ChibiOS/hwdef/CubeOrange/hwdef.inc index 885e9f5e5b..74e54d2532 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/CubeOrange/hwdef.inc +++ b/libraries/AP_HAL_ChibiOS/hwdef/CubeOrange/hwdef.inc @@ -118,13 +118,8 @@ PC5 PRESSURE_SENS ADC1 SCALE(2) PC6 USART6_TX USART6 PC7 USART6_RX USART6 -# 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 +# Now setup the pins for the microSD card +include sdcard.inc # More CS pins for more sensors. The labels for all CS pins need to # match the SPI device table later in this file. diff --git a/libraries/AP_HAL_ChibiOS/hwdef/CubeOrange/sdcard.inc b/libraries/AP_HAL_ChibiOS/hwdef/CubeOrange/sdcard.inc new file mode 100644 index 0000000000..3aed046a58 --- /dev/null +++ b/libraries/AP_HAL_ChibiOS/hwdef/CubeOrange/sdcard.inc @@ -0,0 +1,7 @@ +# pins for SD card: +PC8 SDMMC1_D0 SDMMC1 +PC9 SDMMC1_D1 SDMMC1 +PC10 SDMMC1_D2 SDMMC1 +PC11 SDMMC1_D3 SDMMC1 +PC12 SDMMC1_CK SDMMC1 +PD2 SDMMC1_CMD SDMMC1