Gumstix is quite a tiny embeded computer. It is very useful in many industry area.
I am a newbie to Gumstix.
My goal is to run my Qt program on Gumstix.
Here are some steps I need to acheive:
- talk to gumstix through serial port or usb port;
- build my own embeded image and install into Gumstix;
- run my Qt program in Gumstix with LCD.
Gumstix I am using:
mother board: Verdex Pro;expanstion board: Console-vx.
Now, this is the first step --- talk to Gumstix.
there are three serial ports on this board, looking from the left to right are:
- STUART (Standard UART): /dev/ttyS2
- FFUART (Full-Function UART): /dev/ttyS0, the console
- BTUART (BlueTooth UART): /dev/ttyS1
the program I need is either Kermit or Minicom. I am using minicom, because it is easy to be installed in Fedora, and easy to be setup and used.
run minicom in root.
root$ minicom -s
setup "serial port setup" as follows:
- serial device: /dev/ttyS0 (or /dev/ttyUSB0)
- Bps/Par/Bits: 115200 8N1
- hardware flow control: No
- Software flow control: No
select "save setup as dfl";
exit from minicom.
connect serial port to FFUart port on Gumstix.
root$ minicom -o # means skip all modem initialization.
power on Gumstix, When connected and powered, you should see a message from U-Boot followed by the normal Gumstix boot sequence in the minicom window.
login with username: root and password gumstix
transfer some files to gumstix:
push Ctrl A, then push s, choose zmodem.
push Ctrl A, then push r to receive file from gumstix.
Mother board: Overo Fire;Expanstion board: Chestnut43
OS: Ubuntu 10.04 (Kernel: 2.6.32-24-generic)
Boot from SD card
1) Insert a 2GB SD card to laptop. This SD card appear in my /dev as "mmcblk0". Need to umount it first.
2) format SD card into two partition
$ sudo fdisk /dev/mmcblk0
Command (m for help): o
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Now go into "Expert" mode:Command (m for help): x
Next we will set the geometry to 255 heads, 63 sectors and a calculated value for the number of cylinders required for the particular microSD card.
To calculate the number of cylinders, we take the 2032664576 bytes reported above by fdisk divided by 255 heads, 63 sectors and 512 bytes per sector:2032664576 / 255 / 63 / 512 = 247.12 which we round down to 247 cylinders.
Expert command (m for help): h
Number of heads (1-256, default 4): 255
Expert command (m for help): s
Number of sectors (1-63, default 62): 63
Warning: setting sector offset for DOS compatiblity
Expert command (m for help): c
Number of cylinders (1-1048576, default 984): 247
Return to fdisk's main mode and create a new partition 32 MB FAT partition:
Expert command (m for help): r
Command (m for help): n
p primary partition (1-4)
Partition number (1-4): 1
First cylinder (1-247, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-247, default 15): +32MChange the partition type to FAT32:
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): c
Changed system type of partition 1 to c (W95 FAT32 (LBA))
And mark it bootable:
Command (m for help): a
Partition number (1-4): 1Next we create an ext3 partition for the rootfs:
Command (m for help): n
p primary partition (1-4)
Partition number (1-4): 2
First cylinder (6-247, default 6): 6
Last cylinder or +size or +sizeM or +sizeK (6-247, default 247): 247
To verify our work, lets print the partition info:
Command (m for help): p
Disk /dev/sde: 2032 MB, 2032664576 bytes
255 heads, 63 sectors/track, 247 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00aa8e5c
Device Boot Start End Blocks Id System
/dev/sde1 * 1 5 40131 c W95 FAT32 (LBA)
/dev/sde2 6 247 1943865 83 Linux
Up to this point no changes have been made to the card itself, so our
final step is to write the new partition table to the card and then
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
We format the first partition as an FAT file system (the -n parameter gives it a label of FAT):
$ sudo mkfs.vfat -F 32 /dev/sde1 -n FAT mkfs.vfat 2.11 (12 Mar 2005)
We format the second partition as an ext3 file system:
$ sudo mkfs.ext3 /dev/sde2
mke2fs 1.40.8 (13-Mar-2008) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) 121920 inodes, 485966 blocks 24298 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=499122176 15 block groups 32768 blocks per group, 32768 fragments per group 8128 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912 Writing inode tables: done Creating journal (8192 blocks): done Writing superblocks and filesystem accounting information: ^[done This filesystem will be automatically checked every 36 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.
Installing the boot files
There are three files required on the first (FAT) partition to boot your Overo:
- MLO: the boot-loader loader - this small program is loaded into the OMAP3 processor's static RAM. It does some minimal configuration of system memory and I/O pins and then loads the second file.
- u-boot.bin: the boot loader
- uImage: the Linux kernel
download pre-built images. It is important that these three files have precisely these names.
Once you have downloaded these files, mount the FAT partition of your microSD card.
$ sudo mount /dev/sde1 /media/card
Due to constraints of the mask boot ROM in the OMAP processor, MLO should be written first:
$ sudo cp MLO-overo /media/card/MLO
Then copy u-boot and the Linux kernel to the card:
$ sudo cp u-boot-overo.bin /media/card/u-boot.bin $ sudo cp uImage-overo.bin /media/card/uImage
You can now unmount the FAT partition:
$ sudo umount /dev/sde1
At this point you have a bootable FAT partition.
The final step is to untar your desired rootfs onto the ext3 partition that you created above.
Note that this step can be dangerous. You do not want to untar your Overo rootfs onto your development machine - be careful!
This example will assume that you have mounted it at /media/card:
$ sudo mount /dev/sde2 /media/card
Now untar your desired rootfs:
$ cd /media/card $ sudo tar xvjf /path/to/omap3-console-image-overo.tar.bz2
You can now unmount the ext3 partition:
$ sudo umount /dev/sde2
Connect to Overo
$ kermit -l /dev/ttyUSB0
C-Kermit>set flow-control none
C-Kermit>set carrier-watch off
C-Kermit>set speed 115200
/dev/ttyUSB0, 115200 bps
Connecting to /dev/ttyUSB0, speed 115200
Escape character: Ctrl-\ (ASCII 28, FS): enabled
Type the escape character followed by C to get back,
or followed by ? to see other options.