From 9966fbea0fe74a154f84a1a3d865a638c0db5a7a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 20 Feb 2019 17:35:10 +1100 Subject: [PATCH] HAL_ChibiOS: fixed bootloader build error --- libraries/AP_HAL_ChibiOS/hwdef/common/malloc.c | 13 +++++++------ .../AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/common/malloc.c b/libraries/AP_HAL_ChibiOS/hwdef/common/malloc.c index 5e9fd46509..faf7a8ab22 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/common/malloc.c +++ b/libraries/AP_HAL_ChibiOS/hwdef/common/malloc.c @@ -34,11 +34,10 @@ #define MEM_REGION_FLAG_DMA_OK 1 #define MEM_REGION_FLAG_FAST 2 -static struct memory_region { +static const struct memory_region { void *address; uint32_t size; uint32_t flags; - memory_heap_t heap; } memory_regions[] = { HAL_MEMORY_REGIONS }; // the first memory region is already setup as the ChibiOS @@ -47,6 +46,8 @@ static struct memory_region { #if CH_CFG_USE_HEAP == TRUE +static memory_heap_t heaps[NUM_MEMORY_REGIONS]; + #define MIN_ALIGNMENT 8 #if defined(STM32H7) @@ -70,7 +71,7 @@ static memory_heap_t dma_reserve_heap; void malloc_init(void) { for (uint8_t i=1; i