HAL_ChibiOS: fixed L4 mcu type detection

This commit is contained in:
Andrew Tridgell 2023-04-12 13:53:05 +10:00 committed by Peter Barker
parent df5b2f7911
commit 3f33457404

View File

@ -762,21 +762,14 @@ def get_flash_pages_sizes():
return [ 128 ] * (get_config('FLASH_SIZE_KB', type=int)//128)
elif mcu_series.startswith('STM32F100') or mcu_series.startswith('STM32F103'):
return [ 1 ] * get_config('FLASH_SIZE_KB', type=int)
elif mcu_series.startswith('STM32L4') and mcu_type.startswith('STM32L4R'):
# STM32L4PLUS
return [ 4 ] * (get_config('FLASH_SIZE_KB', type=int)//4)
elif (mcu_series.startswith('STM32F105') or
mcu_series.startswith('STM32F3') or
mcu_series.startswith('STM32G4')):
mcu_series.startswith('STM32G4') or
mcu_series.startswith('STM32L4')):
return [ 2 ] * (get_config('FLASH_SIZE_KB', type=int)//2)
elif mcu_series.startswith('STM32L4'):
defines = get_mcu_config('DEFINES', False)
if defines is not None:
if 'STM32L4PLUS' in defines.keys():
# STM32L4PLUS
return [ 4 ] * (get_config('FLASH_SIZE_KB', type=int)//4)
else:
# STM32L4
return [ 2 ] * (get_config('FLASH_SIZE_KB', type=int)//2)
else:
return [ 2 ] * (get_config('FLASH_SIZE_KB', type=int)//2)
else:
raise Exception("Unsupported flash size MCU %s" % mcu_series)