NUC230 data flash programming
Posted: 10 Nov 2017, 10:17
Hello.
I am using Nuvoton MCU for the first time.
1. I have difficulty in data Flash programming of the NUC230SE2AE.
I want to write 16bytes data in data flash(0xF000) region.
After the following code(FMC_WR) execution, the IDE(MDK-ARM V5.23) didn’t recognize the MCU in the debug menu
of the target option, and I had to replace the device(MCU) to new one.
Anybody who have experience like this issue, please help me.
uint32_t buf[4] = {0x12345678, 0, 0, 0};
#define DATA_FLASH_BASE 0xF000
unit32_t wConfig[2], rConfig[4] ;
SYS_UnlockReg();
FMC_Open();
FMC_ReadConfig(wConfig, 1);
FMC_EnableConfigUpdate();
FMC_Erase(FMC_CONFIG_BASE);
wConfig[0] &= ~0x1;
wConfig[1] = DATA_FLASH_BASE;
FMC_WriteConfig(Config, 2)
FMC_ReadDataFlashBaseAddr();
rCofig[0] = FMC_ReadUCID(0);
rCofig[1] = FMC_ReadUCID(1);
rCofig[2] = FMC_ReadUCID(2);
rCofig[3] = FMC_ReadDataFlashBaseAddr();
for (i = DATA_FLASH_BASE; i < 4; i += 4)
FMC_Write(i, *buf++);
FMC_Close();
SYS_LockReg();
All return values rConfig[0], rConfig[1], rConfig[2], rConfig[3] were 0xFFFFFFFF.
Config(0x00300000) data was attached image. 2. The other problem is
In the debug => peripherals => system viewer => GPIO
Even though I set the system viewer file(NUC200AE_v1.SFR) I can see only GPIOA.
GPIOB, GPIOC are invisible.
How can I solve these problems.
Please help me.
Best Regards
Ahndy
I am using Nuvoton MCU for the first time.
1. I have difficulty in data Flash programming of the NUC230SE2AE.
I want to write 16bytes data in data flash(0xF000) region.
After the following code(FMC_WR) execution, the IDE(MDK-ARM V5.23) didn’t recognize the MCU in the debug menu
of the target option, and I had to replace the device(MCU) to new one.
Anybody who have experience like this issue, please help me.
uint32_t buf[4] = {0x12345678, 0, 0, 0};
#define DATA_FLASH_BASE 0xF000
unit32_t wConfig[2], rConfig[4] ;
SYS_UnlockReg();
FMC_Open();
FMC_ReadConfig(wConfig, 1);
FMC_EnableConfigUpdate();
FMC_Erase(FMC_CONFIG_BASE);
wConfig[0] &= ~0x1;
wConfig[1] = DATA_FLASH_BASE;
FMC_WriteConfig(Config, 2)
FMC_ReadDataFlashBaseAddr();
rCofig[0] = FMC_ReadUCID(0);
rCofig[1] = FMC_ReadUCID(1);
rCofig[2] = FMC_ReadUCID(2);
rCofig[3] = FMC_ReadDataFlashBaseAddr();
for (i = DATA_FLASH_BASE; i < 4; i += 4)
FMC_Write(i, *buf++);
FMC_Close();
SYS_LockReg();
All return values rConfig[0], rConfig[1], rConfig[2], rConfig[3] were 0xFFFFFFFF.
Config(0x00300000) data was attached image. 2. The other problem is
In the debug => peripherals => system viewer => GPIO
Even though I set the system viewer file(NUC200AE_v1.SFR) I can see only GPIOA.
GPIOB, GPIOC are invisible.
How can I solve these problems.
Please help me.
Best Regards
Ahndy