Contents Copyright & Trademark ......................2 Warranty ............................ 2 Contacts ............................. 2 Disclaimer ..........................2 Revision History ......................... 2 List of Figures ..........................6 List of Tables ..........................6 1. Overview Hardware Specifications ......................9 Software ............................. 9 Terms and Abbreviations ......................10 2.
Page 4
5. Flash Partitioning Intro to Partitioning ........................32 Dual Bank ..........................32 Default Flash Memory Map for MatchPort AR, EDS1100, and EDS2100 ......33 Default Flash Memory Map for XPort Pro ................34 kernel + ROMFS root + blank JFFS2 ..................36 kernel + ROMFS root, preserving the JFFS2 partition ............
Page 5
Other Profiling and Debugging Utilities ................... 67 13. Firmware Updates Introduction ..........................68 Firmware Updates by File System ..................68 Lantronix’ Sample Update Process Implementation ............... 68 14. Resources Lantronix Open Linux SDK Forum ..................72 Links to Related Web Sites ..................... 72 A.
Figure 3-2. Firmware Upgrade Window ..................20 Figure 3-3. Serial Recovery Window ..................... 20 Figure 3-4. Serial Recovery Status Window Example for a MatchPort AR ........21 Figure 3-5. Serial Recovery Results Window ................21 Figure 3-6. dBug Configuration Window ..................22 Figure 3-7.
The Lantronix Linux Software Developer's Kit (SDK) is an embedded hardware and software suite that enables Linux developers to create applications on Lantronix embedded networking modules. Detailed instructions for installing the SDK on your host Linux system are provided in this guide.
1 Overview Hardware Specifications MatchPort AR XPort Pro Memory: Memory: RAM 8MB SDRAM 8/16MB FLASH 8MB FLASH 16MB Serial Interface: Serial Interface: Two COM ports (CON1 using console) One COM port Max baud rate 230400 bps (default Max baud rate 921600 bps (default...
1 Overview Terms and Abbreviations Table 1-1. Terms and Abbreviations Term Description dBUG Linux boot loader host Machine onto which the SDK gets installed and is used for cross-compiling for the embedded platform Software development kit target Embedded development module Linux Software Developers Kit (SDK) User Guide...
Host Requirements Please make sure that at least 2.5 GB of disk space are available before installation. Root permissions are needed for very few operations. Please refer to the following section on ‘sudo Configuration’ for details. Linux Distributions This SDK was validated on these Linux distributions: Redhat-based distributions Fedora 9, 10, 11, 12, Fedora Core 5 &...
Page 12
2 Installing the SDK Ubuntu 8.04, 8.10, 9.04, 9.10, 10.04 build-essential python sudo libacl1-dev tftpd or tftpd-hpa patch libtasn1-3-dev zlib1g-dev rsync Optional but recommended packages nfs-kernel-server libncurses5-dev (for the ncurses-based configuration utility) libglade2-dev (for the GTK-based graphical configuration utility) libqt3-mt-dev (for the Qt3-based graphical configuration utility) Other distributions OpenSUSE 11.2 pattern install devel_C_C++...
Page 13
2 Installing the SDK NOTE If you are able to compile the Linux kernel on your host machine, you will also be able to build the SDK images. Lantronix highly recommends that the machine also act as an NFS-server. sudo Configuration...
2 Installing the SDK Host TFTP Server Configuration To transfer files from your host system to the target you may need to setup a TFTP server on your host machine. The following steps describe how to setup a TFTP server on a Fedora based distribution.
Files Below is a brief description of the files on the CD. Filenames printed in italic are unmodified. All necessary modifications Lantronix has made to make them run better under the µClinux environment are in uClinux-linux_sdk-patch-R*.tar.gz. Table 2-1. CD Files...
2 Installing the SDK CD File Description vipaccess.tar.gz VIP (virtual IP) Access technology module Documentation/ Documentations DeviceInstaller/ Lantronix DeviceInstaller utility dBUG/ Linux boot loader jffs2/ files for jffs2 partitioning scripts/ scripts for build environment images/ pre-built images for the supported platforms...
Page 17
2 Installing the SDK $ mount | grep iso9660 If you see a line similar to: /dev/hdc on /media/CDROM type iso9660 (ro,nosuid,nodev,uid=500) Then the CD is already mounted. Please pay attention to the highlighted options in the brackets behind type iso9660. If it contains noexec, you have to issue the following command to allow the execution of scripts directly from the CD: $ sudo mount -o remount -o exec /media/CDROM 3.
Linux on the supported platform (MatchPort AR, XPort Pro, or EDS1100 / 2100) is loaded through two boot loader stages. The first stage is the Lantronix boot loader, which is present on both the Evolution OS and Linux based products. The Lantronix boot loader is marked as read-only, so it cannot be overwritten accidentally.
3 dBUG Boot loader 5. Set the Device Model to match your embedded module (MatchPort AR, XPort Pro, or EDS1100/2100). 6. Click Browse to select the path to the dBUG image file. For example, the path for the MatchPort AR would be: c:\install directory>/dBUG/dbug-R<ver>.romz...
Figure 3-5. Serial Recovery Results Window Basic Configuration 1. Connect an RS232 cable between your host computer COM1 and any of the MatchPort AR (CON1 on the eval board), XPort Pro (Port A on the demo board), EDS1100 (Serial), or EDS2100 (Serial 1).
3 dBUG Boot loader 4. At the dBUG> console prompt, configure the dBUG settings. Use the following instructions for configuring dBUG to boot an image containing the kernel and a ROMFS root file system over the network. NOTE A TFTP server with the image.bin file must be configured on the server with the specified address.
7. Clear the flash space for the JFFS2 partition using the ‘fl e’ command. The command below erases 4MB of flash starting at address 0x00400000. This can be mounted as a JFFS2 partition from Linux. For the MatchPort AR or EDS1100 / 2100 dBUG> fl e 0x00400000 0x00400000 For the XPort Pro dBUG>...
3 dBUG Boot loader To use dual bank: 1. Disable dual bank. dBUG> set bootbank single 2. Enable dual bank and use bank 1 as boot bank. dBUG> set bootbank 1 3. Enable dual bank and use bank 2 as boot bank. dBUG>...
3 dBUG Boot loader Option Values Description filename <filename> File path for image transfer via TFTP. filetype <srec|coff|elf|image> File image type. Only "image" is supported. Ethernet MAC address. "default" resets the MAC to ethaddr <aa:bb:cc:dd:ee:ff>|default factory default. <dns IP> IP address of DNS server. bootfc reset Reset boot failure counter...
The netcon network console program allows dBUG console access over the network. This is useful in situations where the device (MatchPort AR, XPort Pro, or EDS1100 / 2100) is remote, or when the console is otherwise unavailable. The path to the netcon client program in the SDK is <install_directory>/host/usr/sbin/netcon.
Introduction Linux supports a wide range of file systems. Most of them were created with certain characteristics in mind: high performance, reliability, compatibility with other operating systems, general purpose, etc. Raw flash devices have inherently different characteristics than block devices such as hard drives and USB flash drives: Flash areas have to get explicitly erased before they can be overwritten Erase blocks, the smallest entities that can be erased on a flash, are usually considerably...
4 Supported File Systems ROMFS being a read-only file system, makes it easy to guarantee its integrity during runtime. On the other hand, all variable data like configuration files that might need to be updated during runtime need to be stored on a separate file system. All applications in ROMFS can be run with XIP: eXecute In Place (set romfs_flash to on in dBug) –...
To save data permanently (e.g. for logging or backing up data to a server) Be aware that most sample profiles provided by Lantronix do not include support for NFS to save precious RAM. Depending on the chosen profile, you might have to activate the relevant...
Page 30
4 Supported File Systems All details can be found in <install-dir>/linux/linux- 2.6.x/Documentation/filesystems/nfsroot.txt There are a few onetime steps involved to enable this mode as identified below: µClinux kernel configuration CONFIG_ROOT_NFS needs to be enabled in the kernel configuration. If a BOOTP or DHCP server is available on your network you might want to enable CONFIG_IP_PNP_BOOTP or CONFIG_IP_PNP_DHCP as well.
Page 31
Don't forget to execute “sudo exportfs –av” after modifying /etc/exports. If you do this the first time, make sure that you can mount the exported file system on your host or a different machine on the same network before trying to boot your MatchPort from it. Mounting NFS File Systems During Runtime...
Intro to Partitioning The idea of partitioning is to optimize the usage of the available flash space to meet your requirements. A Linux file system encompasses many files with different characteristics. There are binaries and data files. Some of them are crucial for the operation of the system all the time, while some need to be available in certain conditions only.
Default Flash Memory Map for MatchPort AR, EDS1100, and EDS2100 The following figure shows the flash layout as it is hard-coded in the Linux kernel. Figure 5-1. Flash Layout – MatchPort AR, EDS1100, and EDS2100 Flash Layout – MatchPort AR, EDS1100, EDS2100 Single Bank Dual Bank –...
Flash Layout – XPort Pro Single Bank Dual Bank – Bank 1 Dual Bank – Bank 2 0x00000000 /dev/mtd0 (128K) /dev/mtd0 (128K) /dev/mtd0 (128K) Lantronix BootLoader Lantronix BootLoader Lantronix BootLoader 0x00020000 /dev/mtd1 (128K) /dev/mtd1 (128K) /dev/mtd1 (128K) Factory Unit Configuration...
5 Flash Partitioning #else /* CONFIG_MTD_RECOVER_PARAMS */ #ifdef CONFIG_MTD_BOOT_BANK .name = "UserExtra", .size = 0x40000, .offset = 0x400000 // gets overwritten below #endif /* CONFIG_MTD_BOOT_BANK */ #endif /* CONFIG_MTD_RECOVER_PARAMS */ kernel + ROMFS root + blank JFFS2 This is the easiest deployable configuration available. The build process creates a ROMFS from the root file system and appends the Linux kernel to it.
5 Flash Partitioning 2. Validate that the kernel command line is set to rootfstype=romfs: dBUG> show watchdog: on silentboot: off romfs_flash: off bootbank: Single safebank: 0 netcon: on tftpsrv: on base: 16 baud: 115200 autoboot: Stop at prompt server: 172.19.239.1 client: 172.19.239.77 gateway: 172.19.0.1 netmask: 255.255.0.0...
It is also more prone to file system corruption of important files then ROMFS, since everything is stored on a single write-enabled partition. On a MatchPort AR it would look like this: 1. Download and flash the kernel image (you can use either linux.bin or the compressed version linuz.bin)
5 Flash Partitioning Otherwise issue: dBUG> set kcl noinitrd rw rootfstype=jffs2 root=/dev/mtdblock5 And run the freshly installed new kernel + ROMFS with dBUG> gfl kernel + ROMFS root + JFFS2 + AUFS This variation is created when you use the AUFS profile. The instruction to get the resulting files on the flash are identical to the ones described in the “kernel + ROMFS root + blank JFFS2”...
Page 40
For now we'll just use 0x00200000. 3. The default size for the JFFS2 file system is 4MB. It is hard-coded in <install- dir>/linux/vendors/Lantronix/<platform>/config.arch. Since we have 6MB available, we want to make use of it. Look for the lines: JFFS2_SIZE = 0x400000 in Config.arch and adjust the JFFS2_SIZE to 0x600000.
Page 41
1792KB (1536KB on XPort Pro). The size of the jffs2 partition is 0x600000 bytes (6144KB). Note that a flash partition may be larger than its corresponding image because they must begin and end on flash erase block boundaries. For MatchPort AR or EDS1100 / 2100 dBUG> set kcl noinitrd rw rootfstype=jffs2 root=/dev/mtdblock5 mtdparts=mpt:64k(LTRXbloader),64k(LTRXconfig),64k(bootloader),64k(dB...
A profile is selected during the initial make of µClinux but can be exchanged any time. The profiles are located under <install_directory>/linux/vendor/Lantronix/<platform>/profile/<profile-name>. A table describing these profiles is given below. Table 6-1. Configuration Profiles...
6 Building µClinux Kernel and Application Options The simplest way to modify the kernel and/or application options or switch to a different profile is to run one of these commands from the installation directory. Command Interface Type make menuconfig ncurses/terminal window make xconfig graphical GTK make qconfig...
6 Building µClinux Figure 6-2. uClinux Customize Application/Library Settings Window 4. At the bottom of the screen, select Exit and press Enter. Repeat this process for the parent window. 5. When prompted to save your new kernel configuration, select Yes and press Enter. Figure 6-3.
6 Building µClinux Figure 6-4. uClinux Save Configurations Window 7. To customize the application/library settings selected earlier, navigate through the configuration the menu and enable or disable the desired options. When finished, select Exit and press Enter. Figure 6-5. uClinux Distribution Configuration Window 8.
To build images, perform the following on the development host: $ cd <install directory> $ . env_m68k-uclinux $ make … Vendor > 1. Lantronix (DEFAULTS_LANTRONIX) (NEW) choice[1]: 1 * Select the Product you wish to target Lantronix Products > 1. XPort_Pro (DEFAULTS_LANTRONIX_XPORT_PRO) (NEW) 2. MatchPort_AR (DEFAULTS_LANTRONIX_MATCHPORT_AR) (NEW) 3.
Page 47
$ cp linux/images/* /tftpboot It is possible to have the build process automatically copy the image files to your tftp boot directory. To enable this, edit linux/vendors/Lantronix/<platform>/Makefile and set the TFTP_DIRECTORY variable to your tftp boot directory, and the COPY_BUILD_TO_TFTP_DIRECTORY variable to ‘y’.
Introduction Various startup scripts are called during the Linux boot process. These initialization files are found in the build environment under <install directory>/linux/vendors/Lantronix/<platform>/romfs_extra/. Edit them as appropriate. /etc/inittab The /etc/inittab file controls the configuration for the init process. It is here that the various startup and shutdown scripts are configured, and the console device is specified.
µ µ Introduction µClinux supports a full TCP/IP networking stack. Several networking protocols are supported through the kernel and various shell utilities. Networking is initialized on the target through the /etc/netstart script. DHCP The target can obtain an IP address automatically through the DHCP protocol. Two DHCP clients are supported, udhcpc and dhcpcd.
8 µClinux Networking inetd The inetd program listens for connections to network services such as telnet, ftp, and ssh. The /etc/inetd.conf configuration file specifies the ports to listen to, and their associated programs. The mapping of network port numbers to names is found in /etc/services. telnetd The telnet daemon allows for shell connections over the network.
Intro to BusyBox The busybox command incorporates the functionality of several common Linux utilities into a single binary file. The utilities have been optimized for space by supporting fewer options. Flash and RAM space have also been saved by eliminating the overhead of having multiple binary files. Symbolic links to the busybox program are used in place of the utility binaries, as busybox uses the calling link to determine which command to invoke.
9 BusyBox 2. Select Customize Application/Library Settings then press Y to include features. Figure 9-2. uClinux Kernel/Library/Defaults Selection Window 3. At the bottom of the screen, select Exit and press Enter. Repeat this process for the parent window which opens. 4.
9 BusyBox Figure 9-4. uClinux BusyBox Selection Window 6. Navigate the menu for each category of utilities to be modified. At each utility option to be modified, select Y to enable, or N to disable. When finished, select Exit and press Enter. The BusyBox options will now be updated.
SDK. These applications show examples of how to access the network, serial port and CPs. The Lantronix sample applications are found in the SDK under linux/user/lantronix. The libcp CP API library is also found in this directory. Descriptions of the sample applications are provided below.
10 Sample Applications s2e (Serial to Ethernet) The s2e program demonstrates serial to Ethernet tunneling and a configuration web interface. Note that the boa web server must be enabled with ‘make menuconfig’ in order to take advantage of the web interface. To access the s2e settings when the s2e and boa processes are running, use your web browser to connect to: http://<target_ip>/ Figure 10-2.
10 Sample Applications s2e-ssh The s2e-ssh program demonstrates serial to Ethernet tunneling with ssh. Note that this program requires a large amount of memory, so you have to reduce memory usage which is used by any other applications. Figure 10-4. Serial-To-Ethernet Tunnel Setup Screen with SSH To setup a serial to Ethernet tunnel with SSH server mode, you have to set SSH server keys at SSH Setup Screen.
10 Sample Applications The keys are OpenSSH PEM. Format as follows: RSA Private Key: -----BEGIN RSA PRIVATE KEY----- MIICWgIBAAKBgQCpcN0ROVbOHydDuE3/kKeS/DNq6CUEKLhZM7z/R8p7dGUwWirX dE+IapyOCaRMfKPJftWUkb4/H1KEAVpfRZKFeK+Q -----END RSA PRIVATE KEY----- DSA Private Key: -----BEGIN DSA PRIVATE KEY----- MIIBuwIBAAKBgQC89M2rttMbT5azCaxmY0szUPWlWK1T2Z2ewihJ68PoS/wqNPun FyuhK3qSn3cvdvDoUdQ4 -----END DSA PRIVATE KEY----- s2e-ssl The s2e-ssl program demonstrates serial to Ethernet tunneling with ssl. Note that this program requires a large amount of memory, so you have to reduce memory usage which is used by any other applications.
10 Sample Applications Figure 10-7. Serial-To-Ethernet SSL Setup Screen The keys are OpenSSL PEM Format like following. Certificate: -----BEGIN CERTIFICATE----- MIIDkjCCAvugAwIBAgIBADANBgkqhkiG9w0BAQQFADCBkzELMAkGA1UEBhMCSlAx MUiNfOVv -----END CERTIFICATE----- Private Key: -----BEGIN RSA PRIVATE KEY----- MIICXQIBAAKBgQC2QJSCGFUjsegEQbZl1ylVOi48ZcTJG1wRfyJ854V5+wpk2r7r vjkwxbSeE/Qj5L3hJPrnBap5qqPBfZhe8WIqdMXxKrma -----END RSA PRIVATE KEY----- s2e-gpio The s2e-gpio program demonstrates how to access and control to the device’s Configurable Pins via the Web.
Important Configuration Switches) The cpm.conf configuration file is used to group CPs into bit patterns. Note that the MatchPort AR has seven GPIO pins, whereas the XPort Pro has three of which 2 are shared with the serial driver. The cpm.conf file is of the following format: config cp<num[1-7]>...
Page 60
10 Sample Applications config cp2 { type output state enable invert disable config cp3 { type output state enable invert disable config cp4 { type output state enable invert disable group LED { type output state enable bit0 CP1 bit1 CP2 bit2 CP3 bit3 CP4 The cpm program can then be invoked to light all four LEDs with the following:...
10 Sample Applications Figure 10-9. CP Manager Interface Overview The led program is a simple LED demo intended to demonstrate the use of the CP API library. Run led from the shell with no arguments to observe the LED demo. Check the Process Stack The check the process stack (chkstk) is a tool which enables you to see the using stack size of working process like following:...
0; /* End test.c */ 1. Create make file as linux/user/lantronix/<app_dir>/Makefile. Use linux/usr/lantronix/hello_world/Makefile as a reference, and adjust for your application. 2. Add application to <install directory>/linux/user/lantronix/Makefile See hello_world rules and add in the same manner. 3. Edit <install directory>/linux/user/Kconfig See hello_world config and add in the same manner.
Introduction VIP Access Software provides secure remote Internet access to control almost any electronic equipment behind firewalls with ManageLinx. See the documents of ManageLinx for details. Enable VIP Access Software To compile and install vipaccess (VIP Access Software), enable the CONFIG_USER_LANTRONIX_VIP_ACCESS option and then rebuild µClinux with "make distclean"...
11 VIP Access Software Figure 11-1. Lantronix Applications Configuration Window 2. Make the Linux image and boot it. 3. Connect to http://<target_ip_address>/ by Web Browser. 4. Click VIP from Menu, select the bootstrap.xml from the directory where it resides and click Submit.
11 VIP Access Software Figure 11-2. Serial-To-Ethernet VIP Setup Screen Your device can accept connections on TCP ports (e.g. HTTP, TELNET, s2e) via VIP, after the VIP session is visible on DSM via its Web UI. Linux Software Developers Kit (SDK) User Guide...
COMMON_CFLAGS_OPTIMIZE = -0s syslog The syslog daemon is responsible for recording log messages. The Lantronix SDK uses the syslogd functionality provided by busybox. By default the target will write syslog messages in the /var ramdisk partion to /var/log/messages. While syslog is useful for target development, it may be best to disable it on production units in order to reduce memory usage.
12 Profiling & Debugging iperf The iperf program measures networking throughput between two systems. The program can be run on the target in either client or server mode. If client mode is chosen, iperf must first be run in server mode on the second system. With server mode, iperf must first be started on the target, and then run in client mode on the second system.
Lantronix’ Sample Update Process Implementation Overview The firmware update process highly depends on the flash memory layout you have chosen for your build. Lantronix provides an implementation with the following features and restrictions: Linux Software Developers Kit (SDK) User Guide...
Page 69
Below are some example invocations of the makeimage2.py script. 1. Installing a compressed linux+ROMFS image and erasing the flash area used for the JFFS2 /usr/local partition: For MatchPort AR makeimage2.py images/imagez.bin:kernel:0x40000:ROMFS: erase:0x400000:-1 /tmp/uclinux-kernel-and-romfs-and-erase-jffs2- area.bin For XPort Pro makeimage2.py images/imagez.bin:kernel:0x40000:ROMFS:...
Page 70
13 Firmware Updates For XPort Pro makeimage2.py images/image.bin:kernel:0x80000:ROMFS: /tmp/uclinux- kernel-and-romfs.bin 3. Installing an uncompressed linux kernel and using a JFFS2 root partition: For MatchPort AR makeimage2.py images/linux.bin:kernel:0x40000:bin: images/rootfs.img:jffs2:0x400000:bin: /tmp/uclinux-kernel-and- jffs2.bin For XPort Pro makeimage2.py images/linux.bin:kernel:0x80000:bin: images/rootfs.img:jffs2:0x400000:bin: /tmp/uclinux-kernel-and- jffs2.bin Updating via a TFTP Client To update the target via TFTP with an image file generated by makeimage2.py (see the previous...
13 Firmware Updates 4. Push the firmware update file to the target. Note that firmware updates must be pushed to /var/firmware.img. ftp> put uclinux-kernel-and-romfs-and-erase-jffs2-area.bin /var/firmware.img Updating via a WEB Browser To update the target via WEB Browser with an image file generated by makeimage2.py (see the previous section), perform the following steps: 1.
Forums page to determine if a more current version of the SDK is available. Individual forum topics are monitored by Lantronix engineers and technical support staff and may be used to ask questions regarding any aspect of the SDK. Complete the registration process to obtain a logon ID and post your question.
DEVICE DEVICE maps CP as pre-defined CONFIG_LTRX_CPM_DEFAULT_ use. KERN->Processor type and GPIO GPIO maps all CP as GPIO. features->Lantronix CP Manager CONFIG_LTRX_CPM_MANUALY MANUALY maps each CP by user. CONFIG_LTRX_CPM_MANUALY_ Enables page triming in mmap. KERN->Processor type and CONFIG_NOMMU_INITIAL_TRIM_ features->Turn on mmap() excess...
Enables NFS support on mount >portmap command. CONFIG_USER_GDBSERVER_GD USER->Miscellaneous Applications- Build gdbserver. BSERVER >gdbserver Use console depends on CONFIG_USER_CONSOLE_DEFA USER->Console Login linux/vendor/Lantronix/<platform>/ro Configuration mfs_extra/etc/inittab USER->Console Login Don’t use console CONFIG_USER_CONSOLE_NONE Configuration USER->Console Login Use CON1 (ttyS0) as console CONFIG_USER_CONSOLE_CON1 Configuration USER->Console Login...
Page 75
µ µ The µClinux kernel is a collection of patches to make the standard Linux kernel run on CPUs that do not have an MMU. As a consequence you will encounter some differences between the µClinux and the standard Linux behavior. While porting existing Linux applications to µClinux/ColdFire you should be aware of these limitations: no fork() –...
When you report a problem, please provide the following information: Your name, and your company name, address, and phone number Lantronix model number Lantronix MAC number Software version (on the first screen shown when you Telnet to port 9999)
Need help?
Do you have a question about the MatchPort and is the answer not in the manual?
Questions and answers