Practical Guide to Getting Started with the TS-7670

This practical guide gives us an opportunity to take a relaxed approach to getting started with the TS-7670 single board computer. We’re going to take a look at how to make our first connections, and setup the network. These are usually the first things we do before starting development. In the grand scheme of things, this is just a friendlier extrapolation from the official TS-7670 manual, so be sure to keep it handy for more advanced topics and specific details. The only assumption being made is that you’ve purchased the TS-7670 with a development kit, including the pre-programmed microSD card. Right then, let’s get started!

Connections and Jumpers

Let’s take a look at the most basic of connections: serial console, power, and Ethernet. Follow along in order and we’ll be ready for the next section when we actually apply power and start using the TS-7670.

If you have the enclosure, you’ll notice all these connections are available externally, but you’ll want to unscrew the four screws on the bottom of the enclosure to get to the jumper block, microSD card, and other guts.

Jumpers

Out of the box, the TS-7670 has it’s jumpers set to boot from the onboard eMMC flash (JP2 is a user jumper hooked up to a DIO and TERM enables a RS-485 termination resistor). Certainly, it depends on your preferences when it comes to setup for development, but we’re going to go with the jumper configuration you see in the image above. That is, we will boot to the SD card. This is generally easier to develop from, as files can be easily restored or altered from a development computer if something should go wrong.

Serial Console

Nothing beats a good ‘ol serial console for direct access to an embedded system. Where others like telnet and SSH might fail due to bad startup scripts or network snafus, a direct serial console connection will always be there to bail you out. For this, you’ll simply need an A/B USB cable (included in development kit). No need to deal with NULL modem cables or USB to serial adapters in this case. Just a clean, single cable solution.

It’s recommended that you work from a Linux development machine. Not only are the serial port drivers already installed, but you’ll also need it if you plan on using our cross compile toolchains for a larger project later on. For now, if you’re on a Windows or Mac OSX machine, you can obtain the serial port drivers from the Silicon Labs USB-to-UART drivers page.

Next step is to connect the USB cable to your computer and follow the instructions given in the “Get a Console” section of the TS-7670 manual. This author’s preference is minicom , a no-frills, cross-platform serial communications program. Basically, we’re setting the baud rate to be 115200 with 8N1 parity, no hardware or software flow control. Typically, your serial device name may be:

  • Linux, /dev/ttyUSB0
  • Mac OSX, /dev/tty.SLAB_USBtoUART
  • Windows, use device manager to discover COM port

For reference, here’s a screenshot from Mac OSX using minicom:

As for now, that’s all there is to getting the serial console setup. We’ll actually use the serial console in the next section or after power is applied. Let’s move on to talking about the power connections.

Pro Tip: Running minicom  alone will constrain the terminal row and column count to something pretty small that will never take up the whole terminal window. To take advantage of all the real estate your terminal window has to offer, run TERM=linux minicom  instead. Remember to setup an alias as a shortcut for yourself!

Power

The TS-7670 has variable input voltage of between 8 to 28 VDC. We’ll be using the 12 VDC power supply that comes with the development kit. The TS-7670 takes up about 1 W at idle, but could be as high as 1.3 W depending on peripherals connected.

The bootup process will begin immediately once you plugin the power supply. If you have a serial console program up and running, you’ll see the boot messages displayed on the console.

Ethernet

Undoubtedly, you’ll want to connect the TS-7670 to a network for SSH access, or NFS booting, or communicating with other systems, or downloading new programs, or countless other number of reasons. The TS-7670 comes with a single 10/100 Ethernet connection, designated as eth0. Plug in a standard Ethernet cable connected to your router or switch, and continue reading for further instructions on setup.

About the Embedded Linux Environments

There are two sources from which to boot on the TS-7670: the onboard 2 GB eMMC flash and microSD card (sold as a separate option, included in development kit). Each of these boot sources, or boot drives, contain two Linux environments: 1.) fastboot, which boots to a minimalistic initial ramdisk using busybox shell in about 3 seconds, and 2.) a full Debian distribution, which is more familiar to most Linux users, which boots in about 45 seconds. More on both of these in the next section. We’ll be working in the Debian environment for this guide.

