LPC5514: Flash driver init

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC5514: Flash driver init

Jump to solution
666 Views
tomofumiyasuda
Contributor I

Hi!

I want to determine the system clock frequency to erase or program the internal ROM.

It is describe as "Note: Flash ERASE and PROGRAM operations must be performed with a system clock below or equal to 100 MHz." in the LPC55S1x / LPC551x User manual. However, sysFreqInMHz of the FLASH_Init function(see fsl_iap.c) is configured to set only 12MHz(kSysToFlashFreq_lowInMHz) or 96MHz(kSysToFlashFreq_defaultInMHz).

status_t FLASH_Init(flash_config_t *config)
{
/* Initialize the clock to 96MHz */
config->modeConfig.sysFreqInMHz = (uint32_t)kSysToFlashFreq_defaultInMHz;
if (get_rom_api_version() == 1u)
{
return VERSION1_FLASH_API_TREE->flash_init(config);
}
else
{
return VERSION0_FLASH_API_TREE->flash_init(config);
}
}

Which setting is correct, "12MHz / 96MHz" or "100MHz or less(80MHz etc.)"?

Regards,

TY
0 Kudos
1 Solution
657 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

"Flash ERASE and PROGRAM operations must be performed with a system clock below or equal to 100 MHz." This is correct.

The SDK demo code use 96MHz FRO as system clock, so sysFreqInMHz is set as 96. If you configure 100M Hz system clock, you can set it as 100.  You could try, if you find any problem, please contact me again. I will check it further.

Have a nice day,

Jun Zhang

View solution in original post

0 Kudos
2 Replies
658 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

"Flash ERASE and PROGRAM operations must be performed with a system clock below or equal to 100 MHz." This is correct.

The SDK demo code use 96MHz FRO as system clock, so sysFreqInMHz is set as 96. If you configure 100M Hz system clock, you can set it as 100.  You could try, if you find any problem, please contact me again. I will check it further.

Have a nice day,

Jun Zhang

0 Kudos
644 Views
tomofumiyasuda
Contributor I

Hi Jun,

I appreciate your kindness.

Best Regards

TY
0 Kudos