A Python interface to the Nordic FDS filesystem.
FDS is a weird flash-based filesystem developed by Nordic Semiconductor for use in storing, amongst other things, Bluetooth credentials.
This is a Python implementation to FDS. This allows manipulation of FDS images offline, on a PC, for debugging purposes, or to prepopulate a flash image with provisioning and calibration information before blasting in the image over JTAG or radio.
In the c/
subdirectory is a C version of the library, with a similar
interface. The C version uses fds.c
directly from the SDK.
-
A flash image, or the
VIRTUAL_PAGE_SIZE
parameter fromfds_config.h
orsdk_config.h
. -
Python 3
-
See
_tests()
in fds.py to see example usage. -
The general approach is to build up records in the
Fds()
object, then get the filesystem image (as bytes) from the.contents
property. -
To access the fields from a filesystem image, pass it (as bytes) to the Fds() object.
- You can build up an arbitrary number of records, and you won't know
that you are out of space until you try to access the
.contents
property.