Technologic Systems FAQ
revision 2008-4-2 14:30

1. I tried running some of the commands you gave me and they didn't work.  Why not?
2. How do I program in Linux?  How do I compile my program? Why am I have this problem with Debian? How do I write code for an FPGA?  How do I build a board to interface with the PC-104 bus?
3. I sent an e-mail but nobody responded.  Why?
4. Do you offer a student discount?
5. How do I create my own Compact Flash / SD card / USB flash drive with Debian Linux and the full ARM toolchain?
6. The EP9302 has interfaces for AC '97 and I2S.  Can I use these on any of the TS-7XXX boards?
7. How do I load a new bitstream on the TS-7350/TS-7370/TS-7390?
8. How do I control the power management features on the TS-7260?
9. How do I cross-compile the Linux kernel you provide?
10. Why can't I log in to my TS-7XXX running Debian using telnet or ssh?


SD card related items
11. Why are there three partitions on the SD card for the TS-7300/TS-7400/TS-7260?  What are they for?
12. How can I edit the files on the initial ramdisk on my TS-7300/TS-7400/TS-7260 SD card from my PC?
13.
How do I create an SD card for the TS-7300/TS-7400/TS-7260?
14.
How does the boot process work on the TS-7400/TS-7800 regarding booting from on-board flash versus the SD card?
15. How can I quickly install my own software on the TS-7400/TS-7800?
16. On the TS-7800 (Linux 2.6), why can't I see new devices after I load the modules for them?


1. I tried running some of the commands you gave me and they didn't work.  Why not?


Here are some things to keep in mind:

1. When running some of these commands, you may need to be 'root'.
2. Whenever we use a device file beginning with "/dev/sda" we are referring to the device that the SD card shows up at on your Linux PC.  Depending on which distro you use this device file might be different; please consult dmesg and your /dev tree as needed and replace all occurences of "/dev/sda" with the proper device file as needed when running any of the commands listed below.
3. You may need make other changes to the commands shown to make them run on your system.  For instance if the path says "whatever-path-to" you will need to replace that with whatever the actual path is where you put the file.  If in doubt, consult your local Linux guru.
4. Some Linux distributions will auto-mount removable media when you plug it in.  You may need to manually unmount auto-mounted media to avoid corruption and/or avoid ejection of the device node.

2. How do I program in Linux?  How do I compile my program?  Why am I have this problem with Debian? How do I write code for an FPGA?  How do I build a board to interface with the PC-104 bus?

These types of questions are beyond the scope of the technical support we can provide.  There are a number of good resources on the web that may assist you in answering these types of questions.  Google is a good place to start.  For general Linux questions you might also try these links:

http://tldp.org/LDP/intro-linux/html/index.html
http://tldp.org/LDP/GNU-Linux-Tools-Summary/html/index.html
http://www.us.debian.org/doc/manuals/reference/


3. I sent an e-mail but nobody responded.  Why?

There are a couple possible reasons that we are aware of.  One that is surprisingly frequent is that there was a problem with the e-mail system, either your e-mail did not reach us, or our reply did not reach you.    Another is that your e-mail was received, but was not replied to because either the person to whom the e-mail was ultimately directed was out of the office, or because it has not reached the front of their queue yet.

Generally you should expect to receive a reply to e-mail within one or two business days.  If you do not, you may want to consider re-sending from a different e-mail address, in case there is a problem with the e-mail system.   For pressing matters you can always call or fax; if your time zone does not permit calling during our normal business hours you should be able to leave a message.


4. Do you offer a student discount?

We do not offer a student discount per se.  However, quantity discounts are available for as few as ten units.  In an educational setting a class using a particular board could thus achieve an effective student discount simply by placing a single quantity order. If you are interested, please call, fax or contact sales@embeddedARM.com to place a request for quotation.


5. How do I create my own Compact Flash / SD card / USB flash drive with Debian Linux and the full ARM toolchain?

