Version 21 (modified by 13 years ago) ( diff ) | ,
---|
Table of Contents
Software Description
As mentioned previously software for the CM3 is developed in the Paradigm C++ Pro programming environment, and uses the Lantronix XPort AR SDK. At the time of this documents writing the SDK being used was release v5.2.0.0 R21. The CM3 works completely independently from the host node, and as soon as power is applied the native Lantronix XPort AR functions, such as network connectivity, start and then the custom written CM software loads.
Files
The following is a list of the basic files that are in the SVN repository, and what functionality they contain:
- CM3 - Initialization of the CM3, XML configuration, and the main program which runs the two primary threads
- CM3_CLI - Sets up the command line interface (CLI) structure, as well as defining the functions call-backs for each command in the CLI
- CM3_COMMAND - There are the functions that actually execute the commands, whether they be called by HTTP, CLI, or UDP
- CM3_COMMUNICATION - Opens the UDP socket
- CM3_HTTP - creates the HTTP pages and function call-backs to enable HTTP commands
- CM3_I2C - Presently unused other than containing functions that read the hardware status and the 5V monitoring line, this should be done over I2C through the DS1780 chip, but I2C is non-operational
- CM3_IDENTITY Contains functions that query the identifying features of the CM and node, like location, IP address, MAC address, etc.
- CM3_UDP - Where the UDP thread functions are defines, as well as any other functions that process UDP information.
Initialization
Upon startup the CM3 will fist contact broadcast over the network to discover the IP address that should belong to it. Assuming that the MAC address is already in DHCP, an IP address will be assigned to it, and from there the custom CM3 software takes over. Much of the configuration of the device is done through the XML configuration method.
The following are configured through XML:
- Serial line
- GPIOs
- Telnet ports
After XML configuration is completed the CM3 will populate the network information back into variables set up in software. This is because a lot of the network information is only available through the XML configuration file and so to recollect it each time you need it takes a long time. The CM3 then sets up the HTTP commands, which allow some basic functions of the CM3 to be executed of HTTP, the custom command line interface for the CM3, as described in table 2, and the user datagram protocol (UDP) socket.
UDP
Once the UDP socket is opened two threads are opened that run side by side. The first is udpListen(), which is the thread that monitors the UDP socket for incoming packets. Once a packet is received the thread checks for valid CM packet structure and proceeds to act accordingly if it is.
The other thread that is opened is udpPkt(). udpPkt() is the function that is responsible for sending registration and status packets. Initially the function will send out registration packets, until it gets a registration ACK, and then a status update packet every 20 seconds. If the CM sends out 3 status update packets and does not receive an ACK from the CMC, it will go back to the assumption that it is no longer registered in the CMC and send out registation packets again. The two UDP threads are responsible for most of the functionality of the CM3 as the majority of commands come from the experiment controller through the CMC over the UDP lines. HTTP and CLI commands are added functionality for when there is no CMC.
Flashing Firmware
There are two primary methods to reflash a CM3, over the network and also through the serial port. This section will describe how to load new firmware onto the device using both methods. The latest 'known good image' can always be found on the SVN Repository
Flashing firmware over network
- open FTP session directly to the CM Lantronix device in terminal client
ftp xxx.xxx.xxx.xxx
- when prompted for the username and password enter the following
username: admin password: PASS
- using the image taken from the SVN repository
REV_A_B_C.rom.gz
put REV_A_B_C.rom.gz xport_ar.rom.gz
- The image must be sent to the Xpor AR named xport_ar.rom.gz, otherwise the device will not recognize it as new firmware and will not re-flash. Re-flashing the device will take a few minutes, it will reset itself and should come back online with no issues.
Flashing firmware over serial
Re-flashing as CM over the serial port should be done when the node is not accessible aver the network, it is a generally slower method than via FTP. Before you can recover the firmware over serial you will need to install Device Installer on your PC. Device Installer is free to download off the lantronix website, and can be found here.
- Open
DeviceInstaller
- Go to 'Tools'→'Advanced'→'Recover Firmware' (or simply the F8 key)
- Configure the options, and hit OK to load the image
- Choose the COM port being used
- Select "Xport AR A1" as the device
- Make sure that the "Erase all flash" option is checked
- Enter the path of the image to be loaded
- The program will prompt you to power off the device, you can just ignore this and hit next
- The serial recovery will have started, but you must still power cycle the device before the transfer begins, either hit the reset button on the CM or just pull and reapply the power to the CM.
Attachments (2)
- serial_recovery.jpg (74.8 KB ) - added by 13 years ago.
-
REV_4_2_0.rom.gz
(594.2 KB
) - added by 12 years ago.
CM3 firmware V4.1.0
Download all attachments as: .zip