Practical Guide to Getting Started with the TS-7680

ts-7680-hooked-up

Introduction

This guide will walk you through the basic steps of getting your TS-7680 up and running. It’s mostly an extrapolation from the official TS-7680 Manual, but provides a more practical and casual approach in setting up common connections, networking, and environments to begin development.

Connections and Jumpers

Let’s get our TS-7680 hooked up! This includes our very basic connections we’ll need for most any development or project: power, serial console, Ethernet, and WiFi.

Jumpers

ts-7680-jumpers-dev

Out of the box, the TS-7680 has three of it’s five jumpers set to 1.) boot from the onboard eMMC flash, 2.) drop you to a U-Boot shell, and 3.) charge the TS-SILO supercaps. 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 1.) boot to the SD card, 2.) skip U-Boot shell and boot straight into the Debian environment, and 3.) not charge the TS-SILO supercaps so we can disconnect power without needing to wait for them to discharge (20 – 60 seconds). Later in this guide, we’ll re-enable TS-SILO supercaps charging so we can test their capabilities.

Serial Console

ts-7680-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. 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 Silabs 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-7680 manual. This author’s preference is minicom, a no-frills, cross-platform serial communications program (runs in Cygwin for Windows, otherwise use PuTTY). 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

After setting some jumpers and applying power, which we’ll talk about both next, you’ll see something similar to the screenshot below (Mac OSX Terminal running minicom):

ts-7680-bootup-output

Then, you’ll simply login using the username ‘root’ without any password.

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!

Console in a Linux Virtual Machine (VirtualBox)

minicom-on-virtualbox-machine

As a quick aside, you can also use a virtual Linux development machine using VMWare or VirtualBox. This author’s choice is VirtualBox for its simplicity, ‘just works’ feel, and readily available optimized virtual machine downloads. To get a serial console working, you’ll need to boot your VM, click on the USB icon, select the Silicon Labs connection from the list, and then start minicom (after pointing it to /dev/ttyUSB0).

Power

ts-7680-power-connection

One of the features that sets the TS-7680 apart is its flexible input voltage of both DC and AC current. Mainly, we’ll be using the 12 VDC power supply. The first thing you’ll need to do is remove the extra screw terminal connector that’s already plugged into the main power connector and then plugin our power supply. The TS-7680 takes up about 1.4 W at idle, but could be as high as 5 W depending on peripherals connected.

Pro Tip: If you hadn’t noticed, the extra screw terminal connector we removed has screws on the sides to really secure the power input to the board. It’s recommended you use this connector in production. For development, it’s nice to be able to unplug the unit easily.

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

ts-7680-ethernet-connection

Undoubtedly, you’ll want to connect the TS-7680 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 first thing to note is the TS-7680 comes with two 10/100 Ethernet connections thanks to an on-board switch.  You can use either port and each will be designated as eth0 in Linux.  If you want to use both at the same time, you’ll need to enable VLAN mode as mentioned in the “VLAN” section of the TS-7680 manual.  Then, you’ll want to be careful not to connect both ports to the same network or you’ll run the risk of creating a loop in the network topology.  We’ll define our primary port as the one next to the vertical USB connector and screw terminal connectors, designated as eth0.1.  The secondary, designated as eth0.2, is be populated to the next to the primary. Plug in a standard Ethernet cable connected to your router or switch, and continue reading for further instructions on setup. Of course, you could go wireless as well, but for development, a good ‘ol solid Ethernet connection eliminates a lot of guesswork and headache.

Wireless Module Antenna

ts-7680-wireless-connection

In order for the wireless feature to work, you’ll need to attach an antenna. This is easy as there’s only one obvious spot to plug it into located on the wireless module, but it’s a little tight and hard to press on when you do it the first time. If you need to, grab a pair of tweezers to help get it in place.

About the Embedded Linux Environment

The TS-7680 has the ability to boot to several different OSs and environments via U-Boot, a general purpose bootloader sitting on the small, 8 MB SPI flash chip onboard. You can find out more about the U-Boot environment by taking a look at the “U-Boot Environment” section of the TS-7680 manual. Currently, the supported OS image is Debian Linux, running the 3.14 kernel, which is preloaded onto the onboard eMMC flash and microSD card (sold as a separate option, included in development kit).

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 development machine and modify files directly.

The onboard eMMC flash can be configured in two ways: 4 GB MLC for maximum capacity, and 2 GB pSLC (pseudo-SLC) for maximum data reliability. The images all weigh in at about 1.8 GB, so while you could use either option, you may be uncomfortable with space restrictions with 2 GB pSLC.

Pro Tip: We’ve taken a hint from the eMMC flash manufacturer and called it pseudo SLC, or pSLC because it ships as MLC and SLC-like operation can be performed by running a command, which blows a fuse on the chip, making it behave like SLC flash.

