Every embedded-style project begins by blinking LEDs. Once the LEDs blink, anything is possible.
My platform is the Gumstix starter pro pack, which includes a “verdex XM4” main board, and the “console vx” expansion board. I was initially thinking I would hijack one of the serial ports, so I started looking at the docs for the Gumstix UARTS. However, I’m trying to do this with as little change to the default software environment as possible, and the default environment does not include a terminal program (e.g., minicom). Likewise, some tests of the serial ports using “echo” and “cat” did not impress.
Thus, I changed my focus to the general purpose I/O (GPIO) through-holes on the console vx. I found this discussion where people are trying to achieve something similar with the console LCD expansion board, which is actually quite similar to my console vx. The critical information, though, was that there is such a directory as /proc/gpio, and that echo and cat are sufficient to interact with the files contained therein. I followed the advice in that discussion and started with the AC97 header. These schematics were helpful in learning what went where, as was Table 4.1 in the Table 4.1 in the PXA255 Processor Developer’s Manual.
Looking at the bottom of the console vx board, the AC97 header has two rows of 4 pins, and the top-right one has a square solder pad (as opposed to the others, which are round). I deduced that the square hole was ground. Here is an ASCII diagram of which GPIO pins go to which through-holes:
Thus, to set and clear one of pins 28-31, one would enter the following at the command prompt:
$ echo “GPIO out set” > /proc/gpio/GPIO28
$ echo clear > /proc/gpio/GPIO28
The string “GPIO out” tells the system to put this pin into the “GPIO mode”. Most of the pins also have alternate functions, so this is necessary. During a boot cycle, the pins seem to “remember” that they are in GPIO mode and set to ‘out’, so those can be omitted after the first invocation.