About MoxaProductsSolutionsSupport & ServiceNews & EventsWhere to BuyPartner Zone
You are here: Home > Embedded Computing > Technical FAQs
  Technical FAQs  
 
  Embedded Computing Home
  What is Embedded Computing?
  Essentials of Embedded Linux
  Typical Applications
  Product Comparison
 

Technical FAQs

  Request a Price


Request Support from an engineer
Technical FAQs for UC-7110 Series
Why can I use vfork( ), but cannot use fork( )?
When using a pthread group API, why can’t I use SIGUSR1 and SIGUSR2?
What is the correct format for linking to an AP?
What stack size can I use when creating a user application?
How do I compress an application program?
Since UC-7110’s tool chain currently does not support GDB server, how do I disable a function by using the Makefile example to generate the gdb file?
How can I get the Serial Number or MAC address of a UC-7110's LAN1 and LAN2 with AP software running on the UC-7110?
How much space is available for program and storage?

Technical FAQs for UC-7400 Series
How much space is available for program and storage?
How much Flash memory is available when using UC-7400 series? Do the DRAM Flash and Compact Flash have different purposes?
What does the Compact Flash port support?
How do I format the CF card from UC-7420?
What does the PCMCIA port support?
How do I check the version number of the UC-7400 series Kernel and File System?
What does the UC-7400 series tool chain include?
How do I send e-mail?
How do I use GDB (GNU Debugger) from the UC Linux tool chain?
When using UC, how do I disable the Telnet connection and replace it with an ssh connection?
How to synchronize system time to real time clock (RTC) manually?
How to modify the default gateway or IP setting on UC-7420 and UC-7110?
How do I use NFS server/client with UC?
How am I able to change the lithium mercury cell?

Technical FAQs for UC-7110
[UC-7110] Why can I use vfork( ), but cannot use fork( )?
uClinux only supports vfork( ). It does not support fork( ). Note that when using vfork( ), the parent process will hang until the son process calls an exec group API, or exits.
Top
[UC-7110] When using a pthread group API, why can’t I use SIGUSR1 and SIGUSR2?
Since a pthread group API uses SIGUSR1 and SIGUSR2 to do a pthread control suspend, restart exit function, we cannot use the SIGUSR1 and SIGUSR2 signals. You will get the same result if you link the pthread. This means that you cannot use -1pthred to add an option to the linker.
Top
[UC-7110] What is the correct format for linking to an AP?
arm-elf-gcc -W1, -elf2flt(In this example, the AP converts elf format to flat format.)
Top
[UC-7110] What stack size can I use when creating a user application?

First note that UC-7110 is not an MMU processor. The OS is uClinux, so you must transfer your application from ELF to FLAT format. The transfer utility (on the PC) assigns a stack size of 0x1000 by default. If your application needs a bigger stack size, you must use an option that specifies stack size when transferring the application from ELF to FLAT format. The following LDFLAGS shows how to write the stack size option:

LDFLAGS = -g,-Wl,-T,/usr/local/arm-elf/lib/elf2flt.ld-elf2flt= "-s 32768"

You can combine this with a compress option. E.g., LDFLAGS = -g,-Wl,-T,/usr/local/arm-elf/lib/elf2flt.ld-elf2flt= "-z -r -s 32768"

Refer to the next Technical FAQs for compress options.

Keep in mind that the stack size must be indicated in decimal format. You cannot use hex format (i.e., numbers that begin with "0x"). The following LDFLAGS command will fail:LDFLAGS = -g,-Wl,-T,/usr/local/arm-elf/lib/elf2flt.ld-elf2flt= "-s 0x2000"

Use the ‘flthdr’ utility (on a PC) to check the current stack size

Top
[UC-7110] How do I compress an application program?

UC-7110’s kernel supports ZFLAT format files. This means that when you compile the program, you can add the compress option to reduce the size of the binary file. Doing so will reduce the required flash space on the user disk. The disadvantage of using the compress option is that it takes about 5% to 10% more time when loading the program from Flash to RAM. After uncompressing and loading the program to RAM, there is no difference. You just need to modify the makefile, LDFLAGS, as follows:

