Skip to content

Commit b89cc35

Browse files
committed
Documentation/applications/examples/elf/index.rst: Update for PR apache#3062 in nuttx-apps
Update the documentation to align with apache/nuttx-apps#3062 Signed-off-by: Laczen JMS <[email protected]>
1 parent 40c6af6 commit b89cc35

File tree

1 file changed

+16
-11
lines changed
  • Documentation/applications/examples/elf

1 file changed

+16
-11
lines changed

Documentation/applications/examples/elf/index.rst

+16-11
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,16 @@
44

55
This example builds a small ELF loader test case. This includes several test
66
programs under ``examples/elf`` tests. These tests are build using the relocatable
7-
ELF format and installed in a ROMFS file system. At run time, each program in
8-
the ROMFS file system is executed. Requires ``CONFIG_ELF``. Other configuration
9-
options:
7+
ELF format and installed in a configurable file system. At run time, the file system
8+
is mounted and each program is executed. Requires ``CONFIG_ELF``.
9+
Two distinct types of file systems are supported: internal (included in the NuttX binary)
10+
and external (not included in the binary). The external file systems need to be uploaded
11+
manually. For the internal file systems the sample supports the ``romfs`` and ``cromfs``
12+
filesystems. For the external file systems any of the provided file systems can be used
13+
(``vfat``, ...), but also the ``romfs`` filesystem for which the image (``romfs.img``) is
14+
automatically generated.
15+
16+
Configuration options:
1017

1118
- ``CONFIG_EXAMPLES_ELF_DEVMINOR`` – The minor device number of the ROMFS block
1219
driver. For example, the ``N`` in ``/dev/ramN``. Used for registering the RAM
@@ -35,28 +42,26 @@ options:
3542

3643
If you use GCC to link, you make also need to include ``-nostdlib``.
3744

38-
3. This example also requires ``genromfs``. ``genromfs`` can be build as part of the
39-
nuttx toolchain. Or can built from the ``genromfs`` sources that can be found
40-
in the NuttX tools repository (``genromfs-0.5.2.tar.gz``). In any event, the
41-
``PATH`` variable must include the path to the genromfs executable.
42-
43-
4. ELF size: The ELF files in this example are, be default, quite large because
45+
3. ELF size: The ELF files in this example are, be default, quite large because
4446
they include a lot of build garbage. You can greatly reduce the size of the
4547
ELF binaries are using the ``objcopy --strip-unneeded`` command to remove
4648
un-necessary information from the ELF files.
4749

48-
5. Simulator. You cannot use this example with the NuttX simulator on Cygwin.
50+
4. Simulator. You cannot use this example with the NuttX simulator on Cygwin.
4951
That is because the Cygwin GCC does not generate ELF file but rather some
5052
Windows-native binary format.
5153

5254
If you really want to do this, you can create a NuttX x86 buildroot toolchain
5355
and use that be build the ELF executables for the ROMFS file system.
5456

55-
6. Linker scripts. You might also want to use a linker scripts to combine
57+
5. Linker scripts. You might also want to use a linker scripts to combine
5658
sections better. An example linker script is at
5759
``nuttx/binfmt/elf/gnu-elf.ld``. That example might have to be tuned for
5860
your particular linker output to position additional sections correctly. The
5961
GNU LD ``LDELFFLAGS`` then might be::
6062

6163
LDELFFLAGS = -r -e main -T$(TOPDIR)/binfmt/elf/gnu-elf.ld
6264

65+
6. When generating the ``romfs.img`` for external filesystem the image (``romfs.img``)
66+
needs to be manually copied to the start of the configured ``CONFIG_EXAMPLES_ELF_DEVPATH``
67+
using ``openocd`` or your preferred programmer.

0 commit comments

Comments
 (0)