From 94bace91a475ad4633c25119506fdb8866adbf7e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 18 Feb 2019 21:38:02 +1100 Subject: [PATCH] HAL_ChibiOS: bring up sensors rail after boot on TBS F7 this prevents a reset loop on GPIO config --- libraries/AP_HAL_ChibiOS/hwdef/TBS-Colibri-F7/hwdef.dat | 5 +++-- libraries/AP_HAL_ChibiOS/hwdef/common/stm32_util.c | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/TBS-Colibri-F7/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/TBS-Colibri-F7/hwdef.dat index f23b727018..c22c8a01c3 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/TBS-Colibri-F7/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/TBS-Colibri-F7/hwdef.dat @@ -10,8 +10,7 @@ STM32_ST_USE_TIMER 5 # enabling PE3 on the Colibri causes it to reset on startup undef PE3 -undef VDD_3V3_SENSORS_EN -PE3 DUMMY_PE3 INPUT +PE3 VDD_3V3_SENSORS_EN OUTPUT LOW # order of UARTs (and USB). Telem2 is UART4 on the mini, USART3 is not available UART_ORDER OTG1 USART1 USART2 UART4 USART6 UART7 @@ -38,6 +37,8 @@ PB3 TIM2_CH2 TIM2 PWM(10) GPIO(59) PB11 TIM2_CH4 TIM2 PWM(11) GPIO(60) # RCInput on the PPM pin, for all protocols +undef PG9 +undef USART6_RX PI5 TIM8_CH1 TIM8 RCININT PULLUP LOW # setup for supplied power brick diff --git a/libraries/AP_HAL_ChibiOS/hwdef/common/stm32_util.c b/libraries/AP_HAL_ChibiOS/hwdef/common/stm32_util.c index 15bf86891e..4476a455d3 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/common/stm32_util.c +++ b/libraries/AP_HAL_ChibiOS/hwdef/common/stm32_util.c @@ -262,7 +262,7 @@ void set_fast_reboot(enum rtc_boot_magic v) */ void peripheral_power_enable(void) { -#if defined(HAL_GPIO_PIN_nVDD_5V_PERIPH_EN) || defined(HAL_GPIO_PIN_nVDD_5V_HIPOWER_EN) +#if defined(HAL_GPIO_PIN_nVDD_5V_PERIPH_EN) || defined(HAL_GPIO_PIN_nVDD_5V_HIPOWER_EN) || defined(HAL_GPIO_PIN_VDD_3V3_SENSORS_EN) // we don't know what state the bootloader had the CTS pin in, so // wait here with it pulled up from the PAL table for enough time // for the radio to be definately powered down @@ -277,6 +277,10 @@ void peripheral_power_enable(void) #ifdef HAL_GPIO_PIN_nVDD_5V_HIPOWER_EN palWriteLine(HAL_GPIO_PIN_nVDD_5V_HIPOWER_EN, 0); #endif +#ifdef HAL_GPIO_PIN_VDD_3V3_SENSORS_EN + // the TBS-Colibri-F7 needs PE3 low + palWriteLine(HAL_GPIO_PIN_VDD_3V3_SENSORS_EN, 1); +#endif #endif }