About #
The role of the Application Developer is to create Downloadable Kernel Modules (DKMs), Real-Time Processes (RTPs), and libraries for a given VxWorks Source Build (VSB) and VxWorks Image Project (VIP).
The Software Development Kit (SDK) equips developers with the necessary tools to compile, debug, and test applications and libraries.
- RTP (Real-Time Process) – An executable application running in user space. RTPs operate in isolated environments, adding robustness. They generate
.vxe
files which can be loaded from a file system (RomFS, NFS, SD card) or directly through the WRDBG debugger. - DKM (Downloadable Kernel Module) – A kernel-mode application with full system and hardware access. DKMs generate
.out
files which can be linked statically with the kernel, dynamically loaded from a file system, or loaded via WRDBG.
Note: RTP applications must use the .vxe
extension, and DKM applications must use the .out
extension when debugging.
Prerequisites #
-
Python 3.6+
- Linux
sudo apt-get install python3 && python3 -m pip install -U pip
- Windows
Download Python and select Add Python to PATH during installation.
- Linux
-
Generated SDK provided by the Platform Developer.
SDK Directory Structure #
An example layout of a generated SDK:
WRSDK_VXWORKS-7_<VIP_NAME>_<VSB_ARCH>_<HOST_TYPE>_<TIMESTAMP>
├── bsps # BSP images and boot files
│ └── <BSP_NAME>
│ ├── boot/vxWorks
│ ├── uboot/uVxWorks, vxWorks.bin
│ └── readme/readme.md
├── toolkit # Developer tools and cross-compilers
│ ├── wind_sdk_env.linux / wind_sdk_env.bat
│ ├── host_tools
│ ├── wrdbg_tools
│ ├── sdk_tools/qemu
│ ├── bin
│ ├── compilers
│ ├── include
│ └── license
├── artifacts # Optional: artifacts to rebuild VSB/VIP
│ ├── <VIP_PROFILE>.cdf
│ └── vsb.config
├── examples # Buildable code examples
└── docs # VxWorks API & BSP docs
└── resources/vxworks-7
Application Development #
Command-line #
Command-line Prerequisites #
Before building applications:
- Ensure prerequisites are met.
- Enter the base SDK directory.
- Source the SDK environment to update
PATH
and environment variables:
- Linux
source toolkit/wind_sdk_env.linux
- Windows
toolkit\wind_sdk_env.bat
Compiling Applications #
Application compilation follows typical C/C++ workflows (Make, CMake). Example Makefiles are in examples/makefiles
.
Compiling RTPs #
-
With Makefile
make
-
Without Makefile
Linux:$CC rtp.c -o rtp.vxe -static
Windows:
%CC% rtp.c -o rtp.vxe -static
Compiling DKMs #
-
With Makefile
make
-
Without Makefile
Linux:$CC -dkm dkm.c -o dkm.out
Windows:
%CC% -dkm dkm.c -o dkm.out
Compiling CMake RTPs #
- Copy
Preload.cmake
andvxsdk_toolchain.cmake
fromexamples/cmakefiles
. - Create a
CMakeLists.txt
. - Run:
cmake -DCMAKE_TOOLCHAIN_FILE=vxsdk_toolchain.cmake . make
Running Applications #
Running RTPs #
wrdbg
file <PATH_TO_RTP_APP>
run
Example:
file ~/SDK/examples/hello_world/RTP/hello_world.vxe
Running DKMs #
wrdbg
module load <PATH_TO_DKM_APP>
Check with:
lkup "startHelloWorld"
Debugging Applications #
Debugging RTPs #
wrdbg
file ~/SDK/examples/hello_world/RTP/hello_world.vxe
See the WRDBG Reference Guide.
Debugging DKMs #
wrdbg
module load ~/SDK/examples/hello_world/DKM/hello_world.out
task create startHelloWorld
Visual Studio Code Extension #
VSCode Prerequisites #
- Ensure prerequisites are met.
- Complete the VSCode Setup.
Creating VSCode Applications #
-
RTP/DKM: Right-click in Explorer →
New VxWorks Real Time Process
orNew VxWorks Downloadable Kernel Module
. -
CMake RTPs: Right-click in Explorer →
New VxWorks CMake Project
.
Compiling VSCode Applications #
- RTPs/DKMs: Right-click project →
Build Project
.
- CMake RTPs: Right-click project →
Build CMake Project
.
Debugging VSCode Applications #
- RTPs: Choose
Launch RTP
in Debugger and run. - DKMs: Choose
Launch DKM
and run. Execution stops atmain()
initially.
VSCode Docker Support #
-
Requires Linux SDK. On Windows, use WSL + Linux SDK.
-
Install Remote - Containers (and Remote - WSL for Windows).
-
Reopen SDK folder in Container mode.
Booting a VxWorks Target #
- Option 1: Hardware – Refer to BSP-specific README.
- Option 2: QEMU – Use included emulation support if provided.
QEMU Usage #
startqemu.py --smp 2 --m 512 -b
Or run from SDK tools:
python toolkit/sdk_tools/qemu/startqemu.py
Connecting to a VxWorks Target #
wrdbg
target connect vxworks7:TCP:<TARGET_IP>:1534 -kernel <PATH_TO_VXWORKS_IMAGE>
Example:
target connect vxworks7:TCP:10.10.10.5:1534 -kernel ~/SDK/bsps/ti_sitara/boot/vxWorks
Inline Assembly #
You can embed assembly with asm
:
#include "vxWorks.h"
void main(void) {
__asm("mov ax, bx");
}
Multiple instructions:
#include "vxWorks.h"
void main(void) {
__asm("push {fp, lr}; add fp, sp, #4; mov r3, #0; mov r0, r3; pop {fp, pc};");
}
Known Limitations #
- RTP/DKM debugging may leave
wrpython2.7
orTCF-server
processes running (clean up manually). wrdbg
cannot handle user input. For interactive applications, use the serial/virtual console.