Skip to main content

VxWorks 7 SDK Application Developer Guide

·675 words·4 mins
VxWorks 7 SDK Application Development RTP DKM QEMU VSCode
Table of Contents

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.
  • 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:

  1. Ensure prerequisites are met.
  2. Enter the base SDK directory.
  3. 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
#
  1. Copy Preload.cmake and vxsdk_toolchain.cmake from examples/cmakefiles.
  2. Create a CMakeLists.txt.
  3. 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
#

Creating VSCode Applications
#

  • RTP/DKM: Right-click in Explorer → New VxWorks Real Time Process or New VxWorks Downloadable Kernel Module.

  • CMake RTPs: Right-click in Explorer → New VxWorks CMake Project.

Project Creation

Compiling VSCode Applications
#

  • RTPs/DKMs: Right-click project → Build Project.

Project Building

  • CMake RTPs: Right-click project → Build CMake Project.

Project Creation

Debugging VSCode Applications
#

  • RTPs: Choose Launch RTP in Debugger and run.
  • DKMs: Choose Launch DKM and run. Execution stops at main() initially.

VSCode Docker Support
#

  • Requires Linux SDK. On Windows, use WSL + Linux SDK.

  • Install Remote - Containers (and Remote - WSL for Windows).

    Installing Remote Containers Extension

  • 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 or TCF-server processes running (clean up manually).
  • wrdbg cannot handle user input. For interactive applications, use the serial/virtual console.

Related

Google Test Support for VxWorks® 7: A Comprehensive Guide
·852 words·4 mins
VxWorks Google Test Unit Testing DKM RTP VxWorks 7
Deploying a VxWorks RTP as a Container to DockerHub and Raspberry Pi 4
·757 words·4 mins
VxWorks 7 RTP Container Raspberry Pi 4
Getting Started With VxWorks 7 on QEMU:Step-by-Step Guide
·558 words·3 mins
VxWorks QEMU Tutorial