Frequently asked questions/Interacting with the gumstix

From GumstixDocsWiki
Jump to: navigation, search

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Customers using Gumstix OpenEmbedded should go to www.gumstix.org and the related user wiki

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

For customers using buildroot:


If your question is not in this FAQ, please feel free to ask it on the Mailing list

Contents

On initial startup, can a gumstix connex be accessed the first time with a serial connection or can connection be done with DHCP or ssh?

The ethernet device is not started by default, so connect using a serial console, bluetooth, or USBnet in order to modify /etc/network/interfaces to bring up eth0 — if you're getting a bluetooth gumstix, then you don't need a serial board like a tweener, since bluetooth is started by default with a getty on an rfcomm serial port, so you can log in over a serial-over-bluetooth connection.

It might be a good idea to get the serial board anyways though if you're going to be doing any substantial development work, since it's the only way to get access to the bootloader and the linux console.

When an etherstix expansion board is plugged in to the connex and the boards are powered, the eth0 interface is not brought up on boot by default. One of the following two steps is needed:


ifup eth0

after boot, or else modify /etc/network/interfaces by adding the line

auto eth0

just above the definition of the eth0 interface.

Is the serial null modem cable required to establish a connection to a waysmall board/computer?

Yes. As a minimimum requirement, use a serial null-modem cable to plug on ttyS0.

This will give access to u-boot and a linux console at 115,200 bps.

After setting up usbnet and ssh into the box as root, what password should be used?

Ensure to log in over ssh as user "root" on the gumstix and not as your username on the machine you're connecting from, which is what SSH defaults to. Then, use:


ssh root@gumstix

instead of

ssh gumstix

and then use "gumstix" (without the quotes) as the password.

Is the stix suppose to come up on USB networking ?

Yes, a new gumstix should come up on usb, either with a Windows host (using the linux.inf file when Windows asks for a driver), or with linux kernel version 2.6.11 or higher.

What are the steps to get DHCP working with USBNet?

These steps get DHCP working with USBNet:

1. plug in the gumstix

2. Type ifconfig -a to see if usb0 shows up. The kernel recognizes the gumstix. (sidenote: it was not necessary to "modprobe usbnet" in order to get things going)

3. Type ifconfig usb0 192.168.0.1

Now we have an IP assigned to the usb0 interface, which will allow dhcpd to use it.

4. Type route add -host 255.255.255.255 dev usb0 as required to set up dhcpd for the usb0 interface.

5. Edite /etc/dhcpd.conf. All you really need to do is set up a range or specific host IP for our new subnet (192.168.0.x)

dhcpd.conf should look like this: ddns-update-style ad-hoc; option subnet-mask 255.255.255.0; option broadcast-address 192.168.0.255; option routers 192.168.0.1; option domain-name-servers 192.168.0.1; max-lease-time 120; default-lease-time 120;

subnet 192.168.0.0 netmask 255.255.255.0 { range 192.168.0.10 192.168.0.100;}

6. Turn on dhcpd with /usr/sbin/dhcpd -d -f which is the foreground debug mode. This way you can see what DHCP requests are being made, and what leases are being granted. At this point, the gumstix requestsand receives a lease on an IP in the 192.168.0.x range. note that it can take 60seconds or more for the gumstix to grab and address from the DHCP server...

7. Type ssh root@192.168.0.100 and log in to the gumstix.


You may find this helpful to reacquaint yourself with Linux networking How To.

Once the gumstix has an IP address through DHCP, how does an *incoming* SSH and SCP get setup?

SSH and SCP are already running on the gumstix. They bind to the new bnep0 interface automatically.

The Boa HTTP server is also running by default on the gumstix, as is a Rendezvous announcement service which advertises both the HTTP and SSH ports.

How does the gumstix set its time?

The gumstix platform uses ntpdate to set time from the ntp server that your DHCP server advertises, if your DHCP server advertises an ntp server.

If your DHCP server does not advertise an ntp server, then the gumstix does not set it's time unless you tell it to. In this case, the gumstix wil start ticking at midnight 1/1/1970 GMT each time you boot it.

