Flash FileSystem
Implemented a File System on QSPI NOR flash
By Myung Guk Lee in Theme Features
April 29, 2024
Implmented a file system on a QSPI NOR Flash.
Azura RTOS(aka, ThreadX) provides FileX/LevelX to help develop FAT16/32 file systems on flash memory. I used this API to implement a file system for firmware running on Azura RTOS(aka, ThreadX) over QSPI NOR flash memory.
Background knowledges
- FileX : FAT-compatible file system libraries.
- LevelX : Handle NAND or NOR flash memories managment for wear-leveling to increase the memory lifetime and support multiplie instances of NAND and/or NOR pairs.
- NOR Flash memory : While NAND flash reads/writes data in pages, NOR flash reads and writes data in bytes. However, erasing is done on a sector-by-sector basis. Just like NAND flash, NOR must also erase data before writing it. Lastly, NOR Flash memory generally has a lower bit error rate than NAND flash, so Error-Correcting Code (ECC) is not required.
- QSPI : The NOR flash memory is communicated through QSPI with flash command set. QSPI inherits the basic principles of SPI - synchoronous communication with a master-slave architecture, but it boots the data transfer speed by using four data lines(quad mode) instead of SPI’s single line. This allows transferring four bits of data simulataneously. The below is the flash memory common command set. By using the command, FW can read the characteristic of the flash memory and configure it.
How to implment the file system
- Step 1: Active SPI HW block and Read SFDP(Serial Flash Discoverable - Parameter)
- Step 2: Enable QSPI mode by Sending Write Status Register command on the flash memory.
- Step 3: Initialize timer for FileX Step 4: Erase NOR flash and connect it with the flash device driver (read/write)
- Step 5: Partition and format the flash memory with the desired size.
- Step 6: Open the formated partition.
- Posted on:
- April 29, 2024
- Length:
- 2 minute read, 288 words
- Categories:
- Theme Features
- Series:
- Getting Started
- Tags:
- hugo-site
- See Also:
- Word Memorization App
- Web RTC
- SMR