TS-4700: Difference between revisions

From embeddedTS Manuals
No edit summary
Line 19: Line 19:


= Getting Started =
= Getting Started =
{{:Generic Getting Started}}
The TS-4700 receives power through several pins on the socket connector.  Refer to your baseboard documentation or schematics for locating the power in on your board.
== Get a Console ==
Console on the TS-4700 will by default come out of the CPU uart (ttyS0).  If you hold the power button for 5 seconds it will redirect Console to xuart port 1 (the red LED will turn on when you have held it long enough).  You can find more details about where these UARTS are brought from your baseboard COM ports section.n  Either console will use 8n1, no flow control, and a 115200 baud rate.
You can also telnet to the board with the [[default network configuration]], though this will omit the [[TS-BOOTROM]] messages which can be helpful for diagnostics.
{{:Console from Workstation}}
== Initrd / Busybox / Fastboot ==
When the board first boots you should see output similar to this:
  >> TS-BOOTROM - built Aug  4 2011 12:52:20
  >> Copyright (c) 2010, Technologic Systems
  >> Booting from microSD card ...
  .
  .
  .
  >> Booted from: SD card                Booted in: 1.78 seconds
  >> SBC Model number: TS-4700            SBC Sub-model number: 0
  >> CPU clock rate: 797MHz              RAM size: 256MB
  >> NAND Flash size: 256MB              NAND Flash Type: 0xdcec (Samsung)
  >> MAC number: 00:D0:69:44:1A:E9        SBC FPGA Version: 4
  >> CPU Temperature: 49 degC            MODE1 bootstrap: OFF
  >> RTC present: YES                    Date and Time: Nov 17 2015 00:57:09
  >> Base board type: 62 RevD            Base board FPGA Version: 0x0
  >> MODE2 bootstrap: ON                  SD card size: 7788MB
  >> XUARTs detected: 7                  CAN present: NO
  >> Linux kernel version: 2.6.29-ts4700- Linux kernel date: Aug 23 2011
  >> Bootrom date: unknown                INITRD date: Sep 1 2011
  >> ts4700ctl date: Aug 22 2011          sdctl date: not present
  >> canctl date: not present            nandctl date: Aug 24 2011
  >> spiflashctl date: not present        xuartctl date: Aug 22 2011
  >> dioctl date: Aug 5 2010              spictl date: not present
  >> dmxctl date: Jul 23 2010            busybox date: Aug 12 2011 (v1.18.3)
  >> ts4700.subr date: Aug 23 2011        daqctl date: not present
  >> linuxrc date: Aug 23 2011            rootfs date: Sep 1 2011
  >> MBR date: Aug 23 2011
  Type 'tshelp' for help
  #
