20080510

TS7260 Powered via USB

A TS7260 being powerd via USB - much more portable isn't it? Above, the board is pictured next to my fairly new Asus EEE ultra-mobile PC. Currently for work, I'm 'dogfooding' the package management system we're using for the boards, meaning that I'm using the same package management system on the 7260 as I am on the EEE.

The USB power cable was really simple to create. I first dismembered the mouse part from a Logitech optical USB mouse that I never use anymore, and then found the ground wire (bare copper in my case) and the 5 V wire (4.8V actually, and red). The rest of the wires I trimmed off. A bit of insulating electrical tape and a piece of heat-shrink tubing later, and I had the new USB power cable for the TS72xx.

I recently picked up a USB serial-converter and a DB9 F-F gender changer from The Source (the store formerly known as Radio Shack) but to my dismay, this combination was ineffective. As I suspected, the wires in the gender bender were straight through and not crossed - which is very typical of DB9 F-F converters. Crossed send / receive wires are necessary for NULL modem cables. That is, the pin input -> output mapping should resemble
  • 5 -> 5
  • 2 -> 3
  • 3 -> 2
  • 4 -> 6
  • 6 -> 4
Some sources also suggest that 7 and 8 should be crossed, but that's only ever broken things for me. As long as hardware or software flow control is not necessary, the other 4 pairs of wires can be left floating and disconnected. If this is starting to sound slightly greek to you, the best idea is to just buy a NULL modem cable from the local computer store. If it sounds interesting, you can create a tiny 2" NULL modem adapter with a bit of solder, some 24 AWG wire or IDE cable, two DB9 headers, some hot glue, and (of course) some heat-shrink tubing.

Ta-Da!

Configuration 1 shows power input for the 7260 taken from the lower-right USB port of the EEE, as well as the serial input of the 7260 taken from the top-right USB port of the EEE. Ethernet is also connected between the top of the 7260 and the left side of the EEE. Configuration 1 is very useful for having to interact with RedBoot, since RedBoot is only accessible via the serial port of the 7260. Configuration 1 allows for the developer to either log in via minicom on the serial port or telnet on the ethernet port of the 7260 during regular operations. Another option is to log in to the 7260 via telnet and use the serial connection for emulating a piece of hardware (one could write a program on the EEE to pretend to be a serially connected SNES gamepad, for example).

Configuration 2 shows both the power and ethernet for the 7260 taken from the left side of the EEE. This configuration is slightly more compact and would be used for normal development, where interaction with the bootloader is not necessary.

In both cases, the atheros 802.11 b/g wireless ethernet device can easily be configured to masquerade IP traffic for both the EEE as well as the 7260, forwarding requests between eth0 and ath0 as necessary. It might be useful to run a dhcp server on the ethernet port of the EEE so that the 7260 receives its IP address, hostname, and DNS information automatically. An example script for iptables is below:
#!/bin/sh

EXTIF=ath0
INTIF=eth0

echo 1 > /proc/sys/net/ipv4/ip_forward

iptables -P INPUT ACCEPT
iptables -F INPUT
iptables -P OUTPUT ACCEPT
iptables -F OUTPUT
iptables -P FORWARD DROP
iptables -F FORWARD
iptables -t nat -F

iptables -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT
iptables -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE

My personal favorite configuration is shown to the left with my old, monochrome 4th generation iPod and headphones jacked in :) In all photos, the USB memory stick is actually my root filesystem, which contains a home-rolled Gentoo binary distribution. Contrary to popular belief, Gentoo is also suitable for binary-only and embedded applications - and it's tiny :)

No comments: