Main Page
Jim's Projects
Current Projects
Getting Started with STM32
STM32 - Using DMA for Serial Receive
LittleFS Flash File System
In the Embedded world, LittleFS is quickly being adopted as the Embedded filesystem of choice.
Although SpiFFS, has held that position for many years, it is no longer being maintained, while LittleFS is quickly being adopted.
LittleFS appears to be even more compact and has additional security in that it creates and maintains a CRC for each file, and verifies the CRC each time the file is read.
- Compact
- Power-loss resilience
- Dynamic wear leveling
- Bounded RAM/ROM
- Maintains revision count and CRC (security features)
- Well documented and available on GitHub: https://github.com/littlefs-project/littlefs
The Hardware
Using only a NUCLEO-F103RB. (Allocated the last 32K of program FLASH memory for LittleFS)
The Software
LittleFS requires three functions to interact with the FLASH memory: 1) ReadFlash 2) WriteFlash 3) EraseFlash
LittleFS requires a configuration data structure filled out so it knows about the FLASH and some rather small RAM buffers. 1) Its smallest erasable sector size 2) The smallest block size it can read 3) The smallest block size it can write It will also need some rather small RAM buffers
I put all my interface code into a separate file, littlefs_interface.c. It includes: lfs_read() - function to read STM32F103RB FLASH memory lfs_prog() - function to program / write STM32F103RB FLASH memory lfs_erase() - function to erase a STM32F103RB FLASH memory sector lfs_sync() - synchronization function - stub struct lfs_config lfs_cfg; - filled out defining the flash, buffers, and access functions
Command Line Functions
Since I enjoy using a command line interface, additional functions are included: int cl_dir(void); - Display a file system directory int cl_make_dir(void); - Make a test directory int cl_remove(void); - Remove a file / directory int cl_make_file(void); - Make a test file int cl_cat(void); - Display a file int cl_file_dump(void); - Hexadecimal dump of the file contents int cl_copy(void); - File copy int cl_rename(void); - File / directory rename ... plus a few other test functions
STM32 - How To
1.3" Color LCD Display "shield" for Raspberry Pi Pico
MicroPython on Raspberry Pi Pico
MicroPython on STM32F407G-DISC1
LittleFS Flash File System
NUCLEO-F103RB
NUCLEO-F411RE
NUCLEO-F446RE
NUCLEO-G071RB
NUCLEO-F767ZI
STM32L152-DISCO
Command Line Interface
Using Wireshark
Previous Projects
Raspberry Pi
Linux Device Drivers
Amazon Web Service - AWS
MediaWiki
Network Attached Storage - NAS
Install VNC Server - TightVNC
Install LXDE Desktop with TightVNC
Build Custom Loadable Kernel Module (LKM) for Raspberry Pi
Google AIY Project
Plex Media Server
Embedded Projects
ST7735S 80x160 0.96" SPI LCD Display Module
SSD1306_128x64 I2C OLED Display
SSD1306_128x64 SPI OLED Display
STM32L0538-DISCO
STM32F103C8 (Blue Pill)
STM32G031J6
Arduino Projects
1602 LCD using I2C Adapter
The Old Website
http://www.merkles.com/original_index.html
Questions? Suggestions? Contact me: jim@merkles.com