Write operation using FileX and LevelX on NOR flash size is getting very slow?

Goutam Mandal 0 Reputation points
2025-09-17T10:37:31.58+00:00

Hi,

I am using W25Q64JV NOR flash of size 8MB on ST STM32U5A9ZJ board. On the flash I have created a file system using LevelX and FileX. I have enabled fault tolerant option in FileX. I am writing 128bytes of data every 500ms to a file. Initially the write operation is taking around 70-80 ms, however after some time (after around 3000 writes) the write operation occasionally is taking around 3-4 seconds. This is after every few writes. Following is the fx_media_format parameters I have used -

status = fx_media_format(&flashMedia, fx_stm32_levelx_nor_driver, reinterpret_cast<VOID *>(LX_NOR_OSPI_DRIVER_ID), reinterpret_cast<UCHAR *>(mediaMemory), sizeof(mediaMemory), "FLASH_DISK",

                              1,                  // Number of FATs

                              32,              // Directory Entries

                              0,                                                     // Hidden sectors

                              (0x800000 - 0x10000)/ 0x10000,// Total sectors minus one

                              512,                                                        // Sector size

                              8,                                                            // Sectors per cluster

                              1,                                                                          // Heads

                              1);                                                             // Sectors per track

Could you please let me know what I might to improve the performance? My goal is to complete the write operation of 128 bytes under 100ms in any circumstances. Thanks in advance.

Goutam

Azure RTOS
Azure RTOS
An Azure embedded development suite including a small but powerful operating system for resource-constrained devices.
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.