Build Flash Image
An application may contains not only the executable binary, but also contains one or even severl filesystems, some backups (bin and files), RAW DATAs, etc.
After the compilation, we need to put them together, to create a flash image for the embedded flash, and another for the external flash (optional). Then these flash images can be flashed directly during the production.
Furthermore, these features below can be added/applicated on a flash image, or part of it at the first time or update over the air (OTA):
Volumes management/update
Partitions management/update
Partition/section encryption
These features are supported by SSBL (second stage boot loader), for more details, please read the SSBL/FOTA specification.
This doc will introduce you how to create a flash image with or without these features.
How to build a flash image
Compile and build the flash image:
make image
How to add a readFS (read only file system)
In Makefile:
In Makefile, you just need to add in your Makefile:
READFS_FILES = <the files path>
If you have multifiles, you just need to separate them with space.
In Cmake: TODO
How to add a littleFS
In Makefile:
LFS_ROOT_DIR = <The path of the root directory>
Then the littleFS will build the image with this directory and all the files in this directory. The total LFS size will be controlled by the property of lfs section.
How to build an image based on a custom layout
The user can custom a layout by edit an json file, like the full_app_layout.json in utils/ssbl/test_applications/full_app
For more details about each sections and partitions, please check the SSBL doc.
Once the layout is ready, we can add it into makefile to let the gapy take it into account:
runner_args += --flash-content=<layout file name>@mram
BEWARE, this support only mram for now.
Then run make image
to create the image.