|
我一般从4M区前面开始存(4M区的最后16k不能存)
uint16 flash_begin_add = 0x300;
uint32 flash_add = flash_begin_add + (currentDataPoint.valuearray-1)*4; //currentDataPoint.valuearray:N组定时任务
spi_flash_erase_sector(flash_add); //擦扇区
spi_flash_write((uint32)(flash_add * 4096), (uint32 *)¤tDataPoint, sizeof(currentDataPoint)); //存数据
|
|