1. Introduction #
VxWorks is a real-time operating system (RTOS) developed by Wind River, widely used in embedded systems. U-Boot (Universal Boot Loader) is a flexible, open-source bootloader commonly used on ARM, PowerPC, and other non-x86 architectures that lack a BIOS.
While VxWorks includes its own bootloader options(namely BootROM or BootApp), U-Boot is often preferred for its extensive feature set, especially when already bundled with the target hardware.
With VxWorks 7, Wind River has significantly improved U-Boot integration compared to earlier versions (e.g., the cumbersome VxWorks 6.9 experience). This guide outlines how to use U-Boot as the bootloader for VxWorks 7, based on a real-world BSP project.
We’ll focus on using a separate Device Tree Blob (DTB) rather than embedding it within the VxWorks image, which allows runtime modifications via U-Boot without requiring a full image rebuild.
2. Building a U-Boot-Compatible VxWorks Image #
To boot VxWorks from U-Boot, the image must include a U-Boot header. You can generate this using the uVxWorks
target from Wind River Workbench or the command line.
Build Instructions #
Open a terminal and configure the environment:
cd <WIND_HOME>
wrenv -p vxworks-7
Navigate to your VxWorks Image Project (VIP):
cd <YOUR_VIP>
Build the image with U-Boot header:
vxprj vip build uVxWorks
This produces two key files for TFTP transfer:
uVxWorks
: VxWorks image with U-Boot header<yourboard>.dtb
: Device Tree Blob file
3. U-Boot Configuration for VxWorks Boot #
Set the required U-Boot environment variables to configure bootline arguments and MAC addresses.
Set Bootline (bootargs) #
setenv bootargs memac(2,0)host:vxWorks h=192.168.1.101 e=192.168.1.50:ffffff00 g=192.168.1.254 u=vxworks pw=harmonic f=0x0
saveenv
printenv bootargs
Set MAC Addresses #
setenv ethaddr 00:00:13:3a:ad:00
setenv eth1addr 00:00:13:3a:ad:01
setenv eth2addr 00:00:13:3a:ad:02
setenv eth3addr 00:00:13:3a:ad:03
saveenv
4. Loading and Booting the VxWorks Image #
Use a TFTP server to transfer the VxWorks image and DTB file to the target board.
A reliable TFTP server for Windows: TFTPD32
4.1 Load VxWorks Image #
tftp 0x100000 uVxWorks
Example output:
TFTP from server 192.168.1.101; our IP address is 192.168.1.50
Filename 'uVxWorks'.
Load address: 0x100000
Bytes transferred = 2861632 (2baa40 hex)
4.2 Load Device Tree Blob #
tftp 0xe00000 t4240qds.dtb
4.3 Boot the Image #
bootm 0x100000 - 0xe00000
Expected output:
## Booting kernel from Legacy Image at 00100000 ...
Image Name: vxWorks
Image Type: PowerPC VxWorks Kernel Image (uncompressed)
Data Size: 2861568 Bytes = 2.7 MiB
4.4 Automate with U-Boot Script #
Define a reusable U-Boot command:
setenv vxboot 'tftp 0x100000 uVxWorks; tftp 0xe00000 t4240qds.dtb; bootm 0x100000 - 0xe00000'
saveenv
To boot:
run vxboot
5. Passing MAC Addresses from U-Boot to VxWorks #
Properly passing MAC addresses from U-Boot is essential for manufacturing and deployment. Each board typically has factory-assigned MACs that must be preserved.
If you’re using a separate DTB file, U-Boot can patch the MAC addresses dynamically into the device tree at boot, avoiding the need to rebuild the DTB for each board.
Requirements #
Define Ethernet aliases in the device tree:
aliases {
ethernet0 = &enet0;
ethernet1 = &enet1;
ethernet2 = &enet2;
ethernet3 = &enet3;
};
Provide local-mac-address
placeholders in the DT nodes:
fman0: fman@400000 {
...
enet0: ethernet@e0000 {
compatible = "fsl,fman-memac";
reg = <0xe0000 0x1000>;
phy-handle = <&dummy_phy0>;
phy-connection-type = "sgmii";
cell-index = <0>;
local-mac-address = [ 00 04 9F 03 0A 5C ];
};
...
};
Ensure corresponding U-Boot environment variables (ethaddr
, eth1addr
, etc.) are set.
U-Boot will then automatically overwrite the local-mac-address
fields in the DTB before passing it to VxWorks.
Summary #
Integrating U-Boot with VxWorks 7 allows you to take advantage of a powerful, flexible bootloader that supports runtime configuration of bootlines, MAC addresses, and more. By using a separate DTB file and properly setting environment variables, you streamline board bring-up, testing, and manufacturing.