+ All Categories
Home > Documents > LEON VxWorks-5.4 BSP - Gaislergaisler.com/anonftp/vxworks/readme-vxworks-5.4-1.0.2.pdfVXWORKS-5.4 3...

LEON VxWorks-5.4 BSP - Gaislergaisler.com/anonftp/vxworks/readme-vxworks-5.4-1.0.2.pdfVXWORKS-5.4 3...

Date post: 21-Mar-2018
Category:
Upload: doquynh
View: 231 times
Download: 7 times
Share this document with a friend
16
LEON VxWorks-5.4 BSP Getting started with LEON BSP under VxWorks version 5.4 VXWORKS-5.4 Version 1.0.2 Written by Daniel Hellström November 2006 Första Långgatan 19 tel +46 31 7758650 413 27 Göteborg fax +46 31 421407 Sweden www.gaisler.com
Transcript
Page 1: LEON VxWorks-5.4 BSP - Gaislergaisler.com/anonftp/vxworks/readme-vxworks-5.4-1.0.2.pdfVXWORKS-5.4 3 1 INTRODUCTION This document is intended as an aid in starting developing with LEON

LEON VxWorks-5.4 BSP

Getting started with LEON BSP under VxWorks version 5.4 VXWORKS-5.4Version 1.0.2

Written by Daniel Hellström November 2006

Första Långgatan 19 tel +46 31 7758650413 27 Göteborg fax +46 31 421407Sweden www.gaisler.com

Page 2: LEON VxWorks-5.4 BSP - Gaislergaisler.com/anonftp/vxworks/readme-vxworks-5.4-1.0.2.pdfVXWORKS-5.4 3 1 INTRODUCTION This document is intended as an aid in starting developing with LEON

VXWORKS-5.4 2

Table of Contents

1 INTRODUCTION....................................................................................................31.1 Content.....................................................................................................................31.2 LEON2/3 peripherals...............................................................................................31.3 Support.....................................................................................................................3

2 INSTALLATION.....................................................................................................4

3 PROJECT CREATION............................................................................................5

4 PROJECT CONFIGURATION...............................................................................64.1 Boot loader configuration........................................................................................64.2 Memory configuration.............................................................................................64.2.1 Base address.............................................................................................................74.2.2 Memory Size............................................................................................................74.2.3 Default kernel boot argument...................................................................................74.3 Component selection................................................................................................74.4 Component configuration.........................................................................................8

5 BUILDING PROJECT...........................................................................................10

6 SUPPORT..............................................................................................................11

7 EXAMPLES...........................................................................................................127.1 Simple network example, using ping utility..........................................................127.2 Connecting to GR-XC3S with WindView using WBD over Ethernet..................13

Page 3: LEON VxWorks-5.4 BSP - Gaislergaisler.com/anonftp/vxworks/readme-vxworks-5.4-1.0.2.pdfVXWORKS-5.4 3 1 INTRODUCTION This document is intended as an aid in starting developing with LEON

VXWORKS-5.4 3

1 INTRODUCTION

This document is intended as an aid in starting developing with LEON base platforms using the LEON VxWorks-5.4 BSP. It briefly takes the reader through some of the most important steps in the software development process such as installing the BSP, creating, configuring and building a project using the LEON BSP. There is also examples at the end of the document.

1.1 Content

This CD contains a board support package (BSP) for LEON2 and LEON3 processors to be used with Wind River VxWorks-5.4 operating system. The BSP includes drivers for the following functions:• Interrupt controller• UART 1 & 2• Timer unit• GRETH 10/100 Ethernet MAC (LEON3 only)• LAN91C111 10/100 Ethernet MAC• GRSPW SpaceWire MAC (LEON3 only)

The BSP is intended to be used with the Windows version of Tornado-2.0 workbench. It is assumed that a working Tornado-2.0 workbench is already installed.

The final executable will run on both LEON2 and LEON3/GRLIB processors without requiring any specific configuration.

1.2 LEON2/3 peripherals

The LEON2 on-chip peripherals are assumed to reside in the default address as defined in the LEON2 VHDL model. Also the interrupt assignment of UART and Timer are assumed to retain there default values. For LEON3 systems, the address and interrupt is read from the on-chip plug&play information, and assigned at run-time.

