Moxa Technologies UC-7420/7410 user manual Flash Memory Map, Linux Tool Chain Introduction

Page 78

UC-7420/7410 User’s Manual

Programmer’s Guide

Flash Memory Map

Partition sizes are hard coded into the kernel binary. To change the partition sizes, you will need to rebuild the kernel. The flash memory map is shown in the following table.

Address

Size

Contents

0x00000000 – 0x0005FFFF

384 KB

Boot Loader—Read ONLY

0x00060000 – 0x0015FFFF

1 MB

Kernel object code—Read ONLY

0x00160000 – 0x0055FFFF

4 MB

Mini root file system (EXT2) —Read ONLY

0x00560000 – 0x01F5FFFF

26 MB

User root file system (JFFS2) —Read/Write

0x01F60000 – 0x01FBFFFF

384 KB

Not used

0x01FC0000 – 0x01FDFFFF

128 KB

Boot Loader configuration—Read ONLY

0x01FE0000 – 0x01FFFFFF

128 KB

Boot Loader directory—Read ONLY

Mount the user file system to /mnt/usrdisk with the root file system. Check to see if the user file system was mounted correctly. If user file system is okay, the kernel will change the root file system to /mnt/usrdisk. If the user file system is not okay, the kernel will use the default Moxa file system. To finish boot process, run the init program.

NOTE 1. The default Moxa file system only enables the network and CF. It lets users recover the user file system when it fails.

2.The user file system is a complete file system. Users can create and delete directories and files (including source code and executable files) as needed.

3.Users can create the user file system on the PC host or target platform, and then copy it to the UC-7420/7410.

Linux Tool Chain Introduction

To ensure that an application will be able to run correctly when installed on UC-7420/7410, you must ensure that it is compiled and linked to the same libraries that will be present on the UC-7420/7410. This is particularly true when the RISC Xscale processor architecture of the UC-7420/7410 differs from the CISC x86 processor architecture of the host system, but it is also true if the processor architecture is the same.

The host tool chain that comes with UC-7420/7410 contains a suite of cross compilers and other tools, as well as the libraries and headers that are necessary to compile applications for UC-7420/7410. The host environment must be running Linux to install the UC-7420/7410 GNU Tool Chain. We have confirmed that the following Linux distributions can be used to install the tool chain:

Redhat 7.3/8.0/9.0, Fefora core 1 & 2.

The Tool Chain will need about 100 MB of hard disk space on your PC. The UC-7420/7410 Tool Chain is located on the UC-7420/7410 CD. To install the Tool Chain, insert the CD into your PC and then issue the following commands:

#mount /dev/cdrom /mnt/cdrom

#rpm –ivh /mnt/cdrom/mxscaleeb-3.3.2-1.386.rpm

Wait for a few minutes while the Tool Chain is installed automatically on your Linux PC. Once the host environment has been installed, add the directory /usr/local/mxscaleb/bin to your path and the directory /usr/local/mxscaleb/man to your manual path. You can do this temporarily for the current login session by issuing the following commands:

#export PATH=“/usr/local/mxscaleb/bin:$PATH”

#export MANPATH=“/usr/local/mxscaleb/man:$PATH”

Alternatively, you can add the same commands to $HOME/.bash_profile to cause it to take effect for all login sessions initiated by this user.

5-2

