Page 1 of 1

Can FMC instructions be used to adjust the Data Flash size in the program?

Posted: 31 May 2021, 15:43
by a_ziliu
For the NuMicro® series that can set the Data Flash size, user can modify DFEN (Config0 [0]) to enable or disable Data Flash, and modify DFBADR (Config1) to set the base address of Data Flash and adjust the Data Flash size.
After the setting, the program needs to write 1 to CHIPRST (SYS_IPRST0 [0]) for software chip reset. With software chip reset, the new setting will take effect.

Sample code is as follows:
uint32_t au32Config[2];

SYS_UnlockReg();
FMC_Open();
FMC_ReadConfig(au32Config, 2);
FMC_ENABLE_CFG_UPDATE();
au32Config[0] &= ~0x1;
au32Config[1] = u32DFBA;
FMC_WriteConfig(au32Config, 2)
SYS_ResetChip();