Otherwise, the flash and microSD card contain two partitions, a small one where U-Boot is located and the larger one where the filesystem and kernel are located. U-Boot understands how to load the kernel, device tree, and boot arguments and run the OS from the one partition. More information about U-Boot startup sequence can be found in the “U-Boot Environment” section of the TS-7680 manual.

Setup Networking

There are two distinct ways to connect to a network: wired and wireless. Both of these methods are very similar in how they are setup, so we’ll lump them together. Essentially what we’ll be doing is creating a network interface configuration file that Linux looks at when enabling an interface and then we’ll run the command to enable it. Full details are available in the“Configuring the Network” section of the TS-7680 manual. Let’s hit the highlights, shall we?

If you recall, we’re going to be working with the primary interface (eth0) that we’ve already connected.  We will not be covering VLAN mode in this guide to keep things simple during the learning process.  The steps you’ll see below also apply to the wireless interface.

First, let’s create our configuration file for all interfaces strategically placed into /etc/systemd/network/. We’ll call it eth.network and copy/paste the following into it:

This will apply DHCP rules to all of the listed interfaces (see systemd.network man page). This is easiest for now. Of course, you could configure each interface with static IP address, but you’ll need a separate file for each as mentioned in the “Configuring the Network” section of the TS-7680 manual. Okay, the next step is to enable the interface using ifconfig like so:

You may see a message similar to IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready . No worries, just plug in your Ethernet cable and you’ll see IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready . This is slightly different for the wlan0 interface, as that one you’ll need to associate with a wireless access point before the link will be ready. We’ll discuss this in further detail below. For now, let’s obtain an IP address by calling dhclient eth0:

And, finally a quick test:

Congrats! You’re well on your way. Next, let’s take a look at setting up wireless networking.

Wireless Networking

The wireless module included on the TS-7680 is the LSR TiWi-BLE transceiver module. If you’re curious about the nitty gritty, download the datasheet. Suffice it to say, this wireless module is not only capable of connecting to a wireless access point, but it can behave as an access point itself (aka master mode). We’ll concentrate on connecting to an access point in this guide. If you’d like to use it as an access point, you’ll want to review the “Host a WiFi Access Point” section of the TS-7680 manual.

Since we’ve already completed the step of creating the interface configuration file in the section before this, we’ll just jump right into enabling the interface, scanning for an access point, and then associating with it.

Enabling the wireless interface is a simple command:

Then, we’ll want to scan for access points using iwlist  like so:

The output can be overwhelming, so you may want to filter out just the essid names using the command:

Okay, so once you’ve identified an access point you want to connect to, you’ll need to associate with it. Now, there are open access points that don’t require any credentials to associate and there are protected ones using WEP or WPA security types.

Open Access Point

This is the easiest. You’ll be able to simply issue the following command to associate:

Now, make sure you’ve associated with the access point:

Finally, run dhclient wlan0  to get an IP address.

WEP Protected Access Point

Very similar to ‘Open Access Point’ section above except you’ll need to specify a password:

Same as above, follow up with iwconfig wlan0  and dhclient wlan0 .

WPA Protected Access Point

For this, we’re going to use the wpa_passphrase  and wpa_supplicant  utilities which make life easier. First, create the /etc/wpa_supplicant/ directory and generate a passphrase configuration file. Replace ‘the_essid’ and ‘the_password’ with the essid and password to connect to the access point.

You can take a look at this file, but essentially it contains information and a hashed password for the association. Next step is to start the wpa_supplicant  daemon which will run in the background.

You should see output similar to this:

Then, same as the other sections above, follow up with iwconfig wlan0  and dhclient wlan0 .

Finally, if you want your connection to be there when you reboot, you’ll need to configure systemctl to automatically set everything for you.

As always, feel free to review the“Configuring the Network” section of the TS-7680 manual for more information.

TS-SILO Example Script

ts-7680-ts-silo

Quite possibly the neatest feature of the TS-7680 is the TS-SILO on-board backup power solution. TS-SILO provides 20 to 50 seconds of backup power, allowing a custom script to run in the case of a power failure.

A preloaded example script will issue the shutdown -r now  command upon power failure to gracefully reboot the system to prevent filesystem corruption.  Then, a microcontroller responsible for power management will hold the TS-7680 in a reset state until power is restored or until the TS-SILO completely drains, browning out the whole system.  Once power is restored, the system will boot back up again.

Optionally, you can set a variable in the U-Boot environment to pause system startup until TS-SILO reaches a user defined charge percentage.  For more information about TS-SILO, see the “SuperCaps” section of the TS-7680 manual. For now, let’s take a look at the script located at /usr/local/bin/tssupercapmon:

 

Of course, you can insert your own code here if you’d like. It runs in the background as “TS SuperCap Monitor Daemon” as part of systemd services startup. You can see this by looking at /etc/systemd/system/tssupercapmon.service:

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.

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

 

Author: Derek Hildreth

eBusiness Manager for Technologic Systems