Creating the toolchain and Debian Linux on flash media consists of the following steps:
  1. Preparing the flash media
    1. make sure the media contains a single partition of type 83 (Linux)
    2. format the partition using mke2fs
  2. Obtaining the Debian tarball
    1. On the CD it is in /distributions/debian-sarge-256MB-05-01-2006.tar.bz
    2. Or, download from ftp://ftp.embeddedarm.com/ts-arm-linux-cd/distributions/debian-sarge-256MB-05-01-2006.tar.bz2
  3. Unpacking the tarball onto the flash media.
    1. mount the partition created in step 1
    2. cd to the mount point
    3. untar ('tar -xjf') the debian tarball
    4. cd away from the mount point, unmount the partition, and wait for the filesystem to finish flushing any remaining data to the flash media
6. The EP9302 has interfaces for AC '97 and I2S. Can I use these on any of the TS-7XXX boards?

The AC97 and I2S features of the EP9302 are not available (brought out to pins anywhere) on any of the TS-7XXX boards except for the TS-7400.  The reason for this was that we found it generally to be easier and cheaper to develop audio solutions based on USB.

7. How do I load a new bitstream on the TS-7350/TS-7370/TS-7390?

There are some guidelines and sample script code available.

8. How do I control the power management features on the TS-7260?

This is documented in the TS-7260 User's Manual, on page 40-41.

9. How do I cross-compile the Linux kernel you provide?

First, download the kernel.  For example, the latest 2.4 version is located here:
ftp://ftp.embeddedarm.com/ts-arm-linux-cd/sources/tskernel-2.4.26-ts11-src.tar.gz

Next, download the appropriate toolchain.  Certain versions of gcc don't play well with certain kernel versions, so for example the above kernel requires the toolchain here if you are compiling on a Linux PC:
ftp://ftp.embeddedarm.com/ts-arm-linux-cd/cross-toolchains/crosstool-linux-gcc-3.3.4-glibc-2.3.2-0.28rc39.tar.bz2

The kernel and toolchain can be installed anywhere that is convenient to you, simply by un-tarring them.   When you run gcc you will specify the full path to wherever it is installed and it will figure out where all the other files it needs are relative to that path.

Once you have downloaded and installed the kernel and cross-compiler toolchain there are a few steps to set up the kernel for compilation.

First, edit the top-level Makefile for the kernel.  This is in the same directory which contains files such as "COPYING", and "CREDITS", and directories like "Documentation", "drivers", "fs", and "include".  Find the line that says CROSS_COMPILE and using the default value as a guide modify it to point to the correct location for your cross-compiler.

Next you will need to configure the kernel for your hardware.  For example, if you have a TS-7260, you will need to type:

make ts7260_config
If you have another board, substitute it's name accordingly (e.g. ts7200, ts7250, ts7300, etc.)  When that is done, then type:

make oldconfig
make dep

Now the kernel should be set up for compiling and you should make able to just type "make" and it should build the kernel.  Or you can try "make bzImage" for a compressed kernel, or "make modules" to just make modules.
 

10. Why can't I log in to my TS-7XXX running Debian using telnet or ssh?

By default Debian restricts access in order to try to make the system more secure.  This includes things like denying remote login to root without a password.

To enable telnet access to root with no password:
TODO

To enable ssh access to root with no password:
TODO

If everything has been configured ok but you still cannot connect it may also be that telnetd and sshd are not running and need to be started.

11.Why are there three partitions on the SD card for the TS-7300/TS-7400/TS-7260?  What are they for?

These are three partitions: the first partition contains the kernel, the second contains an initial ramdisk (initrd) and the third contains the root filesystem.

The filesystem type of the first two partitions is "0xDA" (non-fs data).    For the kernel, this is because we copy a raw kernel image without a filesystem to the partition.  For the initrd we do have an ext2 partition, but at one time the initrd was compressed and thus was not directly readable as a filesystem.

The reason for the three partitions has to do with the boot process.  During the boot process, the kernel and initrd are loaded into memory.  Then the kernel is started, with the initrd as the root filesystem.  A kernel module is loaded to provide access to the SD card, which is mounted read-only. This is where the fastboot process stops.  The full-boot sequence then does a "pivot-root" to the filesystem on partition 3 of the SD card and starts the full Debian init sequence.

12.How can I edit the files on the initial ramdisk on my TS-7300/TS-7400/TS-7260 SD card from my PC?

Assuming your initrd is uncompressed:

mount /dev/sda2 /mnt # edit files as needed umount /mnt


(Note: replace "/mnt" with whatever mount point you want to use.)

