Skip to content
Narrow screen resolution Wide screen resolution Auto adjust screen size Increase font size Decrease font size Default font size

gumstix developer site

Home arrow Documentation arrow Software arrow Reflashing using a serial connection
Reflashing using a serial connection
Print 
This method is the most widely used since it only requires a working serial port. It is slow, but reliable.

Setting up a serial connection

Before programming the flash we'll need to connect your gumstix to your Linux development machine so that we can transfer the new root file system and kernel. To establish a serial connection you will need an open serial port (or USB serial adaptor) on your development machine. You will also need a terminal program such as Kermit or Minicom. The documentation in the following sections assumes you are using kermit, so if you choose to use Minicom you will need to adjust the commands as necessary.

To connect to the gumstix console, you need a serial port, found on the tweener board or one of the console expansion boards. You will also need a null modem cable with appropriate connectors.

Connecting with Kermit

These directions are for the Kermit communications package (cKermit on Linux).

1. Connect the null-modem serial cable to the serial port on your computer and to the serial port on the gumstix. On the console expansion board, use the middle port of the three present.

2. Launch kermit:

$ kermit -l /dev/ttyS0

where /dev/ttyS0 is the serial port you're using on the host computer. If you are using a USB serial adaptor your serial port is likely /dev/ttyUSB0

3. Now set up the serial connection parameters and connect to the gummstix:

C-Kermit> take ~/gumstix/gumstix-oe/extras/kermit-setup
C-Kermit> connect

4. Plug the power adapter into any power jack on the gumstix board stack. When connected and powered, you should see a message from U-Boot followed by the normal Gumstix boot sequence.

5. Log in with username root and password gumstix

6. When finished, you can return to the kermit prompt by typing [CTRL-\] then pressing c. Type quit to exit the program.

Connecting with Minicom

  1. First, configure Minicom
    1. As root, run minicom -s
    2. Under "Serial Port Setup" choose the following
      • Serial Device: /dev/ttyS0 (edit to match your system as necessary)
      • Bps/Par/Bits: 115200 8N1
      • Hardware Flow Control: No (this is important)
      • Software Flow Control: No
    3. Hit [ESC] until you return to the main configuration menu
    4. Select "Save Setup as dfl" to save the default setup
    5. Select "Exit from Minicom" to exit the program
  2. Connect the serial cable to the serial port on your computer and to the serial port on the Gumstix
  3. Run Minicom again with minicom -o. This tells it to skip all the modem initialization strings, which are unnecessary when communicating with the Gumstix. You may need to do this as root if your normal login doesn't have permission to access the serial port.
  4. Plug the power adapter into the power jack of the Gumstix. When connected and powered, you should see a message from U-Boot followed by the normal Gumstix boot sequence in the minicom window.
  5. Log in with username root and password gumstix
  6. When finished, you can exit Minicom by typing [CTRL-A] then pressing Q. This exits without running the normal modem reset sequence, which will only send garbage to the Gumstix

Reflashing the file system and kernel images

Reboot your gumstix, hit any key to stop the autoboot process and drop into U-Boot. At this point you should verify that your U-Boot version is 1.2.0. If it is not, then you will need to read the section at the end of this page on Updating U-Boot.

First, we'll tell U-Boot to prepare to receive a file download at RAM location a2000000:

GUM> loadb a2000000

Now we'll break the serial connection and return to the kermit prompt by pressing [CTRL-\] and then c. Set up the file transfer by typing:

C-Kermit> cd ~/gumstix/gumstix-oe/tmp/deploy/glibc/images/gumstix-custom-verdex/
C-Kermit> send gumstix-basic-image-gumstix-custom-verdex.jffs2 

Tip: Tab command completion is your friend. Kermit will help you type in those long path names.

After typing in the send command, you'll see a screen displaying the progress of the file upload process:

C-Kermit 8.0.211, 10 Apr 2004, localhost



