Practical Guide to Getting Started with the TS-7970

ts-7970-connected

Introduction

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

Connections

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

Serial Console

usb-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-7970 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

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

yocto-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)

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 and ‘just works’ feel. To get 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).

minicom-on-virtualbox-machine

Power

ts-7970-power-input

The TS-7970 operating supply voltage is flexible and can take 5 VDC or 8 – 28 VDC. The power supply from Technologic Systems’ is 12 VDC @ 2.5 A, shown above. If you didn’t notice, the power connector is very industrious and solid, a great feature for deploying in just about any environment. If you’re curious about the power consumptions, take a look at the “Power Consumption” section of the TS-7970 manual. If you’re going to use your own power supply, take a look at the “Terminal Blocks” section of the TS-7970 manual for pin out details.

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-7970-ethernet

Undoubtedly, you’ll want to connect the TS-7970 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-7970 comes with either one or two gigabit Ethernet connections. The primary, designated as eth0, is located next to the two USB host connectors. The secondary, designated as eth1 (Debian) or enp1s0 (Yocto), will 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-7970-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, 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-7970 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. These OS images, as we call them, include Linux camp members Yocto, Debian, Ubuntu, and Slack as well as QNX Neutrino RTOS. Unless you specified otherwise, you’ll be getting the Yocto Linux environment preloaded onto both the onboard eMMC flash and microSD (sold as a separate option, included in development kit).

ts-7970-sd-boot-jumper
An SD Boot jumper exists to make it easy to boot from SD card or onboard eMMC Flash.

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 a single partition, where the filesystem and kernel are located. U-Boot understands how to load the kernel, device tree, and boot arguments and run the OS. More information about U-Boot startup sequence can be found in the “U-Boot Environment” section of the TS-7970 manual.

Pro Tip: If you’ve used any of our products in the past, you probably remember having four different partitions for the kernel, initrd, file system, and spare storage as well as a busybox fastboot environment separate from the full Debian distribution environment. The TS-7970 has a much simpler setup with a single partition and boot environment. A busybox-like fastboot environment can be booted to, but you’ll want to contact support for instructions on how to do that.

Setup Networking

The TS-7970 features both wired and wireless methods for connecting to a network.  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 “Yocto Networking” or “Debian Networking” section of the TS-7970 manual, depending on your environment. 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. The steps you’ll see below also apply to the secondary interface (enp1s0 or eth1) and the wireless interface (wlan0).

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

[Match]
Name=eth* enp1s0 wlan0

[Network]
DHCP=yes

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 “Yocto Networking” section of the TS-7970 manual. Okay, the next step is to enable the interface using ifconfig  like so:

ifconfig eth0 up
ifconfig enp1s0 up
ifconfig wlan0 up

You may see a message similar to IPv6: ADDRCONF(NETDEV_UP): enp1s0: link is not ready . No worries, just plug in your Ethernet cable and you’ll see IPv6: ADDRCONF(NETDEV_CHANGE): enp1s0: 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 udhcpc  (or dhclient  if you’re in Debian environment):

root@ts-imx6:~# udhcpc -i eth0
udhcpc (v1.23.1) started
Sending discover...
Sending select for 192.168.1.122...
Lease of 192.168.1.122 obtained, lease time 86400
/etc/udhcpc.d/50default: Adding DNS 192.168.1.1

And, finally a quick test:

root@ts-imx6:~# ping embeddedTS.com
PING embeddedTS.com (23.239.20.143) 56(84) bytes of data.
64 bytes from embeddedTS.com (23.239.20.143): icmp_seq=1 ttl=55 time=41.2 ms
64 bytes from embeddedTS.com (23.239.20.143): icmp_seq=2 ttl=55 time=41.5 ms
64 bytes from embeddedTS.com (23.239.20.143): icmp_seq=3 ttl=55 time=41.5 ms
64 bytes from embeddedTS.com (23.239.20.143): icmp_seq=4 ttl=55 time=41.7 ms
^C
--- embeddedTS.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 41.276/41.537/41.750/0.223 ms

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-7970 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 “Debian WIFI Access Point” section of the TS-7970 manual.

Pro Tip: Setting up master mode on this interface isn’t as straightforward in the Yocto environment as it is in Debian or Ubuntu environments, which is why it’s only documented for those in the manual. Contact support if your application requires this in Yocto.

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:

ifconfig wlan0 up

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

iwlist wlan0 scan

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

iwlist wlan0 scan | grep ESSID | cut -d':' -f2

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, replacing “default” with the name of the access point essid you’re attempting to connect with.

iwconfig wlan0 essid "default"

Now, make sure you’ve associated with the access point by running iwconfig wlan0 :

root@ts-imx6:~# iwconfig wlan0
wlan0 IEEE 802.11bgn ESSID:"default"
Mode:Managed Frequency:2.417 GHz Access Point: c0:ff:ee:c0:ff:ee
Bit Rate=1 Mb/s Tx-Power=20 dBm
Retry long limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=70/70 Signal level=-34 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

Finally, run udhcpc -i eth0  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:

iwconfig wlan0 essid "default" key "yourpassword"

Same as above, follow up with iwconfig wlan0  and udhcpc -i 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.

mkdir /etc/wpa_supplicant/
wpa_passphrase the_essid the_password >> /etc/wpa_supplicant/wpa_supplicant-wlan0.conf

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

wpa_supplicant -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant-wlan0.conf -B

You should see output similar to this:

root@ts-imx6:~# wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -B
Successfully initialized wpa_supplicant
root@ts-imx6:~# [ 306.924691] wlan0: authenticate with 28:cf:da:b0:f5:bb
[ 306.959415] wlan0: send auth to 28:cf:da:b0:f5:bb (try 1/3)
[ 306.968137] wlan0: authenticated
[ 306.978477] wlan0: associate with 28:cf:da:b0:f5:bb (try 1/3)
[ 306.988577] wlan0: RX AssocResp from 28:cf:da:b0:f5:bb (capab=0x1431 status=0 aid=9)
[ 307.009751] wlan0: associated
[ 307.012768] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 307.047989] wlcore: Association completed.

Then, same as the other sections above, follow up with iwconfig wlan0  and udhcpc -i wlan0 .

Finally, if you find that your connection isn’t persistent upon rebooting the board, you’ll need to configure systemctl as such:

systemctl enable wpa_supplicant@wlan0
systemctl start wpa_supplicant@wlan0

As always, feel free to review the “Yocto Wireless” or “Debian Wireless Client” section of the TS-7970 manual for more information.

Setup Bluetooth

For this, you’ll be using Bluez, the official Linux bluetooth protocol stack. There’s not much you need to do for setup, but there are some commands you’ll want to become familiar with such as hcitool  and hciconfig . There is plenty of documentation and guides available online for this, so we won’t go into any detail on it here. We also have a small “Bluetooth” section of the TS-7970 manual you can refer to in order to get a taste of how it works.

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-7970? Be sure to comment below, and we’ll get it added!

2 thoughts on “Practical Guide to Getting Started with the TS-7970”

Leave a Reply

Your email address will not be published. Required fields are marked *