|
NetBurner 3.5.8
PDF Version |
Example Path: examples/EFFS/Std/SystemFileSystem/MultiPartition
This example demonstrates how to create and manage multiple EFFS-STD partitions on the SOMRT1061 Application Flash. The partition table supports up to 8 partitions (0-7). By default only partition 0 exists, spanning all of Application Flash. This example splits the flash so that a guaranteed amount is reserved for NNDK system use while the rest is available for general application storage.
Why partition? With a single partition, application files and system storage share the same space. If user files fill the partition, there may not be enough free space left to update the application firmware. Creating a second partition reserves dedicated space for the system, preventing file storage from starving firmware updates.
On startup the application:
init() and starts the HTTP web server (StartHttp())| Option | Action |
|---|---|
| 1 | Create a 1 MB second partition |
| Option | Action |
|---|---|
| 1 | Show the current partition layout |
| 2 | Remove all extra partitions and restore a single partition |
After the menu action completes (or on reset/skip), the application reads the filesystem from every active partition and prints a directory tree for partition 0.
Both creating and removing partitions follow the same general cycle:
Caution: Do not cycle power while the flash is being erased or repartitioned. Interrupting this process will result in data loss.
When removing partitions, only files from partition 0 are restored. Files on secondary partitions (1-7) are discarded.
The application starts an embedded HTTP server that serves a simple page from the html/ directory (index.html, style.css, logo.jpg). Connect to the device's IP address in a browser to view it.
Platform:** SOMRT1061 only
Build with the standard NetBurner make command. The makefile automatically runs comphtml to generate src/htmldata.cpp from the files in html/ whenever they change.