2026-02-02 9:28 AM
Hi,
I’m working with a custom PCB based on an STM32H743BI and an external MT25TL01G memory device.
To manage the data I’m using FileX + LevelX. I’m able to create the media, create directories, create files, write to them, and read them without issues. However, I’m running into a problem when trying to read files after a reset.
After formatting the media with:
fx_media_format(&pFileManagerDesc->fxFileMedia,
fx_stm32_levelx_nor_driver,
(VOID *)LX_NOR_QSPI_DRIVER_ID,
(UCHAR *) mediaBuffer,
sizeof(mediaBuffer),
QSPI_VOLUME_NAME,
QSPI_NUMBER_OF_FATS,
32,
QSPI_HIDDEN_SECTORS,
((LX_STM32_QSPI_FLASH_SIZE - LX_STM32_QSPI_SECTOR_SIZE) / QSPI_SECTOR_SIZE),
QSPI_SECTOR_SIZE,
8,
1,
1); I open the media and try to read from it, but I always the error FX_NO_FOUND trying to open the file.
This doesn’t happen if I create a file first. I’m not sure if I’m missing a step before reading the media after formatting.
I’m not performing any erase operation because I have: LX_STM32_QSPI_ERASE set to 0
Thanks!
Solved! Go to Solution.
2026-02-04 6:46 AM
Hello @JonConesa
After a reset, you must not call fx_media_format() again, because it recreates the FAT filesystem and effectively erases all existing files (their directory entries and allocation info are lost, so fx_file_open() returns FX_NOT_FOUND). The correct approach is to call fx_media_format() only once, then on every subsequent boot/reset simply call fx_media_open() to mount the existing volume and access your files.
2026-02-04 6:46 AM
Hello @JonConesa
After a reset, you must not call fx_media_format() again, because it recreates the FAT filesystem and effectively erases all existing files (their directory entries and allocation info are lost, so fx_file_open() returns FX_NOT_FOUND). The correct approach is to call fx_media_format() only once, then on every subsequent boot/reset simply call fx_media_open() to mount the existing volume and access your files.
2026-02-04 7:26 AM
@JonConesa - what @Saket_Om said is described here.
2026-02-16 4:57 AM
Hi @Saket_Om,