-->
Page 1 of 1

SPIFFS fail?

PostPosted: Tue Feb 14, 2017 7:39 am
by Baoshi
Notice spiffs has been changed since 3.1.0, here is some code from spiffs_sming.c

Code: Select allspiffs_config spiffs_get_storage_config()
{
   spiffs_config cfg = {0};
   cfg.phys_addr = ( u32_t )flashmem_get_first_free_block_address();
   if (cfg.phys_addr == 0)
      return cfg;
   cfg.phys_addr &= 0xFFFFF000;  // get the start address of the sector
   cfg.phys_size = INTERNAL_FLASH_SIZE - ( ( u32_t )cfg.phys_addr);
   ...

   return cfg;
}


Now,
INTERNAL_FLASH_SIZE give me 4177920
cfg.phys_addr give me 1076109312 (0x40242000)
so cfg.phys_size becomes negative number
And subsequently a lot of spi_flash_read fails like
ERROR: ERROR in flash_read: r=1 at 40242000

Anything wrong?

Thanks

baoshi