Image 78
Contents UC-7420/7410 User’s Manual Third Edition, JuneCopyright Notice TrademarksDisclaimer Table of Contents Chapter UC Finder Appendix B Windows Tool Chain Introduction Introduction ‰ Hardware IntroductionOverview Package ChecklistProduct Features UC-7410-LXProduct Hardware Specifications Appearance and Dimensions Hardware IntroductionAppearance Dimensions Hardware Block Diagram LED IndicatorsLED Name Color Meaning Reset to default Button Reset-type ButtonsReset Button Real Time ClockPlacement Options Wall or CabinetWiring Requirements Hardware Connection DescriptionDIN-Rail Mounting Pin Signal Connecting the PowerConnecting to the Network Grounding UC-7420/7410CompactFlash Connecting to a Serial DeviceConnecting to the Console Port Pin RS-232 RS-422 RS-485Software Introduction Software ArchitectureJournaling Flash File System JFFS2 Software PackageSoftware Version Comparison Table Protocol stacks and utilities Directory Change‰ Configuring the Ethernet Interface Getting StartedPowering on UC-7420/7410 Connecting UC-7420/7410 to a PCSerial Console 192.168.3.127 255.255.255.0 Default IP Address NetmaskTelnet Console 192.168.4.127 255.255.255.0SSH Console Windows UsersLinux Users Configuring the Ethernet InterfaceModifying Network Settings with the Serial Console Static IP addressesDynamic IP addresses Default IP address is 192.168.5.127, netmask Configuring the Wlan via the Pcmcia InterfaceModifying Network Settings over the Network IEEE802.11b#vi /etc/wlan/wlancfg-any IEEE802.11g Setting Explanation SettingKey1Str, Key2Str, Key3Str, Key4Str-Sets strings Key1 to Key4 TurboRate-Enables or disables TurboRate Checking the Flash Memory Space Installing the Tool Chain LinuxTest Program-Developing Hello.c StepCompiling Hello.c You should receive the following responseTesting Environment Developing Your First ApplicationUploading Hello to UC-7420/7410 and Running the Program Compiling tcps2.c #mount -t iso9660 /dev/cdrom /mnt/cdromUploading tcps2-release and Running the Program PuTTY#jobs // use this command to check if the program is running Testing Procedure Summary UC-7420/7410 User’s ManualUC-7420/7410 User’s Manual ‰ System Version Information ‰ System Image Backup Managing Embedded LinuxUpgrading the Firmware System Image BackupSystem Version Information Upgrading the firmware will erase all data on the Flash ROM#upramdisk #cd /mnt/ramdisk Loading Factory Defaults Backing Up the User File System Firmware versions earlier than V1.5 not includingFirmware version V1.5 and later versions Enabling and Disabling Daemons UC-7420/7410 User’s Manual Managing Embedded Linux Setting the Run-Level Adjusting the System Time Setting the Time ManuallyExample shell script to update the system time periodically NTP ClientUpdating the Time Automatically Enable the cron daemon manually Cron-daemon to Execute Scheduled CommandsChange mode of fixtime.sh Enable cron when the system boots upConnecting Peripherals USB Mass StorageCF Mass Storage Managing Communications ‰ Iptables ‰ NATEnabling the Telnet/ftp server Web Service-ApacheTelnet / FTP Disabling the Telnet/ftp serverUsr/www/cgi-bin Saving a Web Page to the CF Card Use the following commands to restart the Apache web server Iptables Local Host Packets Usage Observe and erase chain rulesDefine policy for chain rules ExamplesAppend or delete rules IptmacEnabling NAT at Bootup NAT ExampleDial-up Service-PPP Example 2 Connecting to a PPP server over a hard-wired link How to check the connection UP Loopback RunningNFS Network File System Setting up UC-7420/7410 as an NFS ServerSetting up a Machine for Incoming PPP Connections #vi /etc/exportsSetting up UC-7420/7410 as an NFS Client Mail Steps 2Open VPN Internet IFS=‘ Create link symbols to enable this script at boot time Destination Gateway Genmsk Flags Metric Use Iface Now ping Host B from Host a by typing Setup 3 Routed IP Destination Gateway Genmsk Flags Metric Use Iface Programmer’s Guide Address Size Contents Flash Memory MapLinux Tool Chain Introduction Cross Compiling Applications and Libraries Debugging with GDBObtaining help Tools Available in the Host EnvironmentDevice API RTC Real Time ClockBuzzer WDT Watch Dog Timer Input Int fd File handle from swtdopen return value Output Special Note User application example ExampleSwtddisableswtdfd Int mainint argc, char *argv Pidt sonpid Example to set the baud rate Example to get the baud rateSpecial Note KeyPadBaud rate inaccuracy ExamplesMake File Example UC Finder Installing the Software Windows UC FinderUC-7420/7410 User’s Manual UC Finder Broadcast Search Linux ucfinder File manager System CommandsBusybox V0.60.4 Linux normal command utility collection EditorProcess OtherMoxa special utilities Windows Tool Chain Introduction Introduction Installation Procedure Select the Root DirectoryUC-7420/7410 User’s Manual Windows Tool Chain Introduction UC-7420/7410 User’s Manual Windows Tool Chain Introduction Using the Bash Shell GDB debug tool-Insight UC-7420/7410 User’s Manual Windows Tool Chain IntroductionUC-7420/7410 User’s Manual Windows Tool Chain Introduction Service Information Moxa Internet Services Following services are providedProblem Report Form Moxa Product † UC-7410-LX † UC-7420-LX Serial NumberProduct Return Procedure