Skip to content
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

lfs_mkdir fails after fresh format + mount ... and works after a reset #68

Open
jacquessamoun opened this issue May 20, 2024 · 0 comments

Comments

@jacquessamoun
Copy link

Hello,

starting off from a fully erased Flash (64 Mb), one of my very first application tasks is to create a directoty hierarchy.
So i am doing:
if ((status = lfs_mount(&pctx->lfs, &local_cfg)) != LFS_ERR_OK)
{
// Format it first
status = lfs_format(&pctx->lfs, &local_cfg);
status += lfs_mount(&pctx->lfs, &local_cfg);
}
Then:
int errno = lfs_mkdir(&pctx->lfs, "files");
if (errno != LFS_ERR_EXIST && errno != LFS_ERR_OK) {
return PLATFORM_ERROR_OPEN;
}

At the very first run of the app, i will invariably get an errno == LFS_ERR_IO, then the code is exiting.
However, after a reset, the lfs_mkdir would always succeed ....

Is there anything elase i should do after format/mount so that my lfs_mkdir would succeed first place ?
Thanks
Jacques

PS: my platform is iMXRT1176 based, the flashs are QSPI interfaced, and the code itself is running out of the same flash (different location, XIP)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant