Home
Developer Resources
QNX RTOS v4
QNX RTOS v4 Knowledge Base

QNX RTOS v4 Knowledge Base

Foundry27
Foundry27
QNX RTOS v4 project
Resources

QNX RTOS v4 Knowledge Base

Title Setting up a Motorola RPX-Lite board
Ref. No. QNX.000010129
Category(ies) Utilities, Kernel, Installation, Configuration
Issue How can we copy our Neutrino boot image to our Motorola RPX-Lite board?


Solution This technote explains the steps required to transfer a QNX Neutrino image to a Motorolla RPX-Lite board.


Setting up the connection
=========================

The RPX-Lite board has two RJ-45 sockets. The one closest to the power supply is a serial adapter. The RJ-45 socket next to it is a standard ethernet adapter.

When you use the serial connection, you will have to use a NULL modem cable to reverse the transmit and receive pins.

On the QNX terminal, you will have to setup your serial port. The commands to change the settings required by the RPX-Lite board is:

    stty baud=115200 -ohpaged -ohflow </dev/ser#

Where /dev/ser# is the serial port which is connected to the RPX-Lite board.

Then you can use qtalk to connect to the RPX-Lite board.

    qtalk -m/dev/ser#

If this does not work, try a lower baud rate of 9600.

To get access to the onboard RPX programming and configuration utility, press ESC

Building the srec image
=======================

The rpx-lite flash is a boot block device.  On an 8Meg flash device, the blocks are 64k, 32k, 32k, 128k, 256k, 256k, ... 256k in size. The RPX-Lite utility needs the boot image to be in srec format and not in binary format.

The srec format is a way of specifying where things go.  Each record of the srec file contains a destination address.  If you are loading the image into DRAM via tftp and then copying to flash you could have it be copied to 0x10000 in DRAM and then you would use the RPX-Lite utility to subsequently copy it from 0x10000 to 0xFF810000 in flash.

Creating srec format using mkifs (one step process)
---------------------------------------------------

