Introduction to LEVELX

Revision as of 16:01, 23 February 2021 by Registered User

1. Introduction

LevelX is a library offering the wear leveling and bad block management features for flash memories. LevelX is not intended to provide FileSytem APIs but only, low-level API to read, write, erase sectors in flash memories. Combined with FileX, it allows seamlessly using NAND and NOR flash memories as media storage devices.

LevelX Overview

LevelX is designed in a modular way, that facilitates the support of any flash memory. In fact, LevelX requires a low-level driver interacting with the Flash memory to support the basic raw API, read blocks, write blocks, Erase blocks and check errors. These raw APIs are then logically combined to offer a more user-friendly high-level APIs. The main features offered by LevelX are:

  • Data Read/Write
  • Flash erase
  • Flash defragmentation
  • Wear leveling
  • Error checks

Further details are available in the LevelX official documentation

2. STM32 Integration

LevelX is targeting, mainly, the following types of memories:

  • NOR memories (SPI/QSPI/OSPI), making use of wear-leveling and bad block management features.
  • NAND memories, also, making use of wear-leveling and bad block management features.
  • SRAM memories: covering any MCU internal volatile memory (DTCM, AXISRAM…). This is specifically useful for fast prototyping and testing.


2.1. Known Limitations

3. How To Use

LevelX shall be used alongside with FileX. Please refer to FileX page "How To Use" section for more details about how to use LevelX

LevelX requires low-level interfaces to support the above-mentioned HW devices:

  • lx_stm32_xxx_driver_template.c/stm32_lx_xxx_driver_template.h An empty interface, provided as skeleton that can be modified by the user to support a custom flash memory.
  • lx_stm32_*_driver.c: LevelX driver patterns that are ready to use by the application. They are delivered as part of the LevelX source code. The drivers may differ between STM32 series depending on the supported features.
  • lx_stm32_*_driver_template.h: A template configuration header file to tune the corresponding driver for specific STM32 MCU/Board. This file should be copied in the application source tree and renamed to “lx_stm32_*_driver.h” then customized according to the driver needs.
LevelX LowLayer

Configuration flags can be defined by user in the “xxx_driver_template.h” file. Below LevelX driver OCTO-SPI header template file as an example:

4. STM32 LevelX Applications

To be Updated.

STM32 Packages provide the following set of applications (supported applications list may differ between products and boards):

Application Short Description
Fx_NAND_Write_Read_File Mount a file system in the NAND memory and then create, write and read back a file content.