This is a busybox shell which presents you with a very minimalistic system.  This filesystem is loaded into memory, so none of the changes will be saved unless you type 'save', or mount a filesystem as read write.  This can also provide a simple mechanism for running your application in an entirely read only environment.  The linuxrc script will be the first thing executed as soon as the kernel is loaded.  This sets the default IP address, loads a reloadable FPGA bitstream if one is present, starts the userspace ctl applications, and more.  Read the linuxrc for more information.
While busybox itself doesn't contain much functionality, it does mount the [[Debian]] partition under /mnt/root/.  It will also add common paths and load libraries from the [[Debian]] system.  Many of the [[Debian]] applications will work by default.  If an application relies on certain paths being in certain places, or running services, you should instead boot to [[Debian]] to run them.
This shell when started on the COM port is what is blocking a [[Debian]] boot.  If you close it by typing 'exit', the boot process will continue.  If you are connected through telnet, this will instead open up its own instance of the shell so typing 'exit' will only end that session.  Through any connection method you can relink the linuxrc to change it to boot by default to Debian.
The initrd has these boot scripts available:
{| class="wikitable"
|-
! Script
! Function
|-
| linuxrc-fastboot (default)
| Boots immediately to a shell in ramdisk.  This will mount whichever boot medium you have selected to /mnt/root/.  When you type 'exit', it will boot to that medium.
|-
| linuxrc-nandmount
| Same as the linuxrc-fastboot script, but will mount and boot the debian partition from NAND.
|-
| linuxrc-sdmount
| Same as the linuxrc-fastboot script, but will mount and boot the debian partition from SD.
|-
| linuxrc-sdroot
| Boots immediately to the Debian stored on either SD or NAND depending on which device you have currently selected.
|-
| linuxrc-sdroot-readonly
| Same as linuxrc-sdroot, except it will mount the Debian partition read only while creating a unionfs with a ramdisk.  Changes will only happen in memory and not on disk.
|-
| linuxrc-usbroot
| Mounts the first partition of the first detected USB mass storage device and boots there.
|}
{{Note|Keep in mind the boot medium is selected by the pinout on your baseboard, not through software.}}
For example, to boot immediately to Debian on SD or NAND, you would run this:
<source lang=bash>
rm linuxrc; ln -s /linuxrc-sdroot /linuxrc; save
</source>
The small default initrd is only 2Mbyte but there is space for approximately 300 Kbyte of additional user applications. The binaries on the initrd are dynamically linked against embedded Linux's "uclibc" library instead of the more common Linux C library "glibc". "uclibc" is a smaller version of the standard C library optimized for embedded systems and requires a different set of GCC compiler tools which are available [ftp://ftp.embeddedarm.com/ts-socket-macrocontrollers/ts-4700-linux/cross-toolchains/crosstool-linux-arm-uclibc-4.3.5.tar.gz here].
The compiled instance of busybox includes several internal commands listed below:
  BusyBox v1.18.3 (2011-08-11 15:25:09 MST) multi-call binary.
  Copyright (C) 1998-2009 Erik Andersen, Rob Landley, Denys Vlasenko
  and others. Licensed under GPLv2.
  See source distribution for full notice.
 
  Usage: busybox [function] [arguments]...
    or: busybox --list[-full]
    or: function [arguments]...
 
          BusyBox is a multi-call binary that combines many common Unix
          utilities into a single executable.  Most people will create a
          link to busybox for each function they wish to use and BusyBox
          will act like whatever it was invoked as.
 
  Currently defined functions:
          [, [[, ar, ash, basename, cat, chat, chgrp, chmod, chown, chroot, chrt,
          cmp, cp, cpio, cttyhack, cut, date, dc, dd, depmod, devmem, df,
          dirname, dmesg, dnsdomainname, du, echo, egrep, env, expr, false,
          fdisk, fgrep, find, free, grep, gunzip, gzip, halt, head, hostname,
          hush, hwclock, ifconfig, insmod, ipcrm, ipcs, kill, killall, ln, login,
          ls, lsmod, lsusb, md5sum, mdev, microcom, mkdir, mkfifo, mknod,
          modinfo, modprobe, more, mount, mv, netstat, nohup, ping, pivot_root,
          poweroff, printf, ps, pwd, rdate, reboot, rm, rmdir, rmmod, route, rx,
          sed, seq, setconsole, setsid, sh, sha1sum, sha256sum, sha512sum, sleep,
          stty, sync, sysctl, tail, tar, tee, telnetd, test, tftp, time, top,
          touch, tr, true, udhcpc, umount, uname, unxz, unzip, uptime, usleep,
          uudecode, uuencode, vi, watch, wget, xargs, xz, xzcat, yes, zcat
Also on the initrd are the TS specific applications: [[dioctl]], [[dmxctl]], [[nandctl]], [[ts4700ctl]], and [[xuartctl]].  We also provide the ts4700.subr which provides the following functions:
  printbin()
  usbload()
  save()
  sdsave()
  nandsave()
  sd2nand()
  nand2sd()
  setdiopin()
  getdiopin()
  setout()
  getin()
  tshelp()
  gettemp()
  backlight_on()
  backlight_off()
  backlight_low()
  backlight_medium()
  backlight_high()
  speaker()
  do_splash()
By default, linuxrc will not insert the necessary modules into the kernel to mount and use USB devices within the initrd/busybox environment if there is no USB device present upon bootup (USB support is enabled by default within the Debian environment). The quickest way to get a USB device (like a USB thumb drive) to mount in the initrd/busybox environment is to ensure that it is plugged in before the SBC is powered up. In order to get hot-swappable USB devices regardless of device presence at bootup time, you must "modprobe" the necessary modules. This has been done for you in the ts4700.subr file with the usbload() function.
= Boot Process =
[[File:Socket-boot-diagram.png|400px|thumb|right|Boot Process]]
This board uses the [[TS-BOOTROM]] implemented in our FPGA.  When the board is powered on the FPGA checks the state of the boot jumpers, and then begins execution in the MBR of the selected storage device.  By default any boot device will have a kernel, and a ramdisk with busybox.  On the SD card and XNAND there is a copy of [[Debian]].

Revision as of 15:59, 20 September 2011

TS-4700
Ts-4700.jpg
Released Mar. 2011
Product Page
Documentation
Schematic
Mechanical Drawing
FTP Path

Overview

The TS-4700 is a TS-Socket Macrocontroller Computer on Module based on the Marvell PXA166 ARM9 CPU running at 800 MHz. The TS-4700 features 10/100 Ethernet, high speed USB host and device (OTG), microSD card, and 256 MB XNAND drive.

Getting Started

A Linux PC is recommended for development. For developers who use Windows, virtualized Linux using VMWare or similar are recommended in order to make the full power of Linux available. The developer will need to be comfortable with Linux anyway in order to work with embedded Linux on the target platform. The main reasons that Linux is useful are:

  • Linux filesystems on the microSD card can be accessed on the PC.
  • More ARM cross-compilers are available.
  • If recovery is needed, a bootable medium can be written.
  • A network filesystem can be served.
  • Builds such as Linux kernel, buildroot, yocto, distro-seed will not work from WSL1/2 on a case insensitive filesystem.
WARNING: Be sure to take appropriate Electrostatic Discharge (ESD) precautions. Disconnect the power source before moving, cabling, or performing any set up procedures. Inappropriate handling may cause damage to the board.

The TS-4700 receives power through several pins on the socket connector. Refer to your baseboard documentation or schematics for locating the power in on your board.

Get a Console

Console on the TS-4700 will by default come out of the CPU uart (ttyS0). If you hold the power button for 5 seconds it will redirect Console to xuart port 1 (the red LED will turn on when you have held it long enough). You can find more details about where these UARTS are brought from your baseboard COM ports section.n Either console will use 8n1, no flow control, and a 115200 baud rate.

You can also telnet to the board with the default network configuration, though this will omit the TS-BOOTROM messages which can be helpful for diagnostics.

Use a null modem cable to connect the ARM system to your workstation. If you do not have a COM port on your system (as many newer systems do not), you can find a USB serial adapter that will bring out RS232.

Console from Linux

There are many serial clients for Linux, but 3 simple ones would be picocom, screen, and minicom. These examples assume that your COM device is /dev/ttyUSB0 (common for USB adapters), but replace them with the COM device on your workstation.

Linux has a few applications capable of connecting to the board over serial. You can use any of these clients that may be installed or available in your workstation's package manager:

Picocom is a very small and simple client.

picocom -b 115200 /dev/ttyUSB0

Screen is a terminal multiplexer which happens to have serial support.

screen /dev/ttyUSB0 115200

Or a very commonly used client is minicom which is quite powerful:

minicom -s
  • Navigate to 'serial port setup'
  • Type "a" and change location of serial device to '/dev/ttyUSB0' then hit "enter"
  • If needed, modify the settings to match this and hit "esc" when done:
     E - Bps/Par/Bits          : 115200 8N1
     F - Hardware Flow Control : No
     G - Software Flow Control : No
  • Navigate to 'Save setup as dfl', hit "enter", and then "esc"

Console from Windows

Putty is a small simple client available for download here. Open up Device Manager to determine your console port. See the putty configuration image for more details.

Device Manager Putty Configuration

Initrd / Busybox / Fastboot

When the board first boots you should see output similar to this:

 >> TS-BOOTROM - built Aug  4 2011 12:52:20
 >> Copyright (c) 2010, Technologic Systems
 >> Booting from microSD card ...
 .
 .
 .
 >> Booted from: SD card                 Booted in: 1.78 seconds
 >> SBC Model number: TS-4700            SBC Sub-model number: 0
 >> CPU clock rate: 797MHz               RAM size: 256MB
 >> NAND Flash size: 256MB               NAND Flash Type: 0xdcec (Samsung)
 >> MAC number: 00:D0:69:44:1A:E9        SBC FPGA Version: 4
 >> CPU Temperature: 49 degC             MODE1 bootstrap: OFF
 >> RTC present: YES                     Date and Time: Nov 17 2015 00:57:09
 >> Base board type: 62 RevD             Base board FPGA Version: 0x0
 >> MODE2 bootstrap: ON                  SD card size: 7788MB
 >> XUARTs detected: 7                   CAN present: NO
 >> Linux kernel version: 2.6.29-ts4700- Linux kernel date: Aug 23 2011
 >> Bootrom date: unknown                INITRD date: Sep 1 2011
 >> ts4700ctl date: Aug 22 2011          sdctl date: not present
 >> canctl date: not present             nandctl date: Aug 24 2011
 >> spiflashctl date: not present        xuartctl date: Aug 22 2011
 >> dioctl date: Aug 5 2010              spictl date: not present
 >> dmxctl date: Jul 23 2010             busybox date: Aug 12 2011 (v1.18.3)
 >> ts4700.subr date: Aug 23 2011        daqctl date: not present
 >> linuxrc date: Aug 23 2011            rootfs date: Sep 1 2011
 >> MBR date: Aug 23 2011
 Type 'tshelp' for help
 # 

This is a busybox shell which presents you with a very minimalistic system. This filesystem is loaded into memory, so none of the changes will be saved unless you type 'save', or mount a filesystem as read write. This can also provide a simple mechanism for running your application in an entirely read only environment. The linuxrc script will be the first thing executed as soon as the kernel is loaded. This sets the default IP address, loads a reloadable FPGA bitstream if one is present, starts the userspace ctl applications, and more. Read the linuxrc for more information.

While busybox itself doesn't contain much functionality, it does mount the Debian partition under /mnt/root/. It will also add common paths and load libraries from the Debian system. Many of the Debian applications will work by default. If an application relies on certain paths being in certain places, or running services, you should instead boot to Debian to run them.

This shell when started on the COM port is what is blocking a Debian boot. If you close it by typing 'exit', the boot process will continue. If you are connected through telnet, this will instead open up its own instance of the shell so typing 'exit' will only end that session. Through any connection method you can relink the linuxrc to change it to boot by default to Debian.

The initrd has these boot scripts available:

Script Function
linuxrc-fastboot (default) Boots immediately to a shell in ramdisk. This will mount whichever boot medium you have selected to /mnt/root/. When you type 'exit', it will boot to that medium.
linuxrc-nandmount Same as the linuxrc-fastboot script, but will mount and boot the debian partition from NAND.
linuxrc-sdmount Same as the linuxrc-fastboot script, but will mount and boot the debian partition from SD.
linuxrc-sdroot Boots immediately to the Debian stored on either SD or NAND depending on which device you have currently selected.
linuxrc-sdroot-readonly Same as linuxrc-sdroot, except it will mount the Debian partition read only while creating a unionfs with a ramdisk. Changes will only happen in memory and not on disk.
linuxrc-usbroot Mounts the first partition of the first detected USB mass storage device and boots there.
Note: Keep in mind the boot medium is selected by the pinout on your baseboard, not through software.

For example, to boot immediately to Debian on SD or NAND, you would run this:

rm linuxrc; ln -s /linuxrc-sdroot /linuxrc; save

The small default initrd is only 2Mbyte but there is space for approximately 300 Kbyte of additional user applications. The binaries on the initrd are dynamically linked against embedded Linux's "uclibc" library instead of the more common Linux C library "glibc". "uclibc" is a smaller version of the standard C library optimized for embedded systems and requires a different set of GCC compiler tools which are available here.

The compiled instance of busybox includes several internal commands listed below:

 BusyBox v1.18.3 (2011-08-11 15:25:09 MST) multi-call binary.
 Copyright (C) 1998-2009 Erik Andersen, Rob Landley, Denys Vlasenko
 and others. Licensed under GPLv2.
 See source distribution for full notice.
 
 Usage: busybox [function] [arguments]...
    or: busybox --list[-full]
    or: function [arguments]...
 
         BusyBox is a multi-call binary that combines many common Unix
         utilities into a single executable.  Most people will create a
         link to busybox for each function they wish to use and BusyBox
         will act like whatever it was invoked as.
 
 Currently defined functions:
         [, [[, ar, ash, basename, cat, chat, chgrp, chmod, chown, chroot, chrt,
         cmp, cp, cpio, cttyhack, cut, date, dc, dd, depmod, devmem, df,
         dirname, dmesg, dnsdomainname, du, echo, egrep, env, expr, false,
         fdisk, fgrep, find, free, grep, gunzip, gzip, halt, head, hostname,
         hush, hwclock, ifconfig, insmod, ipcrm, ipcs, kill, killall, ln, login,
         ls, lsmod, lsusb, md5sum, mdev, microcom, mkdir, mkfifo, mknod,
         modinfo, modprobe, more, mount, mv, netstat, nohup, ping, pivot_root,
         poweroff, printf, ps, pwd, rdate, reboot, rm, rmdir, rmmod, route, rx,
         sed, seq, setconsole, setsid, sh, sha1sum, sha256sum, sha512sum, sleep,
         stty, sync, sysctl, tail, tar, tee, telnetd, test, tftp, time, top,
         touch, tr, true, udhcpc, umount, uname, unxz, unzip, uptime, usleep,
         uudecode, uuencode, vi, watch, wget, xargs, xz, xzcat, yes, zcat


Also on the initrd are the TS specific applications: dioctl, dmxctl, nandctl, ts4700ctl, and xuartctl. We also provide the ts4700.subr which provides the following functions:

 printbin()
 usbload()
 save()
 sdsave()
 nandsave()
 sd2nand()
 nand2sd()
 setdiopin()
 getdiopin()
 setout()
 getin()
 tshelp()
 gettemp()
 backlight_on()
 backlight_off()
 backlight_low()
 backlight_medium()
 backlight_high()
 speaker()
 do_splash()

By default, linuxrc will not insert the necessary modules into the kernel to mount and use USB devices within the initrd/busybox environment if there is no USB device present upon bootup (USB support is enabled by default within the Debian environment). The quickest way to get a USB device (like a USB thumb drive) to mount in the initrd/busybox environment is to ensure that it is plugged in before the SBC is powered up. In order to get hot-swappable USB devices regardless of device presence at bootup time, you must "modprobe" the necessary modules. This has been done for you in the ts4700.subr file with the usbload() function.

Boot Process

Boot Process

This board uses the TS-BOOTROM implemented in our FPGA. When the board is powered on the FPGA checks the state of the boot jumpers, and then begins execution in the MBR of the selected storage device. By default any boot device will have a kernel, and a ramdisk with busybox. On the SD card and XNAND there is a copy of Debian.