Pro Tip: For development, best practice is to boot to microSD card for ease of recovery should something go wrong. Just plug the microSD card into a Linux development machine and modify files directly.

Furthermore, there are some helpful user space utilities preloaded with the TS-7670 which make it easy to do things like toggle DIO and LEDs called tshwctl (TS Hardware Control). A quick look at the –help menu gives you an idea of what it’s capable of:

 

For example, issuing the command tshwctl –redledon will turn on the red LED next to the Ethernet port.

Default Boot to Debian

At this point, we should be looking at a shell terminal, awaiting our commands. This shell is what we call an initial RAM disk, or initrd, with a Busybox shell. It’s a minimalistic, read-only environment which can be booted quickly (3.13 seconds) and begin executing your programs. Busybox is known as the “The Swiss Army Knife of Embedded Linux”, and you can accomplish quite a bit here. This is an excellent spot to put production-ready code because of the fast bootup and the read-only nature. For development, the Debian environment, which is pre-installed on the startup drive, is perhaps the easiest to work with, especially for those getting their feet wet in embedded Linux. So, we’re going to boot to the Debian environment, which gives us access to not only a more familiar Linux environment with tools like apt-get and compilers, but also an environment with more storage and debugging tools. We could type the command exit to begin booting to Debian, but we don’t want to do this every time. Instead, we’ll simply remove the file /ts/fastboot to boot to Debian by default as documented in the “Initramfs” section of the manual. You should now see Debian startup sequence, followed by a login. For this, we’re just going to use ‘root’ as the user name. There is no password by default.

Pro Tip: If you’d like to use SSH after setting up your network connection, you’ll need to set a password. Run passwd to create a password followed by dpkg-reconfigure openssh-server. Also, refer to the “Setting up SSH” section of the TS-7670 manual.

Pro Tip: If you’d like to run your application automatically upon boot, which is a very common request, take a look at the “Starting Automatically” section of the TS-7670 manual.

Setup Networking

If you recall, we’re going to be setting up our eth1 network interface. For this, we’re going to follow the “Configuring the Network” section of the manual. First, we’ll enable the network interface, and then we’ll go about obtaining an IP address. The easiest way to get an IP address is dynamically using DHCP. For some applications, like a web server, a static IP address is better to use. We’ll take a look at both.

Dynamic IP

First, we need to enable the eth0 network interface by issuing the following command:

Then, in order to get an IP address, we issue the command:

Issuing the ifconfig command should show us our connection information, which in this case the board was assigned the IP address of 192.168.1.135:

Nothing to it! You should now be able to ping an external URL to test your connection:

Static IP

For this, we’ll edit the /etc/network/interfaces file to read like the following. The highlighted section is what we’re adding. Make sure to modify it to fit your specific network settings.

The next thing we need is to tell our network interface which DNS nameservers to use, so that we can ping by domain name, like debian.com. For this, we’ll edit /etc/resolv.conf and use the same gateway IP from above as the nameserver. You file should look like something like this:

After saving your changes, we simply need to enable the interface and then reload the service responsible for the network interfaces. To do this, we run the commands:

Then, you should be able to run ifconfig eth0 and see the settings applied.

You may want to test your connection at this point. Try pinging your gateway, aka router. You’ll know it’s successfully up and running when you see 0% packet loss in the report.

GPS

GPS is one of the differentiating features of the TS-7970, and is essential for things like asset tracking. If you’re interested in getting GPS up and running, be sure to check out the separate guide, Getting Started with GPS on the TS-7670.

Conclusion

In this getting started guide, we took a quick look at how to get everything connected, how to communicate with the board, and how to setup networking. You should be well on your way in developing your application, so go build something amazing!

Is there anything else you’d like to see added to this practical getting started guide for the TS-7670? Be sure to comment below, and we’ll get it added!

Author: Derek Hildreth

eBusiness Manager for Technologic Systems