2025-05-30 4:32 AM
Hi,
I’m using the STM32U5G9J-DK1 board and working on implementing a FileX-based filesystem on the onboard eMMC.
On the first run, I format the eMMC using fx_media_format(), open the media, create a file (e.g., file1.txt), write data to it, and read it back — all of which works correctly. However, in the second run, I flash new firmware that skips the formatting step and attempts to open and read from file1.txt. In this case, although the media opens successfully and checks for the file’s existence, it returns FX_ALREADY_CREATED, but trying to open the file results in an FX_FILE_CORRUPT error.
If I do only the formatting in the first run and perform the file creation and access in the second run, everything works fine.
I’m unsure why the file becomes unreadable across firmware flashes unless the file is created again after formatting.
Thanks!
2025-05-30 7:02 AM - edited 2025-05-30 7:04 AM
Hello @Gowri_M
Did you close the media in the first run?
Could you please share your code?