HAL_ChibiOS: set CS pins high while in bootloader

this appears to be the root cause of the parameter resets on
CubeOrange. We need to ensure the CS pin is not floating or random
noise on the SPI bus for FRAM can cause the FRAM to become corrupt
This commit is contained in:
Andrew Tridgell 2020-03-10 09:54:59 +11:00
parent b0b7acde09
commit d35fff5186
35 changed files with 233 additions and 0 deletions

View File

@ -49,3 +49,17 @@ define HAL_STORAGE_SIZE 16384
define BOOTLOADER_DEBUG SD7
# Add CS pins to ensure they are high in bootloader
PF10 ADIS16470_CS CS
PF2 RM3100_CS CS
PG6 ICM20689_CS CS SPEED_VERYLOW
PI12 ICM20649_CS CS SPEED_VERYLOW
PF3 BMI088_A_CS CS
PF4 BMI088_G_CS CS
PF5 FRAM_CS CS SPEED_VERYLOW
PG10 MS5611_IMU_CS CS
PI8 MS5611_BOARD_CS CS
PI4 EXT1_CS1 CS
PI10 EXT1_CS2 CS
PI6 EXT1_CS3 CS

View File

@ -107,3 +107,7 @@ define HAL_BOOTLOADER_TIMEOUT 1000
# reserve 256 bytes for comms between app and bootloader
RAM_RESERVE_START 256
# Add CS pins to ensure they are high in bootloader
PA4 MAG_CS CS
PA10 MS5611_CS CS

View File

@ -49,3 +49,13 @@ PA14 JTCK-SWCLK SWD
define HAL_USE_EMPTY_STORAGE 1
define HAL_STORAGE_SIZE 16384
# Add CS pins to ensure they are high in bootloader
PC1 MAG_CS CS
PC2 MPU_CS CS
PC13 GYRO_EXT_CS CS
PC14 BARO_EXT_CS CS
PC15 ACCEL_EXT_CS CS
PD7 BARO_CS CS
PE4 MPU_EXT_CS CS
PD10 FRAM_CS CS SPEED_VERYLOW

View File

@ -68,3 +68,13 @@ FLASH_BOOTLOADER_LOAD_KB 96
define HAL_USE_EMPTY_STORAGE 1
define HAL_STORAGE_SIZE 16384
# Add CS pins to ensure they are high in bootloader
PC1 MAG_CS CS
PC2 MPU_CS CS
PC13 GYRO_EXT_CS CS
PC14 BARO_EXT_CS CS
PC15 ACCEL_EXT_CS CS
PD7 BARO_CS CS
PE4 MPU_EXT_CS CS
PD10 FRAM_CS CS SPEED_VERYLOW

View File

@ -68,3 +68,11 @@ define HAL_STORAGE_SIZE 16384
# define CH_DBG_ENABLE_CHECKS TRUE
# define CH_DBG_SYSTEM_STATE_CHECK TRUE
# define CH_DBG_ENABLE_STACK_CHECK TRUE
# Add CS pins to ensure they are high in bootloader
PC2 MPU9250_CS CS
PC15 20608_CS CS
PD7 BARO_CS CS
PE15 MAG_CS CS
PH5 EEPROM_CS CS
PD10 FRAM_CS CS

View File

@ -50,3 +50,17 @@ PA14 JTCK-SWCLK SWD
define HAL_USE_EMPTY_STORAGE 1
define HAL_STORAGE_SIZE 16384
# Add CS pins to ensure they are high in bootloader
PF10 MS5611_CS CS
PF2 ICM20689_CS CS SPEED_VERYLOW
PF3 ICM20602_CS CS SPEED_VERYLOW
PF4 BMI055_G_CS CS
PG10 BMI055_A_CS CS
PF5 FRAM_CS CS SPEED_VERYLOW
PI4 EXT1_CS1 CS
PI10 EXT1_CS2 CS
PI6 EXT2_CS1 CS
PI7 EXT2_CS2 CS
PI8 EXT2_CS3 CS
PH5 TSENSE_CS CS