1.3 Support

For support, contact the Gaisler Research support team at [email protected]

Page 4: LEON VxWorks-5.4 BSP - Gaislergaisler.com/anonftp/vxworks/readme-vxworks-5.4-1.0.2.pdfVXWORKS-5.4 3 1 INTRODUCTION This document is intended as an aid in starting developing with LEON

VXWORKS-5.4 4

2 INSTALLATION

It is assumed that a working Tornado-2.0 workbench is already installed.

The BSP is installed by unpacking the BSP file (tornado-2.0-leon_sparcv8.zip) inside the Tornado-2.0 top-level directory, e.g. C:/Tornado. WinZip or the Windows XP unzip utility should be used to unpack the file.

Page 5: LEON VxWorks-5.4 BSP - Gaislergaisler.com/anonftp/vxworks/readme-vxworks-5.4-1.0.2.pdfVXWORKS-5.4 3 1 INTRODUCTION This document is intended as an aid in starting developing with LEON

VXWORKS-5.4 5

3 PROJECT CREATION

A LEON2/3 kernel is made by creating a new project in the Tornado workbench, complete step one by entering workspace and project name, in step two select 'Create from BSP', and the click on 'leon_sparcv8':

The project is configured as any other VxWorks target.

Page 6: LEON VxWorks-5.4 BSP - Gaislergaisler.com/anonftp/vxworks/readme-vxworks-5.4-1.0.2.pdfVXWORKS-5.4 3 1 INTRODUCTION This document is intended as an aid in starting developing with LEON

VXWORKS-5.4 6

4 PROJECT CONFIGURATION

This section describes the configuration options of the LEON VxWorks 5.4 BSP. Beginning with the most basic configuration, the boot loader configuration. Followed by the kernel configuration, selecting components and setting their parameters. The GRETH Ethernet driver is used as an example on how to include and configure a driver that comes with the BSP.

During project creation defaults are read from config.h located in the BSP directory (target/config/leon_sparcv8). The defaults can be overridden by using the Tornado GUI. If one is certain of using the same hardware for all projects it may be convenient to change the defaults in config.h manually with a text editor.

4.1 Boot loader configuration

Depending on what target you are building for it may be relevant to configure the bootloader's setting. More about build targets can be found in section building project.

When running the kernel from RAM using grmon, it is not necessary to configure the Boot loader since it is not used. Grmon itself does the basic initialization for you when typing run.

The boot loader's primary task is to load the VxWorks kernel. Some basic initialization such as SDRAM parameters and system console baud rate is initialized by the boot loader before booting VxWorks. The initialization parameters can be found in bootloader.h under target/config/leon_sparcv8 (BSP directory).

For the boot loader parameters to take effect one must build the boot loader. Build the boot loader by Build/Build Boot ROM... from the main menu. Select leon_sparcv8 in the left view and boot loader in the right. Press OK.

4.2 Memory configuration

Since the LEON BSP is not designed for a specific board, but may be used in many different board set ups, it is therefore sometimes needed to change the BSP configuration parameters. Memory size and location may differ between boards.

The BSP memory configuration is set up as any other VxWorks-5.4 project via the Tornado GUI 'hardware/memory/BSP Memory Configuration'.

Page 7: LEON VxWorks-5.4 BSP - Gaislergaisler.com/anonftp/vxworks/readme-vxworks-5.4-1.0.2.pdfVXWORKS-5.4 3 1 INTRODUCTION This document is intended as an aid in starting developing with LEON

VXWORKS-5.4 7

4.2.1 Base address

The VxWorks kernel's view of the main memory can be controlled with the parameter LOCAL_MEM_LOCAL_ADRS. SDRAM is usually mapped to 0x40000000.

4.2.2 Memory Size

The size of the board's main memory is set by LOCAL_MEM_SIZE.

4.2.3 Default kernel boot argument

Ethernet interfaces can be set up using the DEFAULT_BOOT_LINE. Each Ethernet driver has it's own name. The name can be used to identify the network driver. The GRETH driver is named greth and the LAN Chip driver lnc.

4.3 Component selection

