VxWorks 7 SDK Application Developer Guide

About

The role of the Application Developer is to create Downloadable Kernel Modules (DKMs), Real-Time Processes (RTPs), and libraries for specific VxWorks Source Code Builds (VSB) and VxWorks Image Projects (VIP). The Software Development Kit (SDK) provides developers with the tools necessary to compile, debug, and test applications and libraries.

  • RTP (Real-Time Process) – An executable application that runs in user space. RTPs operate in an isolated environment, enhancing robustness. They generate <span>.vxe</span> files that can be loaded from the file system (RomFS, NFS, SD card) or directly loaded via the WRDBG debugger.
  • DKM (Downloadable Kernel Module) – A kernel-mode application with full system and hardware access. DKMs generate <span>.out</span> files that can be statically linked to the kernel, dynamically loaded from the file system, or loaded via WRDBG.

Note: During debugging, RTP applications must use the <span>.vxe</span> extension, while DKM applications must use the <span>.out</span> extension.

Prerequisites

  • Python 3.6+
    • Linux
      sudo apt-get install python3 &amp;&amp; python3 -m pip install -U pip
    • WindowsDownload Python and select Add Python to PATH during installation.
  • • The generated SDK provided by the platform developer.

SDK Directory Structure

An example layout of a generated SDK:

WRSDK_VXWORKS-7_&lt;VIP_NAME&gt;_&lt;VSB_ARCH&gt;_&lt;HOST_TYPE&gt;_&lt;TIMESTAMP&gt;
├── bsps # BSP images and boot files
│   └── &lt;BSP_NAME&gt;
│       ├── 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 for rebuilding VSB/VIP
│   ├── &lt;VIP_PROFILE&gt;.cdf
│   └── vsb.config
├── examples # Buildable code examples
└── docs # VxWorks API and BSP documentation
    └── resources/vxworks-7

Application Development

Command Line

Command Line Prerequisites

Before building applications:

  1. 1. Ensure that the [#Prerequisites] are met.
  2. 2. Navigate to the SDK base directory.
  3. 3. Load the SDK environment to update <span>PATH</span> and environment variables:
  • Linux
    source toolkit/wind_sdk_env.linux
  • Windows
    toolkit\wind_sdk_env.bat

Compiling Applications

Application compilation follows a typical C/C++ workflow (Make, CMake).<span>examples/makefiles</span> contains example Makefiles.

Compiling RTPs
  • Using Makefile
    make
  • Not using MakefileLinux:
    $CC rtp.c -o rtp.vxe -static

    Windows:

    %CC% rtp.c -o rtp.vxe -static
Compiling DKMs
  • Using Makefile
    make
  • Not using MakefileLinux:
    $CC -dkm dkm.c -o dkm.out

    Windows:

    %CC% -dkm dkm.c -o dkm.out
Compiling CMake RTPs
  1. 1. Copy <span>Preload.cmake</span> and <span>vxsdk_toolchain.cmake</span> from <span>examples/cmakefiles</span>.
  2. 2. Create <span>CMakeLists.txt</span>.
  3. 3. Run:
    cmake -DCMAKE_TOOLCHAIN_FILE=vxsdk_toolchain.cmake .
    make

Running Applications

Running RTPs
wrdbg
file &lt;PATH_TO_RTP_APP&gt;
run

Example:

file ~/SDK/examples/hello_world/RTP/hello_world.vxe
Running DKMs
wrdbg
module load &lt;PATH_TO_DKM_APP&gt;

Check with the following command:

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 that the [#Prerequisites] are met.
  • • Complete VSCode setup.

Creating VSCode Applications

  • RTP/DKM: Right-click in Explorer → <span>New VxWorks Real Time Process</span> or <span>New VxWorks Downloadable Kernel Module</span>.
  • CMake RTPs: Right-click in Explorer → <span>New VxWorks CMake Project</span>.

Compiling VSCode Applications

  • RTPs/DKMs: Right-click on the project → <span>Build Project</span>.
  • CMake RTPs: Right-click on the project → <span>Build CMake Project</span>.

Debugging VSCode Applications

  • RTPs: Select <span>Launch RTP</span> in the debugger and run.
  • DKMs: Select <span>Launch DKM</span> and run. Execution stops initially at <span>main()</span>.

VSCode Docker Support

  • • Requires Linux SDK. On Windows, use WSL + Linux SDK.
  • • Install Remote – Containers (Windows users also need to install Remote – WSL).
  • • Reopen the SDK folder in container mode.

Starting VxWorks Target

  • Option 1: Hardware – Refer to the BSP-specific README.
  • Option 2: QEMU – If included, use the provided simulation support.

QEMU Usage

startqemu.py --smp 2 --m 512 -b

Or run from the SDK tools:

python toolkit/sdk_tools/qemu/startqemu.py

Connecting to VxWorks Target

wrdbg
target connect vxworks7:TCP:&lt;TARGET_IP&gt;:1534 -kernel &lt;PATH_TO_VXWORKS_IMAGE&gt;

Example:

target connect vxworks7:TCP:10.10.10.5:1534 -kernel ~/SDK/bsps/ti_sitara/boot/vxWorks

Inline Assembly

You can use <span>asm</span> to embed assembly code:

#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 <span>wrpython2.7</span> or <span>TCF-server</span> processes (manual cleanup required).
  • <span>wrdbg</span> cannot handle user input. For interactive applications, use serial/virtual console.

Leave a Comment