View File

@ -45,3 +45,8 @@ PD2 UART5_RX UART5
PC10 LED_BOOTLOADER OUTPUT LOW GPIO(0)
define HAL_LED_ON 0
# Add CS pins to ensure they are high in bootloader
PC0 MPU9250_CS CS
PA4 OSD_CS CS
PC5 BMP280_CS CS

View File

@ -43,3 +43,8 @@ define HAL_STORAGE_SIZE 16384
# location of application code
FLASH_BOOTLOADER_LOAD_KB 16
# Add CS pins to ensure they are high in bootloader
PA4 MPU_CS CS
PB12 FRAM_CS CS SPEED_VERYLOW
PE15 FLASH_CS CS

View File

@ -34,3 +34,8 @@ PA12 OTG_FS_DP OTG1
define HAL_USE_EMPTY_STORAGE 1
define HAL_STORAGE_SIZE 15360
# Add CS pins to ensure they are high in bootloader
PB14 MAX7456_CS CS
PB3 FLASH_CS CS
PC4 ICM20689_CS CS

View File

@ -46,3 +46,8 @@ define HAL_LED_ON 0
define HAL_USE_EMPTY_STORAGE 1
define HAL_STORAGE_SIZE 16384
# Add CS pins to ensure they are high in bootloader
PA4 SDCARD_CS CS
PB12 MAX7456_CS CS
PE4 ICM20689_CS CS

View File

@ -49,3 +49,8 @@ PD2 UART5_RX UART5
PA14 LED_BOOTLOADER OUTPUT LOW GPIO(0)
PA13 LED_ACTIVITY OUTPUT LOW GPIO(1) # optional
define HAL_LED_ON 0
# Add CS pins to ensure they are high in bootloader
PA4 MPU_CS CS
PC14 SDCARD_CS CS
PB12 OSD_CS CS

View File

@ -36,3 +36,9 @@ PA12 OTG_FS_DP OTG1
define HAL_USE_EMPTY_STORAGE 1
define HAL_STORAGE_SIZE 15360
# Add CS pins to ensure they are high in bootloader
PB10 MAX7456_CS CS
PC1 SDCARD_CS CS
PC0 M25P16_CS CS
PC2 MPU6000_CS CS

View File

@ -50,3 +50,9 @@ define HAL_LED_ON 0
define HAL_USE_EMPTY_STORAGE 1
define HAL_STORAGE_SIZE 16384
# Add CS pins to ensure they are high in bootloader
PC4 IMU1_CS CS
PB12 MAX7456_CS CS
PD7 IMU2_CS CS
PE11 SPARE_CS CS

View File

@ -48,3 +48,7 @@ PA14 JTCK-SWCLK SWD
define HAL_USE_EMPTY_STORAGE 1
define HAL_STORAGE_SIZE 16384
# Add CS pins to ensure they are high in bootloader
PA4 MPU_CS CS
PC7 BARO_CS CS

View File

@ -46,3 +46,10 @@ define HAL_USE_EMPTY_STORAGE
define HAL_STORAGE_SIZE 16384
define STORAGE_FLASH_PAGE 1
# Add CS pins to ensure they are high in bootloader
PA4 MPU6000_CS CS
PA15 MPU6500_CS CS
PB12 MAX7456_CS CS
PE4 SDCARD_CS CS
PA1 BMP280_CS CS

View File

@ -38,3 +38,9 @@ PA12 OTG_FS_DP OTG1
define HAL_USE_EMPTY_STORAGE 1
define HAL_STORAGE_SIZE 15360
# Add CS pins to ensure they are high in bootloader
PA4 MPU6000_CS CS
PB12 FLASH_CS CS
PA15 OSD_CS CS
PB3 BMP280_CS CS

View File

