Chapter 52. Using Yaffs with RedBoot
Table of Contents
It is possible to link Yaffs into RedBoot and use it to boot an executable image stored on a NAND array.
This is done by configuring and building RedBoot largely in the normal way.
You will need to add CYGPKG_FS_YAFFS
and
CYGPKG_IO_FILEIO
to your configuration, plus their
attendant dependencies.
The presence of CYGPKG_IO_FILEIO activates the fs
series
of RedBoot commands. The following (edited) transcript illustrates how
they might
be used in concert with other RedBoot commands to store an ELF image on
a NAND partition, load it back and execute:
RedBoot> fs mount -d onboard/0 -t yaffs /nand yaffs: restored from checkpoint RedBoot> load -r -h my.tftp.ip.address -b %{freememlo} my.image Using default protocol (TFTP) Raw file loaded 0xa013f000-0xa01554b3, assumed entry at 0xa013f000 RedBoot> fs write /nand/myimg.elf RedBoot> fs list /nand 1 drwxr-xr-x 0 size 0 . 1 drwxr-xr-x 0 size 0 .. 262 -rw-r--r-- 0 size 91316 myimg.elf 2 drwxr-xr-x 0 size 0 lost+found RedBoot> load -m file /nand/myimg.elf RedBoot> go Hello, NAND world!
Note | |
---|---|
When you command RedBoot to execute an image, it first synchronises all mounted filesystems. Therefore, provided these filesystems support the synchronisation operation (which Yaffs does), it is not always necessary to unmount them before invoking an image. |
52.1. Memory considerations under RedBoot
RedBoot traditionally has very limited requirements for memory management; the main need is for there to be free space in RAM at the correct (physical) address to load an image before jumping to it.
Introducing Yaffs brings with it not just the need to have dynamically
allocatable RAM (CYGPKG_MEMALLOC
), but enough
to replay the filesystem journal. This must be balanced against the need
for RAM to load images into.
When the CYGPKG_MEMALLOC
package is present in
RedBoot, by default a small (64k) heap is set up so that the maximum RAM
possible is available for loading images. This is not enough to
support Yaffs in any circumstances, so the following definition has
been included in the yaffs.cdl
file:
requires { CYGPKG_REDBOOT implies (CYGMEM_REDBOOT_WORKSPACE_HEAP_SIZE >= 0x00014000) }
Caution | |
---|---|
This declaration only provideds the bare minimum heap required to mount a trivial Yaffs filesystem. More will be required for all but the simplest of cases and it is recommended that you test for typical use in your environment. Refer also to Section 51.5, “Memory requirements”. |
It is recommended that, should you wish to make a filesystem usable by RedBoot, your platform HAL should make a similar declaration in its CDL to establish an appropriate heap size. For example, the platform HAL for the EA LPC2468 OEM board - which has a 128MB NAND chip on-board - contains the following declaration:
requires { (CYGPKG_REDBOOT && CYGPKG_FS_YAFFS) implies (CYGMEM_REDBOOT_WORKSPACE_HEAP_SIZE >= 0x20000) }
Tip | |
---|---|
If you wish to experiment with restricted heaps to determine
much memory your application actually uses under Yaffs,
you may find the option
|
2024-03-18 | Open Publication License |