From b8a77890b60ccf631d3a0a41b5328859c0fde38b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 23 Sep 2019 08:50:57 +1000 Subject: [PATCH] HAL_ChibiOS: generate HAL_MEMORY_TOTAL_KB for each board --- libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py index 4377159879..f2d86220db 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py +++ b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py @@ -596,9 +596,12 @@ def write_mcu_config(f): ram_map = get_mcu_config('RAM_MAP', True) f.write('// memory regions\n') regions = [] + total_memory = 0 for (address, size, flags) in ram_map: regions.append('{(void*)0x%08x, 0x%08x, 0x%02x }' % (address, size*1024, flags)) + total_memory += size f.write('#define HAL_MEMORY_REGIONS %s\n' % ', '.join(regions)) + f.write('#define HAL_MEMORY_TOTAL_KB %u\n' % total_memory) f.write('\n// CPU serial number (12 bytes)\n') f.write('#define UDID_START 0x%08x\n\n' % get_mcu_config('UDID_START', True))