From 1b9531d1af328d5e1efe42aeb7f1f91f6e100c8f Mon Sep 17 00:00:00 2001 From: Mahesh Mahadevan Date: Wed, 27 Mar 2019 15:36:08 -0500 Subject: [PATCH] LPC55S69: Update Flash driver to set clock frequency This is to ensure the flash access time is set correctly Signed-off-by: Mahesh Mahadevan --- .../TARGET_MCUXpresso_MCUS/TARGET_LPC55S69/flash_api.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC55S69/flash_api.c b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC55S69/flash_api.c index 8351056086..fc271b94c1 100644 --- a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC55S69/flash_api.c +++ b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC55S69/flash_api.c @@ -65,6 +65,9 @@ static int32_t flash_check_nonsecure(flash_t *obj, uint32_t start_addr, uint32_t MBED_NONSECURE_ENTRY int32_t flash_init(flash_t *obj) { + /* Set the clock frequency to prevent from ROM changing the Flash access time */ + flash_config.modeConfig.sysFreqInMHz = SystemCoreClock / 1000000; + if (FLASH_Init(&flash_config) != kStatus_Success) { return -1; } else {