world leader in high performance signal processing
Trace: » serial_port_loading_files

Loading Files With U-Boot via The Serial Port

When a network connection is not available, U-Boot can be load files via the serial port. U-Boot currently supports two protocols: kermit or y-modem. There are several terminal programs available and most likely your favorite one will work with at least one of these. Here we will cover three of the most common ones: C-Kermit and minicom in Linux and HyperTerminal in Windows.

Keep in mind that loading anything but the smallest of files via the serial port can take quite a long time (minutes per file!) due to the low speeds (typically a max of 115200b/s). So even if it takes a bit of effort to get a network connection going, it is well worth the effort (compare with 100mb/s or even 10mb/s) in the long run (mere seconds to load over ethernet!).

If you need information about how to even connect to the board initially for basic communication, please see the terminal programs document.

U-Boot Commands

The U-Boot commands for loading files over the UART all have the same options.

# Loading with the kermit protocol
bfin> loadb [load address] [baud rate]
# Loading with the y-modem protocol
bfin> loady [load address] [baud rate]

If you do not specify a load address, then the value will be taken from the $(loadaddr) environment variable (which is typically set to a default value of 0x1000000).

If you do not specify a baud rate, then the speed the console is currently running at will be used (which is typically set to a default value of 57600).

Once the transmission finishes, the file will be in memory at the specified load address. The $(loadaddr) environment variable will automatically be set to the address the load command used. The $(filesize) environment variable will automatically be set to the number of bytes transferred during the load operation.

Then you are free to do whatever you like. Run/boot the file (if it's an executable), copy it to some other place (flash/storage/etc…), display the memory, whatever.

C-Kermit

A common Linux program which implements the Kermit protocol is C-Kermit. See the terminal programs document for more information.

Once you've connected to the board, run the loadb command:

bfin> loadb

Now escape back to the kermit shell prompt (ctrl+\ followed by ctrl+c by default). Tell kermit to transmit the file you want by doing:

Linux Kermit> send /path/to/file/you/want/to/load

Text will appear giving you information about the progress of the upload.

After the upload has finished switch back to the U-Boot command line by issuing the following command:

Linux Kermit> connect

And you're done. See the U-Boot Commands section for more information.

Minicom

Minicom is quite a common serial communication program in the Linux world. While it does not support the kermit protocol, it does support the y-modem protocol. See the terminal programs document for more information.

Once you've connected to the board, run the loady command:

bfin> loady

Now use the minicom escape sequence (ctrl+a by default) followed by typing s (short for “send”). Select ymodem in the list. Browse to the file you wish to transmit and select/mark it. Then just select OK at the bottom of the file selector.

Text will appear giving you information about the progress of the upload.

After the upload has finished, hit enter to confirm the status successful message and you will end up back at the U-Boot prompt.

And you're done. See the U-Boot Commands section for more information.

Hyper Terminal

For the unfortunate souls stuck in a Windows environment, the standard HyperTerminal program that comes with all Windows installs can communicate via either kermit or y-modem. For more information, see the terminal programs document.

Just like with C-Kermit, run the loadb command:

bfin> loadb

U‑Boot is now waiting for a Kermit connection to be made. Under the Transfer menu in HyperTerminal select Send File. The Send File dialog should now appear:

In the Filename field select the file to load onto the target.

In the Protocol field select Kermit.

Click Send.

A dialog showing you the progress of the transfer should now be displayed:

Once the transfer is complete you should be returned to the main HyperTerminal window and the U-Boot prompt.

And you're done. See the U-Boot Commands section for more information.