From 8f27eec24d77932304cc69a13d66ab540d3f3e25 Mon Sep 17 00:00:00 2001
From: patacongo Last Updated: May 8, 2011 Last Updated: June 29, 2012
+ The current NXFLAT release will work only with either (1) NXFLAT executable modules residing on a ROMFS file system, or (2) executables residing on other file systems provided that
+ NUTTX does not provide any general kind of file mapping capability.
+ In fact, true file mapping is only possible with MCUs that provide an MMU1.
+ Without an MMU, file system may support eXecution In Place (XIP) to mimic file mapping.
+ Only the ROMFS file system supports that kind of XIP execution need by NXFLAT.
+
+ It is also possible to simulate file mapping by allocating memory, copying the NXFLAT binary file into memory, and executing from the copy of the executable file in RAM.
+ That capability can be enabled with the
+ At present, the NXFLAT toolchain is only available for ARM and Cortex-M3/4 (thumb2) targets.
+
+ Read-only data must reside in RAM.
+ In code generated by GCC, all data references are indexed by the PIC2 base register (that is usually R10 or sl for the ARM processors).
+ The includes read-only data (
+ If a function pointer is taken to a statically defined function, then (at least for ARM) GCC will generate a relocation that NXFLAT cannot handle.
+ The workaround is make all such functions global in scope.
+ A fix would involve a change to the GCC compiler as described in Appendix B.
+
+ Callbacks through function pointers must be avoided or, when then cannot be avoided, handled very specially.
+ The reason for this is that the PIC module requires setting of a special value in a PIC register.
+ If the callback does not set the PIC register, then the called back function will fail because it will be unable to correctly access data memory.
+ Special logic is in place to handle some NuttX callbacks: Signal callbacks and watchdog timer callbacks.
+ But other callbacks (like those used with
@@ -193,43 +193,64 @@
NXFLAT
>>> Under Construction <<<
- 1.3 Limitations
-
@@ -240,7 +261,7 @@
At run time, the CONFIG_FS_RAMMAP
- is defined.
- That is because the loader depends on the capability to mmap() the code segment.
- See the NuttX User Guide for further information.
- NUTTX does not provide any general kind of file mapping capability.
- In fact, true file mapping is only possible with RTOSs and MCUs that provide an MMU1
- and only ROMFS supports that kind of XIP execution from FLASH.
- It is possible to simulate file mapping by allocating memory and copy the file into memory.
- NXFLAT would work that kind of file mapping to and that feature could easily be added to NuttX.
+
+
CONFIG_FS_RAMMAP is defined.
+ This limitation is because the loader depends on the capability to mmap() the code segment.
+ See the NuttX User Guide for further information.
+ CONFIG_FS_RAMMAP configuration option.
+ With that option enabled, NXFLAT will work that kind of file system but will require copying of all NXFLAT executables to RAM.
+
+
.rodata).
- Embedded firmware developers normally like to keep .rodata in FLASH with the code sections.
- But because all data is referenced with the PIC base register, all of that data must lie in RAM.
- A NXFLAT change to work around this is under investigation3.
+
+
.rodata).
+ Embedded firmware developers normally like to keep .rodata in FLASH with the code sections.
+ But because all data is referenced with the PIC base register, all of that data must lie in RAM.
+ A NXFLAT change to work around this is under investigation3.
+
+
qsort() must be avoided in an NXFLAT module.
+
+
qsort() must be avoided in an NXFLAT module.
+ .rodata offsets will be indexed by a RAM address.
If the dynamic loader were to offset those .rodata offsets properly, it
still might be possible to reference .rodata in ROM.
- That work around is still a top of investigation at this time.
+ That work around is still a topic of investigation at this time.