If you have a compressed initrd you will need to dd the partition to your PC, then uncompress it, and the mount the uncompressed image through the loop interface. (-o loop)

13.How do I create an SD card for the TS-7300/TS-7400/TS-7260?

One way to do this is documented here:
http://www.embeddedarm.com/epc/fastboot.htm

If all you need to do is fix a corrupted partition on your SD card, you may be able to follow a simpler process.  Note that in the examples below several files have the same name, because they are symlinks to the latest version of a file in different directories.  You may wish to rename the files (and substitute the new names in the commands below) after downloading to avoid confusion.

If you want to restore the root filesystem, download the latest tarball from here:
ftp://ftp.embeddedarm.com/images/debian/sd_default

Then mount the SD card on your PC using:
mount /dev/sda3 /mnt

If the mount command fails, this could indicate the filesystem was corrupted in which case you would need to re-create using the command below followed by the above mount command again:

mke2fs /dev/sda3

Once the partition is mounted, untar the file you downloaded to it.  Be sure to do this as root!

cd mnt;tar -xf /whatever-path-to/sd_default cd;umount /mnt

If you want to restore the initial ramdisk you can download it from:
ftp://ftp.embeddedarm.com/images/initrd/sd_default

You can copy it to partition two on the SD card using a command-line similiar to this:
dd if=sd_default of=/dev/sda2 bs=65536


If you want to restore the kernel you can download it from:
ftp://ftp.embeddedarm.com/images/initrd/sd_default

Or you can install your own custom compiled kernel instead!

You can copy it to partition one using a command-line similiar to this:
dd if=sd_default of=/dev/sda1 bs=65536
14. How does the boot process work on the TS-7400/TS-7800 regarding booting from on-board flash versus the SD card?

The process is slightly different for both boards.

On the TS-7400 there is a different bootrom which either loads from the SD card or from the on-board flash.  You can change which bootrom is present by running the tsbootrom-update command with the arguments specifying which bootrom you want.
On the TS-7800 the bootrom looks at JP1.  If it is on, then it tries first to boot from the micro-SD card and if that fails it tries to boot from the SD card, otherwise it boots from the on-board flash.


However the above only holds for the fastboot portion of the boot load.  One you reach the initial ramdisk, what happens next depends on the contents of the initrd.  For the factory initrd, the /linuxrc file is a symlink to one of several scripts:
linuxrc-fastboot - when /linuxrc is linked to this script, the board will stop at the fastboot environment until the shell is exited.  At that time...
linuxrc-mtdroot - when /linuxrc is linked to this script, the board will pivot the root filesystem to the onboard flash and start the init sequence from there.
linuxrc-sdroot - when /linuxrc is linked to this script, the board will pivot the root filesystem to the SD card and start the init sequence from there.


So, depending on how your board is set up, there are at least four possible ways you can do a full-boot out of the box:

bootrom/JP1
on-board flash /linuxrc
SD card /linuxrc
kernel loaded from
root filesystem on
flashboot/off or no SD
/linuxrc-mtdroot don't care
on-board flash
on-board flash
flashboot/off or no SD
/linuxrc-sdroot don't care
on-board flash
SD card
sdboot/on, good SD
don't care
/linuxrc-mtdroot SD card
on-board flash
sdboot/on, good SD
don't care
/linuxrc-sdroot SD card
SD card

Note: the above is probably incorrect.  According to Eddie, if we boot to the SD card on the TS-7400, it will always root to the SD card unless we modified the initrd.  TODO: try this out and see what actually happens.

15. How can I quickly install my own software on the TS-7300/TS-7400/TS-7800?

Create an executable script called "/tsinit" in the root directory of a single partition ext2 formatted USB flash drive, and plug the drive into the bottom USB port before powering up.  When the board boots it will find this file, and will run this script.  You can write the script to install any software you like from the USB flash, providing a way to conveniently and reproducably bring one or more boards to a desired state without having to connect anything else to the board.  On the TS-7300/TS-7400 the red LED will be lit during execution of the /tsinit script.

16. On the TS-7800 (Linux 2.6), why can't I see new devices after I load the modules for them?

The udev sub-system is not running.  Early boards did not enable udev due to some driver bugs that interacted with udev to create random corruption.  If a device doesn't show up, you can manually refresh the /dev entries with the command:
mdev -s