In your build file, you will have:

    [image=0x10000]          # this is the address of the offset in DRAM

    [virtual=ppcbe/srec] .bootstrap = {        # Notice the srec format

You can use the mkifs command to generate the srec file:

    mkifs myimage.build myimage.srec

The records will be made such that the first one starts at 0x10000, the next follows the first and so on.  In this case you would not need to run mkrec since mkifs will create the srec format file for you (because of the srec entry in the build file).

Creating srec format using mkrec (two step process)
---------------------------------------------------

In your build file, you will have:
    [image=0x10000]          # once again the 0x10000 offset for ram

    [virtual=ppcbe/binary] .bootstrap = {      # this time we set binary

After you have done the mkifs command

            mkifs myimage.build myimage.img

you can use the mkrec utility to create the srec file

    mkrec -o0x10000 -r -fsrec myimage.img > myimage.srec
        # the -o option is the offset. Once again, since we are putting the image in Ram first, it must be an offset into the ram

The records will be made such that the first one starts at 0x10000, the next follows the first and so on.

Transfering the image to the RPX-Lite board
===========================================

Setting up the tftp
-------------------

Configure the rpx-lite eprom with an ip address.
To do this, press C (configure EEPROM) from the RPX Main menu.
In the RPX Configure menu press 7 (Modify paramaters of system configuration keys)
Keep on pressing <Enter> until you reach "IP Address"
The ip address must be in a hex format.
    eg: 10.1.1.250 = 0A0101FA

Keep on hitting <Enter> until you reach the RPX Configure menu again.
Finally, press 9 (Write paramaters to EEPROM) to save the changes and type in YES (all in capitals) to confirm.

You can now press ESC to go back to the main RPX menu

The ip address of the RPX-Lite board  must also be in /etc/hosts on the QNX4 box.

In /etc/inetd.conf (or /etc/inetd.<node#>), verify that the tftpd entry is as follows:

    tftp    dgram  udp wait    root    /usr/ucb/tftpd  in.tftpd
                                ----
Usually, you will have to change the root username. The connection will fail if another name is specified instead of root. Also, verify that the path to tftpd (/usr/ucb/tftpd) is correct.

Now, you need to run inetd (as root) as follows:

  inetd /etc/inetd.conf  # replace the /etc/inetd.conf with the inetd.<node#> if you have one

Transfering the image
---------------------

On the RPX-Lite board, you can now begin the transfer:

From the RPX Main menu, press L (Load RAM)

In the RPXLoad menu, press 7 (Load using tftp via Ethernet)
Make sure that you enter the server IP address (address of QNX4 system) in hex format.
The filename must include the full path. But, be carefull, the RPX utility only has room for 15 characters. If the filename (including path) exceeds this limit, the RPX utility will not find the filename.
Finally, enter the address offset. This is usually 0.

Here is an example of what you will see on the RPX Load Menu:

RPX Load menu: press 123456789T key : <?> : 7
Load using tftp via Ethernet
Enter server IP address <0A000078> : 0A000078
Enter server filename  </hd/m/img> : /hd/m/img
Enter address offset  : <00000000 hex> : 0
Starting tftp download:
inetARP(): OK
.1.2.4.8.16.32.64.128.256.512.1024.2048.4096.8192.16384.32768
load_tftp(): OK
6553630 data bytes, 81921 S-records, 12801 tftp blocks, 0 repeated blocks
start address = 00000000
RPX Load menu: press 123456789T key : <?> :

Now, you can press ESC to go back to the main RPX menu.
From there, you can press P (Program FLASH) to copy the image to the flash.

When copying the image from buffer to flash, the size of the BINARY file must be a multiple of 4 bytes. If you created the file directly to srec format using mkifs, you should recreate the image in binary format. The size of the binary file is needed in the next step.

In the RPX Flash menu, press 1 (Show Flash information) Make sure that the area that you want to copy the image to is empty. You will not be able to copy the image over an area which is used.
If you need to delete an area of the Flash, use the "erase and verify erase: specific section" (2) from the RPX Flash menu. Make sure that you do not erase the following blocks:

    FF000000  (used)
    FFF00000  (exec)
    FFF40000  (used)

To copy the image to flash, press 9 (program and verify using data in memory) in the RPX Flash menu.
The target address is the offset on the flash (from the Show Flash information) section.
The source address is the address you specified as the DRAM offset (0x10000) in the build file [image=...] or using the mkrec -o option.
The number of bytes is the size of the BINARY boot image file in HEX format.

Here is an example of what you will see on the RPX Flash Menu:

RPX FLASH program menu: press 123456789 or  key : <?> : 9
program: Enter target address  : <hex> : FF810000
program: Enter source address  : <hex> : 10000
program: Enter number of bytes : <hex> : 1048E4
Programming completed successfully
Verification completed successfully
RPX FLASH program menu: press 123456789 or  key : <?> :


Loading into RAM from serial port
--------------------------------------
If you do not want to use the tftp transfer, you can do a serial transfer

From the Main RPX Menu choose L for Load RAM
Choose 5 (load using S-record received from serial monitor port) from the RPX Load menu
You will now see "Waiting for S-records or ESC to terminate"
The image must be in srec format for loading to RAM

On the QNX4 box, you can use these commands to copy the file to the RPX-Lite board

    cp -V imagefile.srec /dev/ser#
Where /dev/ser# is the serial port which is connected to the RPX-Lite board.

When it is done, press ESC on the RPX-lite board.
Then, choose 9 (transfer control to start address) at the RPX Load menu to run from start address. The RPX utility already knows the start address.

Debugging
=========

If you get these errors....
--------------------------

load_tftp(): ** E_RPX_ARP_ERROR when trying to tftp, check:

    1) the server IP address specified
    2) the server (qnx4) is running inetd
    3) the inetd.conf file has root as the username in the tftp row
    4) make sure that the IP addresses of the RPX board is on the same network as the QNX server (check the netmask)

load_tftp(): ** E_TFTP_ERROR when trying to tftp, check :

    1) make sure that the srec file is in the path specified
    2) the filename does not exceed 15 characters
    3) make sure that you specify the path in the rpx utility