LPC5514: Flash driver init

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

LPC5514: Flash driver init

跳至解决方案
933 次查看
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 项奖励
回复
1 解答
924 次查看
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 项奖励
回复
2 回复数
925 次查看
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 项奖励
回复
911 次查看
tomofumiyasuda
Contributor I

Hi Jun,

I appreciate your kindness.

Best Regards

TY
0 项奖励
回复