@ -46,3 +46,10 @@ define HAL_LED_ON 0
define HAL_USE_EMPTY_STORAGE 1
define HAL_STORAGE_SIZE 16384
# Add CS pins to ensure they are high in bootloader
PA4 BARO_CS CS
PA1 BARO_CS2 CS
PB12 EXT_CS CS
PA15 IMU_CS CS
PE4 SDCARD_CS CS

View File

@ -38,3 +38,9 @@ PA12 OTG_FS_DP OTG1
define HAL_USE_EMPTY_STORAGE 1
define HAL_STORAGE_SIZE 15360
# Add CS pins to ensure they are high in bootloader
PA4 ICM20689_1_CS CS
PC3 ICM20689_2_CS CS
PB12 AT7456E_CS CS
PA15 FLASH_CS CS

View File

@ -125,3 +125,7 @@ PA3 USART2_RX USART2 SPEED_HIGH NODMA
UART_ORDER
define HAL_STORAGE_SIZE 800
# Add CS pins to ensure they are high in bootloader
PA15 BARO_CS CS
PD2 MAG_CS CS

View File

@ -38,3 +38,7 @@ PA12 OTG_FS_DP OTG1
define HAL_USE_EMPTY_STORAGE 1
define HAL_STORAGE_SIZE 15360
# Add CS pins to ensure they are high in bootloader
PA4 MPU6000_CS CS
PB3 FLASH_CS CS

View File

@ -41,3 +41,9 @@ PA12 OTG_FS_DP OTG1
define HAL_USE_EMPTY_STORAGE 1
define HAL_STORAGE_SIZE 15360
# Add CS pins to ensure they are high in bootloader
PC12 E_CS0 CS
PB4 E_CS1 CS
PB5 E_CS2 CS
PB8 E_CS3 CS

View File

@ -95,3 +95,6 @@ PB6 STAY_IN_BOOTLOADER INPUT FLOATING
# reserve 256 bytes for comms between app and bootloader
RAM_RESERVE_START 256
# Add CS pins to ensure they are high in bootloader
PB0 MAG_CS CS

View File

@ -100,3 +100,6 @@ RAM_RESERVE_START 256
define HAL_CAN_DEFAULT_NODE_ID 0
define CAN_APP_NODE_NAME "org.ardupilot.ap_periph_gps"
# Add CS pins to ensure they are high in bootloader
PB0 MAG_CS CS

View File

@ -83,3 +83,13 @@ define HAL_STORAGE_SIZE 16384
# define CH_DBG_ENABLE_CHECKS TRUE
# define CH_DBG_SYSTEM_STATE_CHECK TRUE
# define CH_DBG_ENABLE_STACK_CHECK TRUE
# Add CS pins to ensure they are high in bootloader
PC1 MAG_CS CS
PC2 MPU_CS CS
PC13 GYRO_EXT_CS CS
PC14 BARO_EXT_CS CS
PC15 ACCEL_EXT_CS CS
PD7 BARO_CS CS
PE4 MPU_EXT_CS CS
PD10 FRAM_CS CS SPEED_VERYLOW

View File

@ -47,3 +47,10 @@ FLASH_BOOTLOADER_LOAD_KB 16
# bootloader loads at start of flash
FLASH_RESERVE_START_KB 0
# Add CS pins to ensure they are high in bootloader
PC2 MPU9250_CS CS
PC15 20608_CS CS
PD7 BARO_CS CS
PD10 FRAM_CS CS
PE15 MAG_CS CS

View File

@ -53,3 +53,19 @@ PA14 JTCK-SWCLK SWD
define HAL_USE_EMPTY_STORAGE 1
define HAL_STORAGE_SIZE 16384
# Add CS pins to ensure they are high in bootloader
PF10 MS5611_CS CS
PF2 ICM20689_CS CS SPEED_VERYLOW
PF3 ICM20602_CS CS SPEED_VERYLOW
PF4 BMI055_G_CS CS
PG10 BMI055_A_CS CS
PF5 FRAM_CS CS SPEED_VERYLOW
PF11 SPARE_CS CS
PH5 AUXMEM_CS CS
PI4 EXTERNAL1_CS1 CS
PI10 EXTERNAL1_CS2 CS
PI11 EXTERNAL1_CS3 CS
PI6 EXTERNAL2_CS1 CS
PI7 EXTERNAL2_CS2 CS
PI8 EXTERNAL2_CS3 CS

