From f9faa0765d6fc4b4314a5e86a5658409bf1b732b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 16 Jun 2018 21:09:31 +1000 Subject: [PATCH] HAL_ChibiOS: fixed bootloader IDs --- .../AP_HAL_ChibiOS/hwdef/KakuteF4/hwdef.dat | 8 +-- .../AP_HAL_ChibiOS/hwdef/MatekF405/hwdef.dat | 6 +-- .../hwdef/OMNIBUSF7V2/hwdef.dat | 6 +-- .../hwdef.dat => cube-orange/hwdef-bl.dat} | 8 +-- .../hwdef/cube-orange/hwdef.dat | 9 ++-- .../AP_HAL_ChibiOS/hwdef/f745-bl/hwdef.dat | 50 ------------------- .../AP_HAL_ChibiOS/hwdef/f765-bl/hwdef.dat | 46 ----------------- .../hwdef.dat => revo-mini/hwdef-bl.dat} | 8 +-- .../AP_HAL_ChibiOS/hwdef/revo-mini/hwdef.dat | 6 +-- 9 files changed, 27 insertions(+), 120 deletions(-) rename libraries/AP_HAL_ChibiOS/hwdef/{f777-bl/hwdef.dat => cube-orange/hwdef-bl.dat} (87%) delete mode 100644 libraries/AP_HAL_ChibiOS/hwdef/f745-bl/hwdef.dat delete mode 100644 libraries/AP_HAL_ChibiOS/hwdef/f765-bl/hwdef.dat rename libraries/AP_HAL_ChibiOS/hwdef/{f405-bl/hwdef.dat => revo-mini/hwdef-bl.dat} (84%) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/KakuteF4/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/KakuteF4/hwdef.dat index 6065037894..77647aed03 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/KakuteF4/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/KakuteF4/hwdef.dat @@ -2,7 +2,7 @@ # STATUS: # This port is mostly complete. Main missing feature are OSD, -# dataflash and RCIN +# dataflash # MCU class and specific type MCU STM32F4xx STM32F405xx @@ -10,7 +10,7 @@ MCU STM32F4xx STM32F405xx define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_CHIBIOS_KAKUTEF4 # board ID for firmware load -APJ_BOARD_ID 70 +APJ_BOARD_ID 122 # crystal frequency OSCILLATOR_HZ 8000000 @@ -114,9 +114,9 @@ PB0 TIM3_CH3 TIM3 PWM(4) GPIO(53) # PC8 TIM8_CH3 TIM2 GPIO(54) # LED strip define HAL_STORAGE_SIZE 8192 -define STORAGE_FLASH_PAGE 1 +define STORAGE_FLASH_PAGE 2 -# reserve 16k for bootloader, 16k for OSD and 32k for flash storage +# reserve 32k for bootloader and 32k for flash storage FLASH_RESERVE_START_KB 64 define HAL_INS_DEFAULT HAL_INS_MPU60XX_SPI diff --git a/libraries/AP_HAL_ChibiOS/hwdef/MatekF405/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/MatekF405/hwdef.dat index 56f43a3986..62f60877c6 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/MatekF405/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/MatekF405/hwdef.dat @@ -12,7 +12,7 @@ MCU STM32F4xx STM32F405xx define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_CHIBIOS_MATEKF405 # board ID for firmware load -APJ_BOARD_ID 70 +APJ_BOARD_ID 125 # crystal frequency OSCILLATOR_HZ 8000000 @@ -124,9 +124,9 @@ PA15 TIM2_CH1 TIM2 PWM(5) GPIO(54) PA8 TIM1_CH1 TIM1 PWM(6) GPIO(55) define HAL_STORAGE_SIZE 8192 -define STORAGE_FLASH_PAGE 1 +define STORAGE_FLASH_PAGE 2 -# reserve 16k for bootloader, 16k for OSD and 32k for flash storage +# reserve 32k for bootloader and 32k for flash storage FLASH_RESERVE_START_KB 64 define HAL_INS_DEFAULT HAL_INS_MPU60XX_SPI diff --git a/libraries/AP_HAL_ChibiOS/hwdef/OMNIBUSF7V2/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/OMNIBUSF7V2/hwdef.dat index 1dcae408ba..b5d621cb3a 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/OMNIBUSF7V2/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/OMNIBUSF7V2/hwdef.dat @@ -8,7 +8,7 @@ MCU STM32F7xx STM32F745xx define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_CHIBIOS_OMNIBUSF7V2 # board ID for firmware load -APJ_BOARD_ID 81 +APJ_BOARD_ID 121 # crystal frequency, setup to use external oscillator OSCILLATOR_HZ 8000000 @@ -24,8 +24,8 @@ define STM32_PLLQ_VALUE 9 FLASH_SIZE_KB 1024 -# run without a bootloader for now, use DFU upload -FLASH_RESERVE_START_KB 0 +# reserve one sector for bootloader and 2 for storage +FLASH_RESERVE_START_KB 96 # board voltage STM32_VDD 330U diff --git a/libraries/AP_HAL_ChibiOS/hwdef/f777-bl/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/cube-orange/hwdef-bl.dat similarity index 87% rename from libraries/AP_HAL_ChibiOS/hwdef/f777-bl/hwdef.dat rename to libraries/AP_HAL_ChibiOS/hwdef/cube-orange/hwdef-bl.dat index a9faf740f9..1a94e5fc27 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/f777-bl/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/cube-orange/hwdef-bl.dat @@ -15,7 +15,7 @@ define STM32_PLLP_VALUE 2 define STM32_PLLQ_VALUE 9 # board ID for firmware load -APJ_BOARD_ID 78 +APJ_BOARD_ID 120 # board voltage STM32_VDD 330U @@ -44,8 +44,8 @@ PA14 JTCK-SWCLK SWD # no reserved flash for bootloader FLASH_RESERVE_START_KB 0 -# the location where the bootloader will put the firmware -define FLASH_BOOTLOADER_LOAD_KB 32 +# start on 4th sector (1st sector for bootloader, 2 for extra storage) +define FLASH_BOOTLOADER_LOAD_KB 96 define HAL_USE_EMPTY_STORAGE 1 -define HAL_STORAGE_SIZE 16384 + diff --git a/libraries/AP_HAL_ChibiOS/hwdef/cube-orange/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/cube-orange/hwdef.dat index 45579494bf..319ae24ffc 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/cube-orange/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/cube-orange/hwdef.dat @@ -29,7 +29,7 @@ define STM32_PLLP_VALUE 2 define STM32_PLLQ_VALUE 9 # board ID for firmware load -APJ_BOARD_ID 78 +APJ_BOARD_ID 120 # on some boards you will need to also set the various PLL values. See # the defaults in common/mcuconf.h, and use the define mechanism @@ -440,8 +440,11 @@ define HAL_I2C_MAX_CLOCK 100000 DMA_NOSHARE USART6_TX USART6_RX ADC1 DMA_PRIORITY USART6* -# start on 2nd sector (1st sector for bootloader) -FLASH_RESERVE_START_KB 32 +# start on 4th sector (1st sector for bootloader, 2 for extra storage) +FLASH_RESERVE_START_KB 96 + +# fallback storage in case FRAM is not populated +define STORAGE_FLASH_PAGE 1 # list of files to put in ROMFS. For fmuv3 we need an IO firmware so # we can automatically update the IOMCU firmware on boot. The format diff --git a/libraries/AP_HAL_ChibiOS/hwdef/f745-bl/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/f745-bl/hwdef.dat deleted file mode 100644 index 1d7b4d3eb8..0000000000 --- a/libraries/AP_HAL_ChibiOS/hwdef/f745-bl/hwdef.dat +++ /dev/null @@ -1,50 +0,0 @@ -# hw definition file for processing by chibios_pins.py -# for f745 bootloader - -# MCU class and specific type -MCU STM32F7xx STM32F745xx - -# board ID for firmware load -APJ_BOARD_ID 254 - -# crystal frequency, setup to use external oscillator -OSCILLATOR_HZ 8000000 - -define STM32_LSECLK 32768U -define STM32_LSEDRV (3U << 3U) - -define STM32_PLLSRC STM32_PLLSRC_HSE -define STM32_PLLM_VALUE 8 -define STM32_PLLN_VALUE 432 -define STM32_PLLP_VALUE 2 -define STM32_PLLQ_VALUE 9 - -FLASH_SIZE_KB 1024 - -USB_STRING_PRODUCT "f745-BL" - -# bootloader is installed at zero offset -FLASH_RESERVE_START_KB 0 - -# the location where the bootloader will put the firmware -define FLASH_BOOTLOADER_LOAD_KB 96 - -# board voltage -STM32_VDD 330U - -UART_ORDER OTG1 - -# PA10 IO-debug-console -PA11 OTG_FS_DM OTG1 -PA12 OTG_FS_DP OTG1 - -PA13 JTMS-SWDIO SWD -PA14 JTCK-SWCLK SWD - -PA2 LED_BOOTLOADER OUTPUT HIGH -define HAL_LED_ON 0 - -define HAL_USE_EMPTY_STORAGE - -define HAL_STORAGE_SIZE 16384 -define STORAGE_FLASH_PAGE 1 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/f765-bl/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/f765-bl/hwdef.dat deleted file mode 100644 index d61711b32c..0000000000 --- a/libraries/AP_HAL_ChibiOS/hwdef/f765-bl/hwdef.dat +++ /dev/null @@ -1,46 +0,0 @@ -# hw definition file for processing by chibios_hwdef.py -# for F765 bootloader - -# MCU class and specific type -MCU STM32F7xx STM32F767xx - -# crystal frequency -OSCILLATOR_HZ 16000000 - -define STM32_LSECLK 32768U -define STM32_LSEDRV (3U << 3U) -define STM32_PLLSRC STM32_PLLSRC_HSE -define STM32_PLLM_VALUE 8 -define STM32_PLLN_VALUE 216 -define STM32_PLLP_VALUE 2 -define STM32_PLLQ_VALUE 9 - -# board ID for firmware load -APJ_BOARD_ID 50 - -FLASH_SIZE_KB 2048 - -# bootloader is installed at zero offset -FLASH_RESERVE_START_KB 0 - -# the location where the bootloader will put the firmware -define FLASH_BOOTLOADER_LOAD_KB 32 - -PC6 LED_BOOTLOADER OUTPUT HIGH -PC7 LED_ACTIVITY OUTPUT HIGH -define HAL_LED_ON 0 - -# board voltage -STM32_VDD 330U - -# order of UARTs (and USB) -UART_ORDER OTG1 - -PA11 OTG_FS_DM OTG1 -PA12 OTG_FS_DP OTG1 - -PA13 JTMS-SWDIO SWD -PA14 JTCK-SWCLK SWD - -define HAL_USE_EMPTY_STORAGE 1 -define HAL_STORAGE_SIZE 16384 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/f405-bl/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/revo-mini/hwdef-bl.dat similarity index 84% rename from libraries/AP_HAL_ChibiOS/hwdef/f405-bl/hwdef.dat rename to libraries/AP_HAL_ChibiOS/hwdef/revo-mini/hwdef-bl.dat index 36c968176f..7b89cc7954 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/f405-bl/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/revo-mini/hwdef-bl.dat @@ -5,7 +5,7 @@ MCU STM32F4xx STM32F405xx # board ID for firmware load -APJ_BOARD_ID 3 +APJ_BOARD_ID 124 # crystal frequency OSCILLATOR_HZ 8000000 @@ -13,14 +13,14 @@ STM32_PLLM_VALUE 8 FLASH_SIZE_KB 1024 -USB_STRING_PRODUCT "f405-BL" +USB_STRING_PRODUCT "ArduPilot-revo-BL" # bootloader is installed at zero offset FLASH_RESERVE_START_KB 0 # LEDs -PB9 LED_BOOTLOADER OUTPUT LOW -PA14 LED_ACTIVITY OUTPUT LOW +PB5 LED_BOOTLOADER OUTPUT LOW +PB4 LED_ACTIVITY OUTPUT LOW define HAL_LED_ON 0 # the location where the bootloader will put the firmware diff --git a/libraries/AP_HAL_ChibiOS/hwdef/revo-mini/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/revo-mini/hwdef.dat index 23cada0ff0..c66546f85c 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/revo-mini/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/revo-mini/hwdef.dat @@ -7,7 +7,7 @@ MCU STM32F4xx STM32F405xx define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_CHIBIOS_REVOMINI # board ID for firmware load -APJ_BOARD_ID 70 +APJ_BOARD_ID 124 # crystal frequency OSCILLATOR_HZ 8000000 @@ -110,9 +110,9 @@ PC9 TIM8_CH4 TIM2 PWM(8) GPIO(57) PB7 DRDY_HMC5883 INPUT PULLUP define HAL_STORAGE_SIZE 8192 -define STORAGE_FLASH_PAGE 1 +define STORAGE_FLASH_PAGE 2 -# reserve 16k for bootloader, 16k for OSD and 32k for flash storage +# reserve 32k for bootloader and 32k for flash storage FLASH_RESERVE_START_KB 64 define HAL_INS_DEFAULT HAL_INS_MPU60XX_SPI