LDFLAGS = -g,-WI,-T,/usr/local/arm-elf/lib/elf2flt.ld -elf2flt= “-z –r”

NOTE: The user directory’s JFFS2 file system also has a compress function. If you compile the program with the ZFLAT feature, the file will only be compressed by an additional 5% to 10% when you copy the program into JFFS2 Flash.

Top
[UC-7110] Since UC-7110's tool chain currently does not support GDB server, how do I disable a
   function by using the Makefile example to generate the gdb file?

Edit the file /usr/local/arm-elf/bin/ld on the PC Linux platform. Add one line after line 133 (the content of line 133 is: rm –f $OFILE.elf #not needed for any reason) as follows: rm –f $OFILE.gdb. I.e., after you edit the file lines 133 and 134 will look like:

Line 133: rm –f $OFILE.elf #not needed for any reason

Line 134: rm –f $OFILE.gdb

 

Top
[UC-7110] How can I get the Serial Number or MAC address of a UC-7110's LAN1 and LAN2 with AP software running on the UC-7110?

To get this information, use a program that accesses the flash memory directly.
The address is specified as follows:

1. Serial Number : 0x8000004c
2. MAC address of LAN1: 0x80000050
3. MAC address of LAN2: 0x80000056

A simple example and Makefile are shown below:

[Example]
#include <stdio.h>
#include <stdlib.h>
#define FLASH_BASE_ADDR 0x80000000
#define MAC_ADDR_LEN 6
#define SNO_ADDR (FLASH_BASE_ADDR + 0x4C)
#define LAN1_MAC_ADDR (SNO_ADDR + 4)
#define LAN2_MAC_ADDR (LAN1_MAC_ADDR + MAC_ADDR_LEN)

int main(int argc, char *argv[])
{
int sno, i;
char *ptr;
sno = *(int *)SNO_ADDR;
printf("The serial number is %d.\n", sno);
printf("The LAN1 mac address is following :\n");
for ( i=0, ptr=(char *)LAN1_MAC_ADDR; i<MAC_ADDR_LEN; i++, ptr++ ) {
printf("%02X ", *ptr);
}
printf("\n");
printf("The LAN2 mac address is following :\n");
for ( i=0, ptr=(char *)LAN2_MAC_ADDR; i<MAC_ADDR_LEN; i++, ptr++ ) {
printf("%02X ", *ptr);
}
printf("\n");
exit(0);
}
[Make File]
LDFLAGS = -g,-Wl,-T,/usr/local/arm-elf/lib/elf2flt.ld -elf2flt
LIBS =
CFLAGS = -g -O2 -pipe -Wall
CC = /usr/local/bin/arm-elf-gcc
LD = /usr/local/bin/arm-elf-ld
all : rsno
rsno: rsno.o
$(CC) -o $@ $^ $(LDFLAGS) $(LIBS)
rsno.o: rsno.c
$(CC) -c $^ $(CFLAGS)

Top
[UC-7110] How much space is available for program and storage?

For UC-7110 Series:

16 MB RAM (about 12 MB of user programmable space);
8 MB Flash ROM (about 4 MB for user storage; the path is at /home).

Top

Technical FAQss for UC-7400
[UC-7400] How much space is available for program and storage?

UC-7400 Series: 32 MB Flash and 128 MB RAM. When Linux is loaded, the total flash space is about 25 MB. However, we suggest that you do not exceed 20 MB.

Top
[UC-7400] How much Flash memory is available when using UC-7400 series? Do the DRAM Flash and Compact Flash have different purposes?

Flash and Compact Flash can be used for both the application program and data storage, but SDRAM is only used for the application program.

Appendix B in the user's manual mentions that 26 MB of storage space is for the user’s file system (JFFS2). However, after installing the system, it might occupy about 30% of the storage space. For this reason, about 17 MB of space will be available

In addition, the df command will be useful. For a system that is running, information about the partitions can be displayed using the df command (which stands for disk full). In Linux, df is the GNU version, and supports the -h, or human readable option, which greatly improves readability.

Top
[UC-7420] What does the Compact Flash port support?

For UC-7420:

1. Compact Flash supports storage cards. For example, Sandisk 64/128/256 MB (up to 4 GB).
2. Compact Flash supports VFAT/EXT2.Note that the default mount point is /mnt/had

Top
[UC-7420] How do I format the CF card from UC-7420?

When purchasing a new CF card from a retail shop, it is not necessary to reformat the file system. The UC series does not provide a format function if you would like to format the CF card from the UC-7420. Instead, use the PC host to format with FAT or Ext2 file system.

Top
[UC-7420] What does the PCMCIA port support?

For UC-7420:

PCMCIA is designed for Wireless LAN card expansion.
IEEE802.11b
The following IEEE802.11b wireless modules are supported:

  • NDC NWH1010
  • Senao NL-2511CD PLUS(F200)
  • Senao NL-2511CD PLUS EXT2
  • MERCURY (ETSI)
  • Senao NI3-2511CD-PLUS3DARK DKW11-330HP
  • DARK XI-330H l Planex (PCI)
  • GW-NS11H
  • Corega CG-WLPCCL-11
  • IEEE802.11g
    The following IEEE802.11g wireless module is supported:

  • GigaByte GN-WMGK
  • Top
    [UC-7400] How do I check the version number of the UC-7400 series Kernel and File System?

    Use the commands below to check the version number of the kernel and file system:

    Use this command to check the kernel version:
    #kversion

    Use this command to check the file system version:
    #fsversion

    Top
    [UC-7400] What does the UC-7400 series tool chain include?

    1. GCC (V3.3.2): C/C++ PC Cross Complier
    2. GDB (V3.2.1): Source Level Debug Client
    3. Glibc: POSIX standard Library

    Note: Tool-chain is for Linux 2.4.18 systems only

    Top
    [UC-7400] How do I send e-mail?

    1. You can send e-mail using the 'smtpclient' utility by SMTP protocol.
    Type 'smtpclient -help' to get the help message.

    2. Example:
    #smtpclient -s test -f sender@moxa.com.tw -S 192.168.1.12
    recevier@moxa.com.tw

    < mail-body-message
    .

    - s is the subject

    - f is sender mail address

    - S is the SMTP server IP address

    You must end with a single ' . ' character.

    Top
    [UC-7400] How do I use GDB (GNU Debugger) from the UC Linux tool chain?

    An introduction to the GDB debugger

    Most flavors of Linux come with the GDB debugger. GDB lets you see the internal structure of a program, print out variable values, set breakpoints and single step through source code.

    It is an extremely powerful tool for fixing problems in the program code. In this Technical FAQs, we will show how GDB works with UC so that you can use GDB to debug programs written in C and C++.

    1. GDB System Diagram:

    2.Installation Procedure:
    PC RH Linux 7.3/8.0:
    1. Compile with ¡Vggdb (makefile)
    2. Start DDD Tool with GDB Client
    3. Target remote to GDB Server

    UC:
    1. Start GDB Debug Server

    3. Example: Hello-debug
    PC side (192.168.12.188)
    1. Install Tool-chain first.
    Note: requires more than 350 MB of available disk space
    2. Compile hello.c with the ¡Vggdb option, creates hello-debug.
    3. Use the following command to set read, write, and execute permissions for all
    users and all groups:
    # chmod +x hello-debug
    4.Upload hello-debug to the UC unit.

    UC side (192.168.12.227):
    1) Start GDB Server to listen for GDB Client
    # gdbserver 192.168.12.188:2000 hello-debug (*TCP port is defined by user)

    PC side (192.168.12.188)
    1.Set path
    # PATH=/usr/local/mxscaleb/bin:$PATH
    2.Start DDD with GDB Client in X-Window
    # ddd -¡Vdebugger mxscaleb-gdb hello-debug &

    3.With DDD, establishing connection between PC and UC.
    # target remote 192.168.12.100:2000

    UC side (192.168.12.227):
    The following message will appear in the UC screen:

    Top
    [UC-7400] When using UC, how do I disable the Telnet connection and replace it with an ssh
       connection?

    In the UC:
    1. The shh and Telnet services are enabled by default in UC. To check this, issue the command: #netstat -a

    2. If you want to disable the Telnet service for security considerations, you should edit the file ''inetd.conf'' by typing the command #vi /etc/inetd.conf. Comment out the Telnet line by typing the pound sign (#) at the beginning of the line.

    When you have done, restart inet service. The telnet service will no longer be available in UC# /etc/rc.d/init.d/inetd restart

    3. In addition, the configuration of the ssh server is done in the file /etc/ssh/sshd_config. If you changed the configuration, or the service was shut down, you should restart the daemon by issuing the following command:
    #/etc/rc.d/init.d/ssh restart

    In the Client:
    1. To establish an ssh connection in a client, you should type:
    # ssh user@hostname ex: #ssh root@192.168.x.x
    or # ssh - l user hostname ex: #ssh - l root 192.168.x.x
    2. By using an ssh connection, your connection to the Internet via UC will be safer.

    Top
    [UC-7420][UC-7110] How to synchronize system time to real time clock (RTC) manually?

    1. Access the UC-7420/UC-7110.
    2. Adjust the month, date, time, and year, by typing "date MM-DD-hh-mm-YYYY" to modify the time. For example:
    # date 032912102005
    3. After modifying the date and time, type the following command to synchronize the system time and real time clock manually.
    # hwclock -systohc

    Top
    [UC-7420] [UC-7110] How to modify the default gateway or IP setting on UC-7420 and UC-7110?

    UC-7420:
    1. Access UC-7420 serial console.
    2. Edit the content of ixp0 or ixp1.
    3. Type "# ifdown ixp0" to stop Ethernet interface.
    4. vi /etc/network/interfaces
    For instance, I would like to add a default gateway 192.168.15.254
    Add "netmask 255.255.248.0", "gateway 192.168.15.254"
    Please refer to the red mark.
    5. Type "#ifup ixp0" to boot up Ethernet interface.

    UC-7110:
    1. Access UC-7110 serial console.
    2. vi /etc/rc
    3. Edit the content of configuration.
    For instance, I would like to add a default gateway 192.168.15.254
    Add "netmask 255.255.248.0", "route add default gw 192.168.15.154"
    Please refer to the red mark.

    4. Type "#sh /etc/rc" to make the modification available.

    Top
    [UC-7400] How do I use NFS server/client with UC?

    1.Take the following steps to set up an NFS server:
    a. The default is enabled. The service is at /etc/init.d/nfs-user-server. You can find
    the link file, S25nfs-user-server, in the folder /etc/rc.d/rc2.d-rc5.d.

    b. Next, edit the file /etc/exports to open the shared folder. The file format is as follows:
    Export-directory allowed-ip (rw)
    ex: /root/tmp/test 192.168.12.*(rw,no_root_squash,no_all_squash)

    c. Restart the NFS server to activate the changes.

    d. Use the #showmount command to confirm that the shared folder is available on UC.
    At this point, you should be able to mount the NFS client.

    2. Take the following steps to set up an NFS client:
    Use the following commands:

    #mount -t nfs remote-ip:/remote-directory local-directory
    ex: #mount -t nfs 192.168.12.171:/root/tmp/test /mnt/test

    remote-ip: the remote IP address you want to mount.
    remote-directory: the remote server export directory.
    local-directory: the target directory that you want to mount.

    Top
    [UC-7400] How am I able to change the lithium mercury cell?

    There is a lithium mercury battery in the NPort/UC series products supplying power for the internal RTC (Real Time Clock). The battery can work for almost 10. If customers need to change the malfunctioned battery, please contact Moxa RMA Team and DO NOT change the battery by you.

    Top
    Home | About Moxa | Products | Solutions | Support & Service | News & Events | Partner Zone | Where to Buy | Contact Moxa | Sitemap