View File

@ -56,3 +56,11 @@ PA14 JTCK-SWCLK SWD
define HAL_USE_EMPTY_STORAGE 1
define HAL_STORAGE_SIZE 16384
# Add CS pins to ensure they are high in bootloader
PC2 ICM_20602_CS CS
PD7 BARO_CS CS
PD10 FRAM_CS CS SPEED_VERYLOW NODMA
PE15 ICM_20948_CS CS
PF10 BMI088_GYRO_CS CS
PF6 BMI088_ACCEL_CS CS

View File

@ -73,3 +73,10 @@ FLASH_BOOTLOADER_LOAD_KB 96
define HAL_USE_EMPTY_STORAGE 1
define HAL_STORAGE_SIZE 16384
# Add CS pins to ensure they are high in bootloader
PC1 MAG_CS CS #Not Connected
PC2 MPU_CS CS #MPU9250
PC15 ACCEL_CS CS #MPU20602
PD7 BARO_CS CS #MS5611
PD10 FRAM_CS CS SPEED_VERYLOW

View File

@ -47,3 +47,11 @@ PA8 LED_BOOTLOADER OUTPUT
define HAL_LED_ON 1
define HAL_STORAGE_SIZE 16384
# Add CS pins to ensure they are high in bootloader
PB2 GYRO_CS CS
PC15 BARO_CS CS
PD11 ACCEL_MAG_CS CS
PE3 MPU_CS CS
PE12 FRAM_CS CS
PE15 NRF_CS CS

View File

@ -39,3 +39,8 @@ PA12 OTG_FS_DP OTG1
define HAL_USE_EMPTY_STORAGE 1
define HAL_STORAGE_SIZE 16384
# Add CS pins to ensure they are high in bootloader
PC2 LPS22HB_CS CS
PC15 MPU6500_CS CS
PD10 FRAM_CS CS

View File

@ -38,3 +38,9 @@ PA12 OTG_FS_DP OTG1
define HAL_USE_EMPTY_STORAGE 1
define HAL_STORAGE_SIZE 15360
# Add CS pins to ensure they are high in bootloader
PA4 MPU6000_CS CS
PB12 SDCARD_CS CS
PA15 OSD_CS CS
PB3 BMP280_CS CS

View File

@ -38,3 +38,9 @@ PA12 OTG_FS_DP OTG1
define HAL_USE_EMPTY_STORAGE 1
define HAL_STORAGE_SIZE 15360
# Add CS pins to ensure they are high in bootloader
PB12 FLASH_CS CS
PA4 MPU6000_CS CS #SPI1_NSS
PA15 OSD_CS CS #SPI3_NSS
PB3 BMP280_CS CS #SPI3_NSS

View File

@ -39,3 +39,7 @@ PA12 OTG_FS_DP OTG1
define HAL_USE_EMPTY_STORAGE 1
define HAL_STORAGE_SIZE 15360
# Add CS pins to ensure they are high in bootloader
PA4 MPU_CS CS
PB3 FLASH_CS CS

View File

@ -39,3 +39,7 @@ PA12 OTG_FS_DP OTG1
define HAL_USE_EMPTY_STORAGE 1
define HAL_STORAGE_SIZE 15360
# Add CS pins to ensure they are high in bootloader
PC4 MPU_CS CS
PB3 FLASH_CS CS

View File

@ -37,3 +37,8 @@ PA12 OTG_FS_DP OTG1
define HAL_USE_EMPTY_STORAGE 1
define HAL_STORAGE_SIZE 15360
# Add CS pins to ensure they are high in bootloader
PB10 MAX7456_CS CS
PC0 FLASH_CS CS
PB11 MPU6000_CS CS