NetBurner 3.5.8
PDF Version
FS_BulkStore

Example Path: examples/Configuration/Application/AppData/FS_BulkStore

Config FS BulkStore Application

Overview

This example demonstrates the config_fs_bulkstore configuration object. A bulkstore behaves like an ordinary configuration value – you read and write it through the Configuration system – but its contents are stored in a file on the EFFS Std filesystem instead of in the (size-limited) configuration blob.

That makes it useful for data that is too large for the normal config space, or that you simply do not want to consume config space with: certificates, key blobs, large JSON documents, calibration tables, and so on. The data is still managed, versioned, and persisted through the same Configuration tooling as every other config value.

What this example creates

Two bulkstore objects are declared at global scope in main.cpp:

// Fixed path: the backing file always lives at "/MyBulkStore.bin".
static config_fs_bulkstore gMyBulkStore{
appdata, "/MyBulkStore.bin", false, "MyBulkStore"};
// Movable path: the storage path itself is exposed to the Configuration
// system, so the backing file can be relocated at runtime.
static config_fs_bulkstore gMyMovableBulkStore{
appdata, "/MyMoveableBulkStore.bin", true, "MyMovableBulkStore", NULL, false};

Constructor arguments:

  • owner – the parent config object (here, the built-in appdata node)
  • fname – path of the backing file on the filesystem
  • exposePathToConfig – if true, the storage path is itself a settable config value
  • name – unique identifier within the config tree
  • desc – optional description (NULL for none)
  • keepOldFile – when the path changes, keep the old file (true) or move it (false)

Running the example

On startup the application:

  1. Initializes the EFFS Std filesystem if the platform does not provide one natively.
  2. Prints the current configuration space usage.
  3. Brings up the network stack (so the Configuration web server is reachable).
  4. Drops to the serial Configuration shell for interactive use.

You can set and read the bulkstore values two ways:

  • Configuration web UI: browse to the device's configuration server (port 20034) and edit the MyBulkStore / MyMovableBulkStore values under the appdata node. The value you enter is written to the backing file on the filesystem.
  • Serial Configuration shell: the value can also be set through the config interface over the serial port. Type help for the list of commands.

To confirm the data actually landed on the filesystem, use the file commands below.

Console commands

In addition to the standard Configuration commands, this example registers three filesystem helpers (see console_cmds.cpp):

  • cat <file_path> – print the contents of a file. For example, after setting MyBulkStore, run cat /MyBulkStore.bin to see the stored bytes.
  • rm <file_path> – delete a file from the filesystem.
  • fsls – list every file and directory on the filesystem as a tree.

Argument parsing

The example includes a small reusable command-line argument parser (argparse.cpp / argparse.h) used by the console commands. It supports positional string arguments, quoted arguments (single and double quotes), backslash escapes, and optional flags, and reports descriptive errors for missing or malformed arguments.

Build notes

  • Requires a platform with the EFFS Std filesystem (the makefile links libStdFFile and includes the shared EFFS/STD common makefile).
  • On MODM7AE70 / SBE70LC the makefile disables application memory relocation (-cflag C:3); on the ColdFire parts it reserves a 1 MB region for EFFS Std.

Example output

Config Tree Demo built at 12:34:56 on Jun 12 2026
'?' for commands
Config space used: 1024 of 65536 bytes (max)
Aborted to Serial Config (BOOT) to continue boot
type help for commands
> fsls
/
-
MyBulkStore.bin 42
> cat /MyBulkStore.bin
File length: 42
hello bulkstore
> rm /MyBulkStore.bin
>