From ec89ea8ac988e0026bda9d55e42209146172c254 Mon Sep 17 00:00:00 2001 From: Laurent MEUNIER Date: Tue, 28 Mar 2017 23:14:24 +0200 Subject: [PATCH] Fix L432KC compilation error --- targets/TARGET_STM/TARGET_STM32L4/flash_api.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/targets/TARGET_STM/TARGET_STM32L4/flash_api.c b/targets/TARGET_STM/TARGET_STM32L4/flash_api.c index ef08206860..ee1bc11063 100644 --- a/targets/TARGET_STM/TARGET_STM32L4/flash_api.c +++ b/targets/TARGET_STM/TARGET_STM32L4/flash_api.c @@ -74,7 +74,7 @@ static uint32_t GetPage(uint32_t Addr) static uint32_t GetBank(uint32_t Addr) { uint32_t bank = 0; - +#if defined(SYSCFG_MEMRMP_FB_MODE) if (READ_BIT(SYSCFG->MEMRMP, SYSCFG_MEMRMP_FB_MODE) == 0) { /* No Bank swap */ if (Addr < (FLASH_BASE + FLASH_BANK_SIZE)) { @@ -90,6 +90,10 @@ static uint32_t GetBank(uint32_t Addr) bank = FLASH_BANK_1; } } +#else + /* Device like L432KC */ + bank = FLASH_BANK_1; +#endif return bank; }