hello
my m058 is no OS, W/R dataflash Success,But there is one problem:write dataflash many times the m058 will crash .please,how solve this problem?
Code as follows:
int32_t FMC_WriteData(uint32_t *u32Config, uint32_t u32Count,uint32_t page)
{
int32_t i;
__set_PRIMASK(1);
SYS_UnlockReg();
FMC_Open();//Enable FMC ISP function
FMC_EnableLDUpdate();
FMC_Erase(FMC_DATAFLASH_BASE + page * PAGE_SIZE);
for(i = 0; i < u32Count; i++)
{
FMC_Write(FMC_DATAFLASH_BASE + page * PAGE_SIZE + i * 4, u32Config);
if(FMC_Read(FMC_DATAFLASH_BASE + page * PAGE_SIZE + i * 4) != u32Config)
return -1;
}
FMC_Close();//Disable ISP Functions
SYS_LockReg();
__set_PRIMASK(0);
return 0;
}
m058 write dataflash many times will crash
-
- Posts: 2
- Joined: 15 Aug 2019, 18:48
#define PAGE_SIZE 512
#define FMC_DATAFLASH_BASE 0x0001F000
#define DATAFLASH_SIZE 0x00001000
#define FMC_DATAFLASH_BASE 0x0001F000
#define DATAFLASH_SIZE 0x00001000
-
- Information
-
Who is online
Users browsing this forum: No registered users and 17 guests