-
Notifications
You must be signed in to change notification settings - Fork 403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
closing the file after writing the file in 128. the error SPIFFS_ERR_DELETED (-10004) #261
Comments
I forget to add mount routine.
Test outputs;
Also, I try to change,but it doesn't change the error.
Thanks. |
I try to change a lot of configuration in the spiffs_config.h but the error doesn't change. The error constantly occurs every 128. step when I close the file after writing the file.
The error constantly occurs every 128. step when I close the file after writing the file.
|
I changed SPIFFS_SINGLETON of configuration as 0 and the error fixed. |
Hello,
When I test the below code, I get constantly the same error( SPIFFS_ERR_DELETED). The error occurs that I close the file after writing the file in 128. step.
spiffs fs;
spiffs_file fd;
fd = SPIFFS_open(&fs, "my_file", SPIFFS_CREAT | SPIFFS_TRUNC | SPIFFS_RDWR, 0);
if (fd < 0)
{
printf("errno %ld\n", SPIFFS_errno(&fs));
return;
}
// write to it
if (SPIFFS_write(&fs, fd, (u8_t *)"Test1", 6) < 0)
{
printf("errno %ld\n", SPIFFS_errno(&fs));
return;
}
// close it
if (SPIFFS_close(&fs, fd) < 0)
{
printf("errno %ld\n", SPIFFS_errno(&fs)); // SPIFFS_ERR_DELETED 128. step
return;
}
// open it
fd = SPIFFS_open(&fs, "my_file", SPIFFS_RDWR, 0);
if (fd < 0)
{
printf("errno %ld\n", SPIFFS_errno(&fs));
return;
// read it
if (SPIFFS_read(&fs, fd, (u8_t *)buf, 6) < 0)
{
printf("errno %ld\n", SPIFFS_errno(&fs));
return;
}
// close it
if (SPIFFS_close(&fs, fd) < 0)
{
printf("errno %ld\n", SPIFFS_errno(&fs));
return;
}
// check it
printf("--> %s <--\n", buf);
My Configurations;
#define SPIFFS_BUFFER_HELP 0
#define SPIFFS_CACHE 1
#define SPIFFS_CACHE_WR 1
#define SPIFFS_CACHE_STATS 1
#define SPIFFS_PAGE_CHECK 1
#define SPIFFS_GC_MAX_RUNS 5
#define SPIFFS_GC_STATS 1
#define SPIFFS_GC_HEUR_W_DELET (5)
#define SPIFFS_GC_HEUR_W_USED (-1)
#define SPIFFS_GC_HEUR_W_ERASE_AGE (50)
#define SPIFFS_OBJ_NAME_LEN (32)
#define SPIFFS_OBJ_META_LEN (0)
#define SPIFFS_COPY_BUFFER_STACK (64)
#define SPIFFS_USE_MAGIC (1)
#define SPIFFS_USE_MAGIC_LENGTH (1)
#define SPIFFS_SINGLETON 1
#define SPIFFS_CFG_PHYS_SZ(ignore) (64UL126UL1024UL)
#define SPIFFS_CFG_PHYS_ERASE_SZ(ignore) (64UL1024UL)
#define SPIFFS_CFG_PHYS_ADDR(ignore) (0x10000)
#define SPIFFS_CFG_LOG_PAGE_SZ(ignore) (256)
#define SPIFFS_CFG_LOG_BLOCK_SZ(ignore) (64UL1024UL)
#define SPIFFS_ALIGNED_OBJECT_INDEX_TABLES 1
#define SPIFFS_HAL_CALLBACK_EXTRA 0
#define SPIFFS_FILEHDL_OFFSET 0
#define SPIFFS_READ_ONLY 0
#define SPIFFS_TEMPORAL_FD_CACHE 1
#define SPIFFS_TEMPORAL_CACHE_HIT_SCORE 4
#define SPIFFS_IX_MAP 1
#define SPIFFS_NO_BLIND_WRITES 0
The text was updated successfully, but these errors were encountered: