From de335f14d7489a751693aacd79f2a3924d675dce Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 7 Feb 2019 12:56:36 +1100 Subject: [PATCH] HAL_ChibiOS: fixed GPIO init for H7 --- libraries/AP_HAL_ChibiOS/hwdef/common/board.c | 5 +++++ libraries/AP_HAL_ChibiOS/hwdef/scripts/STM32H743xx.py | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/common/board.c b/libraries/AP_HAL_ChibiOS/hwdef/common/board.c index 21b451fb5a..59d3404ce5 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/common/board.c +++ b/libraries/AP_HAL_ChibiOS/hwdef/common/board.c @@ -169,8 +169,13 @@ static void stm32_gpio_init(void) { /* Enabling GPIO-related clocks, the mask comes from the registry header file.*/ +#if defined(STM32H7) + rccResetAHB4(STM32_GPIO_EN_MASK); + rccEnableAHB4(STM32_GPIO_EN_MASK, true); +#else rccResetAHB1(STM32_GPIO_EN_MASK); rccEnableAHB1(STM32_GPIO_EN_MASK, true); +#endif /* Initializing all the defined GPIO ports.*/ #if STM32_HAS_GPIOA diff --git a/libraries/AP_HAL_ChibiOS/hwdef/scripts/STM32H743xx.py b/libraries/AP_HAL_ChibiOS/hwdef/scripts/STM32H743xx.py index cb3af07a8a..845a515c8e 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/scripts/STM32H743xx.py +++ b/libraries/AP_HAL_ChibiOS/hwdef/scripts/STM32H743xx.py @@ -37,8 +37,8 @@ pincount = { 'G': 16, 'H': 16, 'I': 16, - 'J': 0, - 'K': 0 + 'J': 16, + 'K': 16 } # no DMA map as we will dynamically allocate DMA channels using the DMAMUX