joembedded / JesFs

Jo's Embedded Serial File System (for Standard Serial NOR-Flash)
https://joembedded.de
MIT License
187 stars 37 forks source link
arm ble bluetooth bootloader ccs embedded-devices file-system filesystem flash nrf52 ota-update secure-boot simplelink spi-flash ultra-low-power

JesFs - Jo's Embedded Serial File System

for Standard (Serial) NOR-Flash

Just think of very simple things like language data: on a “very small” Embedded Device (not something “big” like an Embedded Linux, but something that can run with small batteries for years): it is commonly integrated “somewhere in the code”.
Difficult to change! But if the language data is in files, changes are easy. Same for graphics, setups, everything… It even allows to change the firmware on the Embedded Device from many different sources!

Think of Embedded Devices, that even can get their latest firmware by themselves! E.g. over WiFi, Mobile Internet, Bluetooth, UART, Radio-Link, …
Suddenly all options are open! And if you have concerns about the security: don’t worry: problem already solved, as you’ll see later..

The main problem for “very small devices” – until now – was the “File System”: everybody knows “FAT”, “NTFS”, … but have you ever thought of a file system on a small chip? Or even inside of a CPU? No problem, with the right Software. This is why I wrote

“JesFs – Jo’s Embedded Serial File System“

JesFs on LTraX

[Image: 4MB JesFs on 2x3 mm]

My daily work ist the IoT. Because I did not find any really practical solution, I decided to create my own one. “Robustness”, “Security” and “Small Footprint” were my design constraints.

JesFs was designed for use in the “Real World” and for use with standard Serial NOR-Flash memories, like the M25R-Series, used on nRF52840-DK, nRF52832 and the CC13xx/CC26xx Launchpads, which is available up to 16 MB, or even more…

Some Basics about JesFs:

  int16_t fs_open(FS_DESC *pdesc, char* pname, uint8_t flags);
  int32_t fs_read(FS_DESC *pdesc, uint8_t *pdest, uint32_t anz);
  int16_t fs_write(FS_DESC *pdesc, uint8_t *pdata, uint32_t len);
  int16_t fs_close(FS_DESC *pdesc);
  int16_t fs_delete(FS_DESC *pdesc);
  int16_t fs_rewind(FS_DESC *pdesc);
  int16_t fs_rename(FS_DESC *pd_odesc, FS_DESC *pd_ndesc);
  uint32_t fs_get_crc32(FS_DESC *pdesc);
  int16_t fs_check_disk(void cb_printf(char *fmt, ...), uint8_t *pline, uint32_t line_size);

  int16_t fs_format(uint32_t f_id);
  int16_t fs_start(uint8_t mode);
  void fs_deepsleep(void);

  int16_t fs_info(FS_STAT *pstat, uint16_t fno);
  void fs_sec1970_to_date(uint32_t asecs, FS_DATE *pd);

Changelog (JesFs_main.c)


Using JesFs – BlackBox-Demo

A Flight Recorder for Home Use

Many technical devices work reliable for years and years and no one cares about them. But if they fail, there is always the question: WHAT WENT WRONG?

This is, where the JesFs could become extremely useful.

Read more: BlackBox_Eval.pdf

Hardware

Some tested Serial-Flash Chips

Wide Voltage Range (1.6v-3.6V) and Ultra-Low-Power Standby:

Use with NRF52-CPUs:

nRF52840 nRF52832

Use with CC13xx/26xx-CPUs:

CC13xx/26xx

Installation (for NRF52 CPUs):