USB Serial Adapters and VxWorks 7 Integration
Table of Contents
- 1. Introduction
- 2. Prerequisites
- 3. Create and Build the VxWorks Source Build (VSB) Project
- 4. Create and Build the Basic VxWorks Image Project (VIP)
- 5. Boot VxWorks on the Target and Test the USB Serial Adapter
- 6. Direct the VxWorks Console to /usb2ttyS/0
- 7. Reboot the Target with the VxWorks Console on the USB Serial Connection
1 Introduction
VxWorks is a Real Time Operating System built by Wind River. The VxWorks USB stack supports USB serial adapter devices. The target console can be accessed via the USB serial adapter.
This blog describes how to build and deploy VxWorks with serial adapter support, and direct the VxWorks console to it.
2 Prerequisites
These instructions assume that you are using:
Wind River VxWorks 7, SR0660 Intel target booting from UEFI BIOS A USB flash drive (4 GB minimum) A USB serial adapter 3 types of USB serial adapter are supported: FTDI 232 Prolific 2303 Adapters supporting the USB CDC protocol
3 Create and Build the VxWorks Source Build (VSB) Project
Open a DOS shell, configure the build environment and then build the project.
cd <WIND_HOME> // your installation directory wrenv -p vxworks-7 cd <YOUR_WORKSPACE> // your workspace vxprj vsb create adapter_vsb -bsp itl_generic -smp -force -S cd adapter_vsb // your workspace vxprj vsb add USB_CLASS // add the USB class to the VSB vxprj vsb add USB_HELPER // add the USB helper to the VSB vxprj vsb add USB_SERIAL // add the USB serial class to the VSB make -j 32 // build the VSB
4 Create and Build the Basic VxWorks Image Project (VIP)
Create the basic VxWorks image project (VIP) as follows.
cd .. vxprj create -smp itl_generic adapter_vip -profile PROFILE_INTEL_GENERIC -vsb adapter_vsb cd adapter_vip vxprj vip component add INCLUDE_MULTI_STAGE_WARM_REBOOT vxprj vip bundle add BUNDLE_STANDALONE_SHELL // add support for all supported USB serial adapters vxprj vip component add INCLUDE_USB_GEN2_SER_FTDI232 vxprj vip component add INCLUDE_USB_GEN2_SER_PL2303 vxprj vip component add INCLUDE_USB_GEN2_SER_WRS_CDC vxprj vip component add INCLUDE_USB_GEN2_SERIAL_INIT vxprj build
5 Boot VxWorks on the Target and Test the USB Serial Adapter
5.1 Deploy the UEFI Bootloader and the VxWorks kernel image
Refer to the itl_generic BSP readme file for instructions on how to build and deploy the UEFI boot loader and the VxWorks image file on the USB flash drive. Find this readme file here:
<WIND_HOME>\vxworks-7\pkgs_v2\os\board\intel\itl_generic-a.b.c.d\itl_generic_readme.md
After following these instructions to deploy the UEFI boot loader and vxWorks kernel image, you will find the following files on the USB flash drive:
EFI BOOT bootapp.sys BOOTIA32.EFI BOOTX64.EFI
5.2 Prepare the Intel target
Configure the target BIOS to boot the target from the USB flash drive.
Attach USB flash drive to the Intel target.
Attach USB serial adapter to the Intel target.
5.3 Boot the Target
Power-on the target. Once the target has booted, you will see the kernel shell prompt. You will also see a message to say that the USB serial adapter driver has been attached and device initialised.
Target Name: vxTarget VxWorks 7 SMP 32-bit Copyright 1984-2021 Wind River Systems, Inc. Core Kernel version: 3.2.0.0 Build date: Jan 31 2021 11:44:04 Board: x86 Processor (ACPI_BOOT_OP) SMP/SMT PAE CPU Count: 8 OS Memory Size: ~16224MB ED&R Policy Mode: Permanently Deployed Adding 8849 symbols for standalone. -> Find USB-to-Serial adapter device: FTDI USB-to-Serial Adapter Added new USB-to-Serial adapter device as /usb2ttyS/0 -> devs drv refs name ... 12 [ 3] /usb2ttyS/0 ... ->
6 Direct the VxWorks Console to /usb2ttyS/0
When the VxWorks console component INCLUDE_USB_GEN2_SERIAL_PCCONSOLE_INIT is added, a new device is created called /ttyUSB0 which represents /usb2ttyS/0 to the VxWorks I/O system.
vxprj vip component add INCLUDE_USB_GEN2_SERIAL_PCCONSOLE_INIT vxprj vip component add INCLUDE_USB_GEN2_HELPER vxprj vip parameter setstring CONSOLE_NAME "/ttyUSB0" // check that the console name is /ttyUSB0 vxprj vip parameter value CONSOLE_NAME CONSOLE_NAME = "/ttyUSB0" // check that the console baud rate is 9600 vxprj vip parameter value CONSOLE_BAUD_RATE CONSOLE_BAUD_RATE = (9600)
Rebuild the VxWorks kernel and deploy the image file to the target USB flash drive.
7 Reboot the Target with the VxWorks Console on the USB Serial Connection
Attach a serial cable between the target USB adapter and a serial workstation connection to access the serial VxWorks console.
Reattach the USB flash drive to the target and reboot.
-> devs drv refs name ... 3 [ 3] /ttyUSB0 ... 2 [ 3] /tyCo/1 ==> /ttyUSB0 12 [ 3] /usb2ttyS/0 ->
The VxWorks console will be available from both the PC Console and the USB serial adapter connection.