VxWorks 7 SDK for UP² (Apollo Lake)

Introduction

UP² is a pro maker board based on the Intel's Apollo Lake platform.

The VxWorks 7 SDK is a development environment dedicated to VxWorks application developers which include the following features:

This guide helps you get up and running with developing applications for platforms running VxWorks. You can use it for creating new applications, or just exploration of VxWorks capabilities.

Setting up the development environment

You should start by downloading a VxWorks SDK for your platform of choice from https://labs.windriver.com and unpacking it. Refer to the documentation in docs in the unpacked SDK for additional information on creating and debugging applications.

OS requirements

The SDKs are meant to run on Linux hosts. Some of the examples in this document are specific to Debian derivatives.

Prerequisite(s)

Host dependencies

On Debian derivatives, the following packages need to be installed:

sudo apt install build-essential libc6:i386

Having an FTP server installed on your development host will make application deployment easier and allow you to access the host file system from a VxWorks target.

To accommodate for the varying runtime configurations of the VxWorks kernel images included in the SDKs, you may be interested in using an FTP server option based on pyftpdlib.

Install pyftpdlib.

sudo apt install python-pip
sudo pip install pyftpdlib

Starting a local FTP server on port 21 with user "target" and password "vxtarget" and FTP root in the current user's home can be done as follows

sudo python -m pyftpdlib -p 21 -u target -P vxTarget -i 127.0.0.1 -d $HOME

Booting VxWorks on UP²

  1. Format a USB mass storage device as a FAT32 file system and copy the EFI directory from "bsps/itl_generic_2_0_2_2/boot" to the USB drive.

  2. Make sure the target is powered down and insert the USB flash drive into the target’s USB port. Connect a display and a USB keyboard to the target.

  3. Power up the target, and observe the VxWorks UEFI boot loader on the target console while it loads the VxWorks kernel.

Once the target has booted, the VxWorks banner becomes visible on the target console.

    Target Name: vxTarget


                              VxWorks 7 SMP
            
                Copyright 1984-2018 Wind River Systems,  Inc.
            
                     Core Kernel version: 1.2.7.0
                              Build date: Aug 10 2018 13:53:49
                                   Board: x86 Processor (ACPI_BOOT_OP) SMP/SMT PAE
                               CPU Count: 4
                          OS Memory Size: ~8020MB
                        ED&R Policy Mode: Permanantly Deployed
                    
                    
                    
    Adding 9870 symbols for standalone.

    ->

For host file system access from the VxWorks guest, start an FTP server and enable user "target" with password "vxTarget".

Make a note of the IP address of your development host.

If your target has successfully completed DHCP negotiation, it will be able to access the host file system via a VxWorks remote file device.

In the vxWorks shell run the following command to create a device named "wrs".

-> netDevCreate ("wrs", "192.168.10.191", 1)

Note: Replace 192.168.10.191 with the IP address of your development host (i.e. the one on which you're running the FTP server).

Application development

Start by opening a Linux terminal window and going to the location of your unpacked VxWorks SDK.

Source the SDK environment file to update your PATH and environmental variables, gaining direct access to the tools included within the SDK.

$ source <SDK_DIR>/toolkit/wind_sdk_env.linux 

Building applications

A "hello world" C application can be built as:

$ $CC hello.c -static -o hello

Make a note of the location of your application.

Running applications

After booting VxWorks on your target, switching to the "cmd" shell will allow you to navigate to the location of your application with greater ease.

E.g.

-> cmd
[vxWorks *]# 

Placing the application in a location accessible over FTP will make it visible with minimal configuration to the VxWorks instance.

Assuming the application is located in $HOME/opt and the FTP server uses a minimal configuration which provides FTP access to $HOME:

[vxWorks *]# cd opt
[vxWorks *]# ls
opt/./hello
opt/./hello.c
[vxWorks *]# more hello.c
#include <stdio.h>

int main(int argc, char **argv) {
    printf("Hello World\n");
    return 0;
}
[vxWorks *]# hello
Launching process 'hello' ...
Process 'hello' (process Id = 0xffff8000004bb6e0) launched.
Hello World

Refer to the documentation in docs for additional information on creating and debugging applications.

Creating Rust applications

The Rust development environment is set up in a similar manner to the standard application development environment, i.e. by sourcing the SDK environment file.

E.g.

$ source <SDK_DIR>/toolkit/wind_sdk_env.linux 

Building a simple hello world Rust program

$ cargo new hello
$ cd hello
$ cargo build

This will create an RTP called hello.vxe in the directory target/vxworks-target/build-mode where vxworks-target is one of the targets listed below and build-mode is either debug or release.

For example you might see an RTP in the directory: target/armv7-wrs-vxworks-eabihf/debug/hello.vxe

VxWorks Rust targets:

Run the hello.vxe in the VxWorks shell. You will see the following output:

Hello, world!

Note: For more information on using cargo, including how to customize the build output location or change the build mode from debug to release, see the cargo documentation here https://doc.rust-lang.org/cargo/guide/.