The place it calls out to ntpdate by the way is in /usr/share/udhcpc/default.script

If you want to sets it's time from a network source when the network interface comes up, add an "up" line to /etc/network/interfaces rather than doing it in that dhcp-specific script.

Is it safe to assume that applications developed using the Waysmall USB port will work the same with the SMT-breakout USB port?

Applications developed using the waysmall USB port will work identically with the breakout-gs USB port. It's the same circuit on both the waysmall daughtercard and the breakout-gs board.

How can an HTTP library be obtained to do standard HTTP communication with a external Web Server?

gumstix platforms already have an HTTP server called Boa and an http client called wget. Curl and libcurl can also be compiled as clients.

Can more flash be added to a gumstix basix or connex?

On the basix platform, an on-board MMC card slot could be used for expanded storage with an optional MMC storage card.

With the connex platform, a netCF or a netMMC expansion board could be attached for compact flash or MMC storage expansion, respectively, using optional storage cards.

Can more storage be accessed by a gumstix?

Use a cfstix or netCF expansion board and a compact flash-based storage card (not sold by gumstix) with a gumstix connex platform.

Or, use a portion of an NFS server(s) as storage space for the gumstix. Connect to the LAN through 10/100 ethernet (etherstix) or any netstix board - such as netCF, netMMC or netDUO, then read and write files using the gumstix alone.

For a VERY low power solution, use a NSLU2 as the NFS server. This keeps the gumstix out of the main server.

How can an MMC storage card be used with a connex platform?

Use either the netMMC expansion board or the netDUO-mmc expansion board - 92-pin expansion boards.

Is the gumstix basix platform usable without an MMC memory card installed?

Yes. Just 2.5MB of the onboard flash has been used for the bootloader, kernel (1MB) and an initrd (1MB using uClibC-based rdimage with busybox).

Can an SD card be used as a filesystem instead of a MMC?

Currently, there is no driver available in open source to allow an SD card to be used in the MMC card slot.

Are SD cards interchangeable with MMC cards?

No, they are not interchangeable — the cards are physically the same size and have the same connector, but SD uses an undocumented encryption scheme to communicate with the controller, and for the controller to communicate with the outside world. The SD cards are not supported in u-boot.

Actually, it's not undocumented, but the fee is in the range of $5000 to get the docs, and also requires a licensing agreement.

As such, only use MMC cards, not SD cards. {[FAQ/Questions/SD_SDIO}}

Can a native unix filesystem be located on the MMC card ?

Yes, you can have a native Filesystem on the MMC card and the filesystem choice is not restricted to any particular native filesystem.

-- JFFS2 won't work though, because it requires an underlying "mtd" flash layer, which isn't there for a MMC or CF card — those appear to linux as regular IDE devices, with the fact that there's flash chips underneath hidden from the kernel. The cards themselves will internally do level wearing and such, so there's no need for something like JFFS2 with these devices.

-- Just use ext2/3, reiserfs, JFS, XFS, or whatever filesystem you want on there. Personally, I'd probably choose ext3.

-- You'll need to make sure that whatever filesystem you want to use is included in the gumstix kernel (or as a module), which you can modify inside the buildroot then copy on to the gumstix.

-- To format the "disk", you can do that on another machine and then bring the formatted disk to the 'stix, or else you can compile the relevant filesystem's utilities inside the buildroot, and then copy the mk*fs util to the gumstix, and format there. The buildroot already has a "mke2fs" target in it which will build the ext2/3 formatting app. Other filesystems would need you to create the relevant makefiles.

What is the waysmall computer's hyperterm settings?

Configure hyperterm for 115200, 8 bits, no parity, 1 stop bit [i.e. 115200, 8n1]

Is it possible to attach a hard disk (hdd) to the gumstix board?

The USB port on any PXA255-based gumstix expansion board is a usb client port, not a usb host port. As such, an hdd cannot be hung off the usb port of any gumstix board.

With Linux 2.6.12 or later, a usb drive can be attached to a USB Host compact flash card (not sold by gumstix) installed in either a cfstix or netCF expansion board slot.

Can a Beowulf cluster of gumstix be created?

