LPC55S69: Update Flash driver to set clock frequency

This is to ensure the flash access time is set correctly

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
pull/10246/head
Mahesh Mahadevan 2019-03-27 15:36:08 -05:00
parent 1549c5c425
commit 1b9531d1af
1 changed files with 3 additions and 0 deletions

View File

@ -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 {