world leader in high performance signal processing
Trace: » intro

Loading Linux

Now that we have a stable bootloader on the board, we can start playing with Linux. The typical development methodology is to download a uImage (a bootable image of the kernel) over TFTP/Ethernet into external memory and then boot it. You could program the uImage file into your flash if it is small enough, but that's no fun if you want to tweak kernel settings and quickly test the result.

The uImage file is often times compressed. So before it can actually be booted, it must be uncompressed. The default setup will load the uImage to a high address (say around 16MiB) where it can be decompressed to the kernel's load address (usually 0x1000) without clobbering itself. Keep this in mind so you don't accidentally load the uImage to a low address, attempt to boot it, and then get weird decompression errors.

The default distribution used on Blackfin processors is the uClinux distribution. Originally from http://uclinux.org/, the Blackfin fork incorporates many more packages and updates.

Release Image

First let's make sure we can load and boot a known working image. Visit the uClinux Distribution download page and download the uImage-@LINUX_BOARD@-<version> file. Place this into your TFTP root directory and name it simply uImage.

uImage Boot

Load the file onto the board. The variable loadaddr defaults to a high address that suits the majority of cases (the filesize might not match exactly your output).

bfin> tftp $(loadaddr) uImage
Using bfin_mac device
TFTP from server 192.168.0.2; our IP address is 192.168.0.15
Filename 'uImage'.
Load address: 0x1000000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         ######################
done
Bytes transferred = 4137524 (3f2234 hex)

Before you can boot it, you might want to tweak the kernel's command line. This is controlled via the bootargs environment variable. The default should work fine for the release and default builds:

bfin> print bootargs
bootargs=root=/dev/mtdblock0 rw earlyprintk=serial,uart@UART_NUM@,57600 console=ttyBF@UART_NUM@,57600

Now actually boot things by running (the addresses here might not line up exactly to yours):

bfin> bootm $(loadaddr)
## Booting kernel from Legacy Image at 01000000 ...
   Image Name:   @CPU@-2.6.34.7-ADI-2010R1
   Created:      2010-11-29   9:28:19 UTC
   Image Type:   Blackfin Linux Kernel Image (gzip compressed)
   Data Size:    4137460 Bytes = 3.9 MiB
   Load Address: 00001000
   Entry Point:  001f46bc
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
Starting Kernel at = 001f46bc
Linux version 2.6.34.7-ADI-2010R1 (root@eight) (gcc version 4.3.5 (ADI-2010R1-RC4) )
...etc...

You should see the normal kernel boot output here if everything went as expected.

Userland

You should see the kernel prompt:

Freeing unused kernel memory: 5916k freed
                           _____________________________________
        a8888b.           / Welcome to the uClinux distribution \
       d888888b.         /       _     _                         \
       8P"YP"Y88        /       | |   |_|            __  __ (TM)  |
       8|o||o|88  _____/        | |    _ ____  _   _ \ \/ /       |
       8'    .88       \        | |   | |  _ \| | | | \  /        |
       8`._.' Y8.       \       | |__ | | | | | |_| | /  \        |
      d/      `8b.       \      \____||_|_| |_|\____|/_/\_\       |
     dP   .    Y8b.       \   For embedded processors including   |
    d8:'  "  `::88b        \    the Analog Devices Blackfin      /
   d8"         'Y88b        \___________________________________/
  :8P    '      :888
   8a.   :     _a88P         For further information, check out:
 ._/"Yaa_:   .| 88P|            - http://blackfin.uclinux.org/
 \    YP"    `| 8P  `.          - http://docs.blackfin.uclinux.org/
 /     \.___.d|    .'           - http://www.uclinux.org/
 `--..__)8888P`._.'  jgs/a:f    - http://www.analog.com/blackfin

Have a lot of fun...


BusyBox v1.16.2 (2010-11-29 17:25:57 CST) hush - the humble shell

root:/> uname -a
Linux blackfin 2.6.34.7-ADI-2010R1 #4 Mon Nov 29 17:28:07 CST 2010 blackfin GNU/Linux

Do what it says and have some fun!