Yes. gumstix makes the full source code for the kernel and the compiler tool chain available, including a cross-compiler for the X86 platform.

Where can more be found about writing linux device drivers?

For more background material, check out the book: Writing Linux Device Drivers.

Linux Device Drivers - (available for free online)

The sample code can be downloaded from here.

The Linux Device Drivers - 3rd edition book. It's available here.

The sample code that goes along with the book can be found here.

The "basic" driver model hasn't really changed between 2.4 (which the book was written for) and 2.6 (which the gumstix uses). The big changes in the driver model are for things like plug-n-play support and other stuff which is appropriate if you're writing drivers for a major consumer device (like a gamepad say).

For custom embedded work, simple character drivers are typically all that's required.

How can a customer's application be installed onto the system?

It is possible to use etherboot and bootp/tftp and initrd to create some installation routine for the gumstix device. Ubootp/tftp to get the board going.

gumstix engineering has booted a gumstix with nothing in flash other than the bootloader — pulling the kernel in via tftp and then mounting a rootfs over the network, giving a nice 150GB filesystem on the gumstix!

To do this:

- change the u-boot configuration to turn on the network options that are needed

- set up the dhcp/bootp server and tftp server

- change the u-boot bootcmd and bootarg variables to tell it to boot by reading from the network instead of reading from flash.

Two partitions on the flash? Where are the file structures defined?

e.g. "On our actual device implementation for security we have two partitions on the flash: one is read only containing the system and one is rw containing the user data. If we want to do this on the gumstix too, can you tell me the files where the flash structure is defined?"


The partition map is static, defined at compile time in the linux kernel. It's specified in the file drivers/mtd/maps/gumstix-flash.h in the gumstix_flash_partitions array.

We are planning on changing this over time to using a dynamic partition map stored in flash, but this may not happen for a while, and it will be made to be backward-compatible.

You can either change this default partition table here in the code, or you can turn on the "command line partition mapping" option in the linux kernel, and then specify the partition layout through the linux boot command line arguments (ie the u-boot bootargs variable).

If you're booting over the network anyway though, it might well be worth looking into using an NFS root filesystem for the "shared" read-only filesystem, and then use the full flash space with the existing paritioning system for the user data of each device.

Is there any way to strip the kernel?

Yes, both the kernel and the rest of the root_fs can be pruned to eliminate anything you don't need. Fetch the buildroot environment from SVN and edit the top-level Makefile to eliminate any TARGETs that you don't need (eg the audio stuff, boa, links, dropbear). That will free up a bunch of space. Then build everything by running "make".

After everything is built, cd into build_arm/linux-2.6.10gum and run "make ARCH=arm menuconfig" without the quotes, and turn on/off anything you want/don't need. The kernel is actually built to be pretty stripped down but does include support for all the various hardware bits we have as options. So if you don't need compact flash, for example, you can turn that off to save space.

Can JTAG be used for debugging ?

Yes, the JTAG can be used for debugging. Check out the JTAG connector page .

Note: one shouldn't generally need JTAG access these days, unless you accidentally nuke your own flash. Or if you're porting your own OS to the gumstix.

gumstix engineering uses "the wiggler", a Maccraigor product with the macgraigor software, called OCDemon.

The usb demon product for the Xscale processor is also useful. The only difference is how the product is plugged into a host computer.

If a reflash is needed, you can get this done by gumstix with the reflash program.

What is a suitable JTAG debugger for the gumstix?

Doug Sutherland has a list of JTAG adapters. (BrokenLink as of 2007-07-18)

He adds: "It is possible to use a cheap parallel port adapter (ie Olimex) even home made, but it seems many people have problems with this setup. Sometimes it's due to strange parallel port behavior or port configuration, sometimes it involves the wiring of the signals to proto boards (wires must be short, solder joints must be good etc). And the parallel adapters are slow. But you can program flash and connect to debuggers etc. Quite a few people seem to like the amontec chameleon pod, they have a package for 159 euro.

Most people are looking for USB adapters though, since laptops generally don't have parallel ports anymore, and USB is a lot faster. I can't speak from experience but Rowley's CrossConnect? looks decent for 99 euro, and I see a linux driver there.

