Corrected the 4-page alignment for start of fs.
This commit is contained in:
parent
d84a24fc9a
commit
fd9113124c
|
@ -51,7 +51,7 @@ void myspiffs_mount() {
|
||||||
#else
|
#else
|
||||||
cfg.phys_addr = ( u32_t )platform_flash_get_first_free_block_address( NULL );
|
cfg.phys_addr = ( u32_t )platform_flash_get_first_free_block_address( NULL );
|
||||||
#endif
|
#endif
|
||||||
cfg.phys_addr += 0x3000;
|
cfg.phys_addr += 0x3FFF;
|
||||||
cfg.phys_addr &= 0xFFFFC000; // align to 4 sector.
|
cfg.phys_addr &= 0xFFFFC000; // align to 4 sector.
|
||||||
cfg.phys_size = INTERNAL_FLASH_SIZE - ( ( u32_t )cfg.phys_addr );
|
cfg.phys_size = INTERNAL_FLASH_SIZE - ( ( u32_t )cfg.phys_addr );
|
||||||
cfg.phys_erase_block = INTERNAL_FLASH_SECTOR_SIZE; // according to datasheet
|
cfg.phys_erase_block = INTERNAL_FLASH_SECTOR_SIZE; // according to datasheet
|
||||||
|
@ -94,7 +94,7 @@ int myspiffs_format( void )
|
||||||
#else
|
#else
|
||||||
sect_first = ( u32_t )platform_flash_get_first_free_block_address( NULL );
|
sect_first = ( u32_t )platform_flash_get_first_free_block_address( NULL );
|
||||||
#endif
|
#endif
|
||||||
sect_first += 0x3000;
|
sect_first += 0x3FFF;
|
||||||
sect_first &= 0xFFFFC000; // align to 4 sector.
|
sect_first &= 0xFFFFC000; // align to 4 sector.
|
||||||
sect_first = platform_flash_get_sector_of_address(sect_first);
|
sect_first = platform_flash_get_sector_of_address(sect_first);
|
||||||
sect_last = INTERNAL_FLASH_SIZE - SYS_PARAM_SEC_NUM;
|
sect_last = INTERNAL_FLASH_SIZE - SYS_PARAM_SEC_NUM;
|
||||||
|
|
Loading…
Reference in New Issue