Extending SPIFFS into last page of the SPI FLASH

This commit is contained in:
Piotr Rzeszut 2024-12-26 15:04:05 +01:00
parent 825dea27a0
commit d1db0aa799
2 changed files with 4 additions and 1 deletions

View file

@ -28,6 +28,7 @@
#include "printf.h"
#include "string.h"
#include "flashmem.h"
#include "pmflash.h"
//#include <stddef.h>
//#include <unistd.h>
@ -236,7 +237,7 @@ typedef uint8_t u8_t;
// Instead of giving parameters in config struct, singleton build must
// give parameters in defines below.
#ifndef SPIFFS_CFG_PHYS_SZ
#define SPIFFS_CFG_PHYS_SZ(ignore) (1024 * 64 * (spi_flash_pages64k - 1))
#define SPIFFS_CFG_PHYS_SZ(ignore) ((1024 * 64 * spi_flash_pages64k) - (1024 * 4 * (FLASH_RESERVED_TRAILING_4K_SECTORS + 1)))
#endif
#ifndef SPIFFS_CFG_PHYS_ERASE_SZ
#define SPIFFS_CFG_PHYS_ERASE_SZ(ignore) (4*1024)

View file

@ -48,6 +48,8 @@
# define FLASH_MEM_MAX_4K_SECTOR_P(p64k) (FLASH_MEM_MAX_SIZE_P(p64k) - 4096)
#endif
#define FLASH_RESERVED_TRAILING_4K_SECTORS 10
#ifndef FLASH_MEM_ID_LEN
# define FLASH_MEM_ID_LEN 8
#endif