Current Directory: /home/sakoman/gumstix/gumstix-oe/tmp/deploy/glibc/images/
Communication Device: /dev/ttyUSB0
Communication Speed: 115200
Parity: none
RTT/Timeout: 01 / 02
SENDING:  => GUMSTIX-BASIC-IMAGE-GUMSTIX-CUSTOM-VERDEX.JFFS2
File Type: BINARY
File Size: 7491192
Percent Done: 2   /
...10...20...30...40...50...60...70...80...90..100
Estimated Time Left: 00:13:32
Transfer Rate, CPS: 8963
Window Slots: 1 of 1
Packet Type: D
Packet Count: 68
Packet Length: 4096
Error Count: 0
Last Error:
Last Message:


X to cancel file, Z to cancel group,  to resend last packet,

E to send Error packet, ^C to quit immediately, ^L to refresh screen.

When this process completes your new filesystem has been loaded into gumstix RAM. The contents of Flash are still intact, we have not made any permanent changes yet.

Now we'll leave kermit's command mode and reinstate our serial connection to the gumstix:

C-Kermit> connect

Getting the new filesystem copied into flash memory is a two-step process. First, the old filesystem must be erased; then, the new filesystem must be written from RAM to flash.

To erase the old filesystem, enter

GUM> protect on 1:0-1
GUM> erase all

The first line protects flash sectors 0 and 1, which contain the uboot bootloader. This line is very important! If you omit it, your Gumstix will be unusable and will have to be reflashed at the factory. The second line erases all of flash except the 2 sectors that we just protected.

Now, commit your new filesystem to flash:

GUM> cp.b a2000000 40000 ${filesize}

This copies your new filesystem into flash (at address 40000). ${filesize} is a reference to the variable filesize, which was set by your file transfer.

Now, we use a similar process to load the kernel:

GUM> loadb a2000000
C-Kermit> send uImage-2.6.21-r1-gumstix-custom-verdex.bin 
C-Kermit> connect
GUM> katinstall 100000
GUM> katload 100000
GUM> boot

Reflashing u-boot

It is not normally necessary to reflash U-boot. Proceed with the following only if you are absolutely certain that you need to update U-boot.

It is quite possible to "brick" your gumstix motherboard if you do not follow these instructions accurately. Please be careful!

NOTE: At the moment gumstix-oe does not build U-Boot. If you need to update U-Boot you can find pre-built binaries at:

http://www.gumstix.net/feeds/u-boot

The instructions below assume that you have downloaded the proper version of U-boot for your motherboard and stored it locally as u-boot.bin

Reboot your gumstix, hit any key to stop the autoboot process and drop into U-Boot. First we'll tell U-Boot to prepare to receive a file download (our new version of U-boot) at RAM location a2000000:

GUM> loadb a2000000

Now we'll break the serial connection and return to the kermit prompt by pressing [CTRL-\] and then c. Set up the file transfer by typing:

C-Kermit> send u-boot.bin 

When this process completes your new U-boot image has been loaded into gumstix RAM. The contents of Flash are still intact, we have not made any permanent changes yet.

Now we'll leave kermit's command mode and reinstate our serial connection to the gumstix:

C-Kermit> connect

Getting the new u-boot copied into flash memory is a two-step process. First, the old u-boot image must be erased; then the new u-boot image must be written from RAM to flash.

To erase the old u-boot image:

GUM> protect off all
Un-Protect Flash Bank # 1
................................................................................................................................................................................................................................................................... done
GUM> erase 1:0-1
Erase Flash Sectors 0-1 in Bank # 1 
.. done
GUM> 

Now we flash the new u-boot image:

Note: this command is very similar to the command you normally use to reflash the rootfs. Note that the address is 0 not 4000! Be careful not to mistype this!

GUM> cp.b a2000000 0 ${filesize}
Copy to Flash... done
GUM>reset

At this point your system will reboot and execute the new u-boot image.

 

Tags