Including components into your project is done as usual using the Tornado GUI's VxWorks view from the project window:

Under Hardware BSP specific settings can be found. From Hardware/Gaisler Drivers it is possible to select what drivers should be included in the kernel. Right click on driver and press 'Include <DRIVER>' from the pop-up menu. Include only drivers which hardware is present. Note that not all combinations of drivers may be supported.

Page 8: LEON VxWorks-5.4 BSP - Gaislergaisler.com/anonftp/vxworks/readme-vxworks-5.4-1.0.2.pdfVXWORKS-5.4 3 1 INTRODUCTION This document is intended as an aid in starting developing with LEON

VXWORKS-5.4 8

Software drivers can be excluded from the project to save space. Default for a GR-XC3S board is to include the Ethernet driver, but it is also possible to exclude it:

Generally, when a driver is included the project's prjConfig.c is updated to include the included driver's source. The driver options is included into prjConfig.c from prjParams.h.

Using an END Ethernet driver such as the GRETH or LAN91C111 driver enables you to take advantage of the Tornado debugging tools maximally. Make sure to enable 'WDB END driver connection'. Tornado tools can access the target via the Ethernet interface if properly set up. One way to set up the network interface is to call ipAttach() and ifAddrAdd() as done in the simple network example described later on. It is also possible to use the boot string.

4.4 Component configuration

Each software driver has it's own configuration options. The Parameter view can be found by right clicking the component and selecting properties. Following is an example on how to configure the GRETH Ethernet software driver.

Page 9: LEON VxWorks-5.4 BSP - Gaislergaisler.com/anonftp/vxworks/readme-vxworks-5.4-1.0.2.pdfVXWORKS-5.4 3 1 INTRODUCTION This document is intended as an aid in starting developing with LEON

VXWORKS-5.4 9

To be able to use the Ethernet interface one must configure the Ethernet hardware address of the MAC, this is done by providing input to the MAC's driver. Enter the properties page of the GRETH component by double clicking the GRETH component, select the Params tab and finally enter your unique 6 byte MAC address:

RXBDNUM and TXBDNUM defines the number of descriptors(buffers) to use in the receiving and transmitting parts to the driver. Each descriptor adds about 3k of RAM usage to the driver. The GRETH MAC supports a minimum of one descriptor and a maximum of 128 descriptors in both directions.

Page 10: LEON VxWorks-5.4 BSP - Gaislergaisler.com/anonftp/vxworks/readme-vxworks-5.4-1.0.2.pdfVXWORKS-5.4 3 1 INTRODUCTION This document is intended as an aid in starting developing with LEON

VXWORKS-5.4 10

5 BUILDING PROJECT

Choose build rule from the properties page for respective build target. The rule decide where in memory the image will be run from. Select rule depending on how you intend to run VxWorks, from PROM or RAM etc. See Boot loader configuration for boot loader configuration.

When running from RAM using grmon select VxWorks.

It is now possible to build the project's binary file default/vxWorks:

The user application is called from usrAppInit.c, as with any other VxWorks-5.4 project. See examples below.

Page 11: LEON VxWorks-5.4 BSP - Gaislergaisler.com/anonftp/vxworks/readme-vxworks-5.4-1.0.2.pdfVXWORKS-5.4 3 1 INTRODUCTION This document is intended as an aid in starting developing with LEON

VXWORKS-5.4 11

6 SUPPORT

For support, contact the Gaisler Research support team at [email protected]

Page 12: LEON VxWorks-5.4 BSP - Gaislergaisler.com/anonftp/vxworks/readme-vxworks-5.4-1.0.2.pdfVXWORKS-5.4 3 1 INTRODUCTION This document is intended as an aid in starting developing with LEON

VXWORKS-5.4 12

7 EXAMPLES

The examples are written for GR-XC3S but are easily modified to run on other boards. For example, when using a GR-CPCI-AT697 the “greth” network interface name must be substituted with “lnc”.

7.1 Simple network example, using ping utility

A simple network test application can be made by editing the usrAppInit.c as follows:

The example sets up the Ethernet interface to 192.168.0.199 and adds itself and a host to the host name table by calling hostAdd(). IfShow() is called to produce a UNIX ifconfig similar output for the greth0 interface. Later it pings the host to verify that the connection to host1 is working.

