levelx
v6.4.1_relFeatures
-
Support for both NAND and NOR flash memory types with specialized management modules.
-
Wear leveling algorithms that distribute flash usage evenly to extend hardware longevity.
-
Logical-to-physical sector mapping for transparent application and file system access.
-
Fault-tolerant design using a multi-step update process to ensure recovery after power loss.
-
Seamless integration with the FileX FAT-compatible file system for flash-based storage.
-
Standalone mode support allowing operation without the ThreadX RTOS.
-
Configurable NOR flash direct read option to bypass driver routines for higher performance.
-
Extended cache support for NOR flash to improve sector access and mapping speeds.
-
Logical sector mapping cache with configurable sizes to balance memory use and performance.
-
Thread-safe operation through optional integration with ThreadX mutex objects.
-
NAND flash metadata block management with configurable allocation limits.
-
Free sector data verification logic to ensure NOR flash integrity during initialization.
-
Mapping bitmap support in extended cache for efficient physical sector tracking.
-
Obsolete count cache for NOR flash to optimize garbage collection and erase cycles.
-
Customizable logical sector sizes for NOR flash to match specific application requirements.
-
User-definable extensions for NAND and NOR flash control blocks for custom metadata.
LevelX acts as a middleware layer between an application (or file system like FileX) and the underlying flash hardware driver. Its primary responsibility is to manage the physical constraints of flash memory, specifically the finite number of erase cycles and the requirement to erase blocks before rewriting. It implements a logical-to-physical mapping system where the application sees a contiguous array of logical sectors, while LevelX manages their actual placement on the physical media.
The architecture is designed for robustness; flash updates are performed in discrete steps, allowing the system to recover to a consistent state if interrupted by power failure. It includes specific modules for NAND and NOR flash, reflecting their different operational characteristics, such as block-based versus word-based access and the handling of spare areas in NAND devices.
Core Components
- NOR Management: Handles word-aligned access, sector mapping, and optional extended caching mechanisms.
- NAND Management: Manages block-based access, spare area/metadata, and bad block management.
- Mapping Layer: Translates logical sector addresses to physical flash offsets using internal tables.
- Cache Engine: Provides optional sector mapping and data caching to reduce physical I/O overhead.
- Driver Interface: Standardized API for hardware-specific flash drivers to perform read, write, and erase operations.
Use Cases
This library is ideal for:
- Data Logging: Systems requiring frequent writes to flash memory where wear leveling is critical to prevent premature hardware failure.
- Embedded File Systems: Providing a reliable backend for FileX or other FAT-based systems on raw NAND/NOR flash chips.
- Fault-Tolerant Storage: Applications operating in unstable power environments where data integrity during write operations is paramount.
- Resource-Constrained Devices: Deeply embedded systems needing a small-footprint wear leveling solution without the overhead of a full OS.
Getting Started
To integrate LevelX, developers should first clone the repository recursively and include the common directory in their build system. Configuration is handled via the lx_user.h file (based on the provided lx_user_sample.h), where features like LX_THREAD_SAFE_ENABLE or LX_STANDALONE_ENABLE can be defined. For CMake-based projects, LevelX can be added using add_subdirectory() and linked against the application target. Detailed API documentation for NAND and NOR operations, including driver implementation requirements, can be found in the official LevelX documentation.
Related Projects (9)
X-CUBE-AZRTOS-F4 Azure RTOS Software Expansion for STM32Cube
A comprehensive software expansion package for the STM32F4 series that integrates the Microsoft Azure RTOS suite into the STM32Cube ecosystem. It provides a full middleware stack including ThreadX, NetXDuo, FileX, LevelX, and USBX, optimized for STM32 microcontrollers.
X-CUBE-AZRTOS-F7 Azure RTOS Software Expansion for STM32Cube
A comprehensive software expansion package that integrates the Microsoft Azure RTOS suite with the STM32F7 series of microcontrollers. It provides a full middleware stack including ThreadX, NetXDuo, FileX, LevelX, and USBX, along with ready-to-run examples for STM32F7 evaluation boards.
X-CUBE-AZRTOS-G0: Azure RTOS Software Expansion for STM32Cube
A comprehensive software expansion package for the STM32G0 series, integrating Microsoft Azure RTOS into the STM32Cube ecosystem. It provides a full suite of middleware including ThreadX, NetXDuo, FileX, LevelX, and USBX, along with hardware-specific drivers and ready-to-run examples for evaluation boards.
X-CUBE-AZRTOS-G4 Azure RTOS Software Expansion for STM32Cube
A comprehensive software expansion package that integrates the Microsoft Azure RTOS suite into the STM32Cube ecosystem for STM32G4 microcontrollers. It provides a full middleware stack including ThreadX, NetXDuo, FileX, LevelX, and USBX, along with hardware-specific porting and ready-to-run examples.
X-CUBE-AZRTOS-H7 Azure RTOS Software Expansion
A comprehensive software expansion package for the STM32Cube ecosystem that integrates the Microsoft Azure RTOS suite with STM32H7 microcontrollers. It provides a full middleware stack including ThreadX, NetXDuo, FileX, LevelX, and USBX, along with hardware-specific drivers and ready-to-run examples for evaluation boards.
X-CUBE-AZRTOS-L4 Azure RTOS Software Expansion for STM32Cube
A comprehensive software expansion package for STM32Cube that integrates Microsoft Azure RTOS with the STM32L4 series of microcontrollers. It includes middleware components like ThreadX, NetXDuo, FileX, LevelX, and USBX, along with ready-to-run examples for evaluation boards.
X-CUBE-AZRTOS-L5: Azure RTOS Software Expansion for STM32Cube
A comprehensive software expansion for the STM32Cube ecosystem that integrates Microsoft Azure RTOS with the STM32L5 series of microcontrollers. It provides a full suite of middleware including ThreadX, NetXDuo, FileX, LevelX, and USBX, along with ready-to-run examples for evaluation boards.
X-CUBE-AZRTOS-WB Azure RTOS Software Expansion for STM32Cube
A comprehensive software expansion package for the STM32Cube ecosystem that integrates Microsoft Azure RTOS for the STM32WB series of microcontrollers. It provides a full suite of middleware including ThreadX, NetXDuo, FileX, LevelX, and USBX, along with hardware-specific drivers and ready-to-run examples.
X-CUBE-AZRTOS-WL: Azure RTOS Software Expansion for STM32WL
A comprehensive software expansion package integrating Microsoft Azure RTOS with the STM32Cube ecosystem for STM32WL microcontrollers. It provides a full suite of industrial-grade middleware including ThreadX, NetXDuo, FileX, and LevelX, optimized for low-power wireless IoT development.