/* Maximum block read size definition */
#define TEST_LITTLEFS_READ_SIZE 16
/* Maximum block program size definition */
#define TEST_LITTLEFS_PROG_SIZE 256
/* Erasable block size definition */
#define TEST_LITTLEFS_BLOCK_SIZE 4096
/* Block count */
#define TEST_LITTLEFS_BLOCK_COUNT 1024
/* Minimum block cache size definition */
#define TEST_LITTLEFS_CACHE_SIZE 256
/* Minimum lookahead buffer size definition */
#define TEST_LITTLEFS_LOOKAHEAD_SIZE 16
extern uint32_t TEST_LITTLEFS_FLASH_START_ADDRESS[];
/*
* Name: TEST_FLASH_LITTLEFS_SECTOR_SIZE
* Description: external symbol from linker command file, it represents the size
* of a FLASH sector
*/
extern uint32_t TEST_LITTLEFS_FLASH_SECTOR_SIZE[];
/*
* Name: TEST_LITTLEFS_FLASH_MAX_SECTORS
* Description: external symbol from linker command file, it represents the sectors
* count used by the ENVM storage system; it has to be a multiple of 2
*/
extern uint32_t TEST_LITTLEFS_FLASH_MAX_SECTORS[];
static struct lfs_config Test_LittleFS_config = {
.context = (void*)&Test_LittleFS_ctx,
.read = test_lfs_mflash_read,
.prog = test_lfs_mflash_prog,
.erase = test_lfs_mflash_erase,
.sync = test_lfs_mflash_sync,
#ifdef LFS_THREADSAFE
.lock = test_lfs_mflash_lock,
.unlock = test_lfs_mflash_unlock,
#endif
.read_size = TEST_LITTLEFS_READ_SIZE,
.prog_size = TEST_LITTLEFS_PROG_SIZE,
.block_size = TEST_LITTLEFS_BLOCK_SIZE,
.block_count = TEST_LITTLEFS_BLOCK_COUNT,
.block_cycles = 100,
.cache_size = TEST_LITTLEFS_CACHE_SIZE,
.lookahead_size = TEST_LITTLEFS_LOOKAHEAD_SIZE
};
.....
Step 4
TEST_LITTLEFS INIT
- Call the lfs_t * test_lfs_init(void) function in the test_littlefs.c file to attempt initialization.
- Call the lfs_mount function and observe that an error occurs in the return result.
Regards,
hclee.