Cross Connect.

On the topic of JTAG, these TI chips sure look interesting. They have JTAG masters with 8-bit microcontroller interfaces. They take care of all necessary buffering, and they have a multiplexing protocol that allows chaining many on a passive backplane.

Rocky at digikey download.

Mate that with a USB microcontroller (ie LPC2148) and it would make a nice test/debug environment. The controlled/buffered chaining would also allow some system level debugging (connect to multiple processors on one board or even multiple boards).

Another interesting chip is the old FTDI USB-Serial in a new version with a special bus (MPSSE) that includes interfacing JTAG and SPI.

FT2232C.

FTDI also has a JTAG DLL. (BrokenLink as of 2007-07-18)

— Doug Sutherland

(for lots of details on JTAG, see the Open JTAG wiki http://openjtag.net/)

Is there a TCP/IP protocol that runs on top of Bluetooth automatically?

There is a TCP/IP over bluetooth protocol service called PAN (or personal area network). PAN is provided on linux by the pand daemon, which is configured to run automatically in continuously-scanning client mode on the gumstix.

If the pand daemon sees a PAN master, it'll attempt to pair with it and establish a TCP/IP link, which shows up as the bnep0 interface on the gumstix.

We just made a new image with pxafb driver. Can we put the kernel command line somewhere so that the parameters can pass to the kernel when it boots?

Yes, you can pass the parameters to the kernel when it boots.

If you built the pxafb into the kernel, then you can put the kernel command line args in the u-boot "bootargs" variable. To do this, interrupt the boot with a keypress when prompted (on the serial console), and then type

GUM> printenv

to get a list of the u-boot variables which have been set. To set one (bootargs is the one you want), type:

GUM> setenv bootargs new value of variable

eg

GUM> setenv bootargs console=ttyS0,115200n8 rootfstype=jffs2 rootfs=1f02 reboot=cold,hard

To tack on extra stuff, and keep the existing stuff too, use the shortcut:

GUM> setenv bootargs $bootargs new args

u-boot will expand the $bootargs. After you've changed the value, use printenv to verify it. When it's correct, you need to save it to flash by typing:

GUM> save

u-boot will then save the value for use on subsequent boots. If you don't save, it'll be used for this boot, but then lost when you reboot. More details available in the u-boot documentation.

Can 2 or 3 serial lines be achieved plus the standard console?

Yes, this configuration can be achieved.

1. use a breakout-gs board.

2. get the console through an ethernet, USB, or Wifi connection. This makes a serial port, which normally has a console on it, available to connect to a device.

How can line-by-line source level debugging of a gumstix program be done with breakpoints from a host (linux or windows)?

gdb using gdbserver on the gumstix and gdb on the debug host.

Where are examples using the UCB1400 with Linux?

You don't really need to know normally that there's a usb1400 under the hood — you just interface with the OSS system, and it handles the details for you. Lots of OSS samples out there — download more or less any linux audio app and you'll see how it accesses the sound subsystem and communicates with it.

Is there a software accessible unique serial number on the gumstix?

Yes, there's a serial number on the flash chip, which is software-readable in u-boot as the 'serial' environment variable. This is passed to linux and shows up as the linux kernel serial number, which can be obtained from /proc/cpuinfo

The bluetooth MAC is also unique if you have a bluetooth gumstix. You can obtain that with "hciconfig" after loading the bluetooth driver and starting the bluetooth subsystem.

The /proc/cpuinfo number would be the better method to use.

Note: It's intel strataflash. The factory programmed 64-bit portion of the Protection Register is unique across all flash memory product lines. It can be thought of as a serial number; Therefore, as every Intel chip has different factory programmed portion of the Protection Register, every gumstix basix or connex platform can be uniquely identified.

Is it possible to use Linuxbios and possibly the uboot loader or just linuxbios on a gumstix?

There is no BIOS on gumstix. The code loaded from flash runs on bare metal.

How to connect/configure a gumstix basix/connex board to a PC/laptop?

Start LCD screens.

Personal tools