For the example to work at least ICMPv4 and GRETH Ethernet driver component must be included. Also a valid Ethernet Hardware Address must be set in the GRETH driver .

Download to GR-XC3S using grmon over usb:

$ grmon -usb -nb

grlib> load project1/default/vxWorkssection: .text at 0x40003000, size 529680 bytessection: .data at 0x40084510, size 18000 bytessection: .bss at 0x40088b60, size 21988 bytes

Connect terminal software (hyperterminal, minicom, kermit) to GR-XC3S Serial J1 connector with settings 38400baud, 8 data bits, no parity, 1 stop bit (38400 8n1).

grlib> run

Page 13: LEON VxWorks-5.4 BSP - Gaislergaisler.com/anonftp/vxworks/readme-vxworks-5.4-1.0.2.pdfVXWORKS-5.4 3 1 INTRODUCTION This document is intended as an aid in starting developing with LEON

VXWORKS-5.4 13

Terminal software output:

Could not find 0Attaching interface lo0...done

VxWorks

Copyright 1984-1998 Wind River Systems, Inc.

CPU: Leon-board (LEON) VxWorks: 5.4 BSP version: 1.2/1 Creation date: Sep 18 2006 WDB: Ready.

Adding Hostnames to lookup tableSetting up Network Params for greth0greth (unit number 0): Flags: (0x63) UP BROADCAST ARP RUNNING Type: ETHERNET_CSMACD Internet address: 192.168.0.199 Broadcast address: 192.168.0.255 Netmask 0xffffff00 Subnetmask 0xffffff00 Ethernet address is 00:00:7a:cc:00:12 Metric is 0 Maximum Transfer Unit size is 1500 0 packets received; 1 packets sent 0 multicast packets received 0 multicast packets sent 0 input errors; 0 output errors 0 collisions; 0 droppedhost1 is Alive

After extracting the leon sparc distribution a similar example can be found in '<Tornado top-level directory>\target\proj\simple_network_example\usrAppInit.c'.

7.2 Connecting to GR-XC3S with WindView using WBD over Ethernet

Continue from previous example by adding WindView support to the project:

Page 14: LEON VxWorks-5.4 BSP - Gaislergaisler.com/anonftp/vxworks/readme-vxworks-5.4-1.0.2.pdfVXWORKS-5.4 3 1 INTRODUCTION This document is intended as an aid in starting developing with LEON

VXWORKS-5.4 14

Make sure you have selected INCLUDE_WDB_COMM_END from 'development/WDB agent/Select WDB Connection/WDB END driver connection'.

Rebuild the project, download it and start the application. Downloading the kernel and starting it can be achieved by using grmon as in the simple network example above.

Start a target server and specifying the IP address you have given greth0 interface during the call to ifAddrAdd(). In our simple network example we passed 192.168.0.199. Give your server a name, we call it Board in this example.

Start the target server by pressing 'Launch' when the configuration is done.

The target server and the target GR-XC3S is now running, connect to it by selecting target server using the drop down list:

Page 15: LEON VxWorks-5.4 BSP - Gaislergaisler.com/anonftp/vxworks/readme-vxworks-5.4-1.0.2.pdfVXWORKS-5.4 3 1 INTRODUCTION This document is intended as an aid in starting developing with LEON

VXWORKS-5.4 15

Verify the connection by pressing the info button. A dialogue windows that display some general information appears. From the dialogue you can also get other information, for example task stack sizes.

Start WindView by clicking the WindView taskbar icon. Select TaskLib to log task activity, press OK. By pressing properties the log buffer size can be configured.

Press GO to start logging task switching. Press STOP after a while to stop the logging. Upload the result to the graph view by clicking the Upload icon. The following window should now appear:

Page 16: LEON VxWorks-5.4 BSP - Gaislergaisler.com/anonftp/vxworks/readme-vxworks-5.4-1.0.2.pdfVXWORKS-5.4 3 1 INTRODUCTION This document is intended as an aid in starting developing with LEON

VXWORKS-5.4 16

This graph represents the task activity during the interval from GO until STOP.


Recommended