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

Post Reply
a_ziliu
Posts: 208
Joined: 20 Mar 2017, 10:52

31 May 2021, 15:43

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();

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 6 guests