🚀 Overview #
Booting VxWorks directly from NAND Flash offers a practical way to reduce hardware cost and board complexity in embedded systems. A 2018 study demonstrated a NAND-only boot design on Samsung’s S3C2440 ARM9 processor, using its built-in 4KB “stepping stone” SRAM. By eliminating NOR Flash entirely, the design simplified hardware while maintaining reliable system startup—an approach still relevant in 2025 for legacy ARM9 platforms and cost-sensitive products.
đź’ˇ Why Choose NAND Boot for VxWorks? #
VxWorks is widely used in communications, aerospace, and industrial systems due to its deterministic scheduling and efficient resource management. Traditionally, VxWorks boots from NOR Flash because NOR supports execute-in-place (XIP). However, NOR Flash has clear drawbacks:
- Low storage density
- Higher cost per bit
- Larger board footprint
NAND Flash, by contrast, offers higher capacity at lower cost, but it cannot execute code directly. The S3C2440 addresses this limitation with a hardware-assisted mechanism: on power-up, the processor automatically copies the first 4KB of NAND Flash into internal SRAM (the “stepping stone”) and executes from there. This makes NAND-only booting feasible without external NOR Flash.
đź§ Understanding the VxWorks Boot Flow #
A standard VxWorks boot sequence involves several stages:
- romInit (Assembly)
Disables interrupts, sets up the stack, initializes CPU registers, and jumps to C code. - romStart (C)
Copies the compressed VxWorks image to RAM, decompresses it, and transfers control to system initialization. - sysInit / usrInit
Initializes hardware, kernel objects, and user applications before launching the shell.
For NAND boot on S3C2440, this flow must be adapted. The first 4KB of code—executed from stepping stone SRAM—must initialize SDRAM and NAND access, load the full boot image into external RAM, and then continue with the normal VxWorks startup process.
đź§© Hardware Platform Overview #
The experimental setup described in the study included:
- CPU: Samsung S3C2440 (ARM920T, up to 400 MHz, 4KB internal SRAM)
- NAND Flash: Samsung K9F2G08U0B (256 MB, page/block architecture)
- SDRAM: 64 MB external memory for runtime execution
- Ethernet: DM9000 controller for networking and debugging
On reset, the S3C2440 hardware copies the first 4KB of NAND Flash into internal SRAM and begins execution, enabling a compact first-stage bootloader.
đź”§ NAND-Based Boot Sequence Design #
The complete boot process is divided into three stages:
-
Stepping Stone Bootloader (4KB)
- Initializes NAND controller
- Sets up minimal SDRAM configuration
- Loads the remaining bootloader from NAND into SDRAM
-
Full Bootloader in SDRAM
- Completes SDRAM initialization
- Copies the VxWorks image from NAND to RAM
- Jumps to the VxWorks entry point
-
VxWorks Runtime Execution
- Kernel and applications run entirely from SDRAM
Key low-level routines handle NAND page reads, bad block skipping, and basic error correction, all while respecting the tight 4KB size limit of the initial stage.
🛠️ BSP Modifications and Build Process #
To support NAND booting, the VxWorks Board Support Package (BSP) was modified:
- Added NAND and SDRAM initialization code in
romInit.s - Adjusted memory layout to match NAND Flash organization
- Ensured all first-stage code fit within the 4KB stepping stone limit
The boot image was compiled using standard VxWorks toolchains and programmed into NAND Flash via JTAG. Careful handling of NAND-specific issues—such as bad blocks and bit errors—was essential for reliable startup.
📊 Results and Practical Benefits #
Testing on the prototype board showed consistent and stable boot behavior:
- VxWorks shell available within a few seconds
- Full networking and task scheduling operational
- Approximately 20% hardware cost reduction compared to designs using both NOR and NAND
- Smaller board size due to fewer components
This approach proved especially suitable for handheld devices, communication terminals, and other space- and cost-constrained products.
đź”® Relevance in 2025 #
Although the S3C2440 is now a legacy processor, the underlying principles remain valuable. Modern systems boot from NAND-derived storage such as eMMC or UFS using similar multi-stage loaders. VxWorks 7 and newer releases continue to support flexible, RAM-based boot mechanisms inspired by these earlier designs.
For engineers maintaining legacy ARM9 systems—or designing ultra-low-cost embedded platforms—this NAND-only boot strategy remains a practical and instructive reference.