Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[Moved] An open source lightweight embedded flash memory library

Not open for further replies.


Newbie level 1
Apr 19, 2015
Reaction score
Trophy points
Activity points
Hi everyone, I recently wrote an open source software share with everyone.
An lightweight embedded flash memory library(

Download: View attachment EasyFlash

1 EasyFlash Introduction

EasyFlash is an open source lightweight embedded flash memory library. It provide convenient application interface for MCU (Micro Control Unit). The developers can achieve more efficient and common application development based on Flash memory. The library currently provides two useful features :

  • Env(environment variables) : Let variable easily achieve power down to save. Support write balance mode . No need to worry about variable length, wear leveling and other problems.
    Use key-value model to stored variables to the Flash. You can be more simple to store setting parameters or running logs and other information which you want to power down to save.
  • IAP : online upgrade is no longer a difficult thing.
    The library encapsulates the IAP (In-Application Programming) feature common interface. Support CRC32 checksum. While supporting the bootloader and application upgrade.

1.1 File structure

Source fileDescription
\flash\src\flash_env.cEnv (normal mode) interface and implementation source code.
\flash\src\flash_env_wl.cEnv (wear leveling mode) interface and implementation source code.
\flash\src\flash_iap.cIAP interface and implementation source code.
\flash\src\flash_utils.cEasyFlash utils. For example CRC32.
\flash\src\flash.cCurrently contains EasyFlash initialization function only.
\flash\port\flash_port.cEasyFlash portable interface and configuration for different platforms.
\demo\stm32f10x\non_osstm32f10x non-os demo.
\demo\stm32f10x\rttstm32f10x demo base on RT-Thread.
\demo\stm32f4xxstm32f4xx demo base on RT-Thread.

1.2 Resource consumption

  • Minimum: ROM:6K bytes RAM:0.5K bytes +(Env size)
  • Demo :STM32F103RET6 + RT-Thread1.2.2+Env(2K bytes)
  • Actual : ROM:6K bytes RAM:2.6K bytes

1.3 Supported platforms

Hardware platform has been ported stm32f10x and stm32f4xx series of on-chip Flash. This is my product platform. Remaining platform porting difficulty is little. The porting just modify \flash\port\flash_port.c file. Implement erase, write, read, print feature.
Welcome everyone to fork and pull request(Github|OSChina|**broken link removed**). The open source software success is inseparable from everyone efforts. I hope this project will help everyone reduce product development cycle and make product to success earlier.

2 Flow

2.1 Env

The figure below shows an ENV's common interface be called by the console(terminal). The ENV "temp" from creation to save, and then modify the final delete process. These interfaces are supported by the application layer called.

2.2 IAP

The figure below shows the process of upgrade software through the console by IAP. It use this library comes with IAP function interface. Uses a serial port + Ymodem protocol mode. You can also be achieved through CAN, 485, Ethernet bus to online upgrade.

3 Documents

All documents is in the \docs\ folder.

4 License

Using GPL v3.0 open source license, please read the project LICENSE file.
Last edited by a moderator:

Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to