world leader in high performance signal processing
Trace: » compiling

ADSP-BF548 EZ-KIT Quick Start: Compiling uClinux

www.analog.com_static_imported-files_images_product_descriptions_680755565image1a.jpg

Distribution Modifications

The uClinux distribution provided with the custom Ubuntu ISO is actually modified with changes made to accomodate beginners. The list of changes can be found in the intro section under (ADSP-BF548 EZ-KIT Quick Start: Introduction).

This modified uClinux distribution will build an ext2 partition image which you can write on to an SD card and boot on the BF548 EZ-KIT. The reason for this is because the normal uImage produced is limited in size and avoiding this limitation when first introducing yourself to uClinux is a good way to minimise entry barriers to development. The SD card approach allows you to have as large an operating system as needed.

The modified distribution also has the drivers for certain devices such as the touch screen built into the kernel with the default settings as well. Normally these are left to build as modules and you would use modprobe to install and uninstall them during runtime. This approach will keep things simple so you do not have to do that and they will instead work out of the box.

If you are using the modified distribution, you only need to run “make” to compile the SD card image. All the defaults should already be set for BF548-EZKIT features (including libraries such as Qt and SDL).

The resulting SD card image will be created in the blackfin-linux-dist/images folder under the filename “rootfs.ext2.img”. You can then use the guide in section (ADSP-BF548 EZ-KIT Quick Start: Booting uClinux) to load it on to the SD card and boot it on the board.

$ make

If you are interested in modifying the kernel configuration or application/libraries you can read on.

These instructions will also help you if you are using a non-modified distribution and hopefully give you a good stepping stone to do so.

Kernel Configuration

How to get to the kernel configuration page:

  • Open a new terminal (Ctrl + Alt + T)
  • Change directory to blackfin-linux-dist

  • Run make xconfig

  • Make sure vendor set to AnalogDevices under Vendor/Product selection --> Vendor

  • Make sure board set to BF548-EZKIT under Vendor/Product selection --> AnalogDevices Products

  • Under Kernel/Library/Defaults Selection select Customize Kernel Settings

  • Exit dialog and save configuration changes

  • The kernel configuration panel will now appear

There are many options and settings for configuring the kernel. When you are just starting out, most of these options will not be relevant. Some of the interesting ones relevant to the BF548 EZ-KIT you might want to be aware of include:

  • General Setup

    General Setup
  • Blackfin Processor Options > Enable the memory protection unit (EXPERIMENTAL)

    Blackfin Processor Options ->
    [X] Enable the memory protection unit (EXPERIMENTAL)

  • Device Drivers > Input device support > Event Interface

    Device Drivers -> 
      Input device support -> 
      [X] Event Interface

  • Device Drivers > Input device support > Keyboards

    Device Drivers -> 
      Input device support -> 
        Keyboards ->
        [X] Blackfin BF54x keypad support
        [X] GPIO Buttons

  • Device Drivers > Input device support > Touchscreens > AD7877 based touchscreens

    Device Drivers -> 
      Input device support -> 
        Touchscreens ->
        [X] AD7877 based touchscreens

  • Device Drivers > Input device support > Miscellaneous devices > Blackfin Rotary support

    Device Drivers -> 
      Input device support -> 
        Miscellaneous devices ->
        [X] Blackfin Rotary support

  • Device Drivers > SPI support

    Device Drivers -> 
      SPI support

  • Device Drivers > Sound card support > Advanced Linux Sound Architecture > ALSA for SoC audio support

    Device Drivers -> 
      Sound card support -> 
        Advanced Linux Sound Architecture ->
        [X] ALSA for SoC audio support

  • Device Drivers > USB support > USB Gadget Support

    Device Drivers -> 
      USB support -> 
      [X] USB Gadget Support

  • Device Drivers > MMC/SD/SDIO card support

    Device Drivers -> 
    [X] MMC/SD/SDIO card support

When you are done modifying the kernel configuration, just exit & save the changes. Next time you compile the distribution, that configuration will be used.

You can read more about kernel configuration on the pages Kernel Modules and basic_compilation.

Application Configuration

The application/library configuration panel is where you can configure the make to install user applications and libraries. Applications include programs such as boa, busybox, and alsa utils. Libraries include program libraries such as SDL, Qt and tslib. You will need to compile the libraries as this sets them up for the cross compiler to let your custom programs use them also.

How to get to the application/library configuration page:

  • Open a new terminal (Ctrl + Alt + T)
  • Change directory to blackfin-linux-dist

    $ cd Blackfin/blackfin-linux-dist

  • Run make xconfig

    $ make xconfig

  • Make sure vendor set to AnalogDevices under Vendor/Product selection > Vendor

  • Make sure board set to BF548-EZKIT under Vendor/Product selection > AnalogDevices Products

  • Under Kernel/Library/Defaults Selection select Customize Application/Library Settings

  • Exit dialog and save configuration changes

  • The application configuration panel will now appear

You can select and unselect programs to install. It's recommended you keep busybox as that is a very useful shell for while you're doing development on uClinux and it features lots of applications integrated in to save space compared to installing the applications on their own.

If you're just starting out with uClinux, it can be easier to work with fdpic exectuables mode rather than flat executables mode. The difference is discussed on Executable file formats. To enable fdpic mode instead of flat mode you should be able to just set it in “Blackfin Build Options > Binary Format > FDPIC”. The kernel modules should be set to allow this by default but if they are not simply go into “Kernel Configuration > Executable File Formats” and enable FDPIC ELF binaries.

Some notes about programs you should be aware of:

  • Please note that the programs pngview and jpegview available in this configuration do not work on the BF548 EZ-KIT. You can read more about this on the LCD demos page.
  • The standard ssh server & client don't work properly on Blackfin due to the fork required by it. Recommend use of dropbear as replacement.

Some notes about libraries you should be aware of:

  • The boost library also does not build by default.
  • Qt does not build by default if you are using a fresh download of uClinux. You need to copy or symbolically link the freetype2 library folder to freetype.

Integrating Applications

There are several ways to integrate your application into uClinux. Especially if you're using custom libraries that are not provided with uClinux. The easiest way is to just cross compile your application by hand, and then transferring the necessary files into the romfs folder as you would want it to appear on your uClinux distribution. You would then run “make image” to compile the romfs folder into your uImage or sd card image. This method will be demonstrated in the cross compiling section if you are looking for further information.

Warning: if you run a make clean, all your changes in the romfs folder will be lost.

You can integrate user applications in other ways such as integrating it into kconfig so as you compile uClinux, it will also compile and integrate your application into romfs. This is a good way for changes to be persistent, and for a sleek efficient build process. This is however slightly more complex, the best location to read up on this method is the wiki page adding_user_applications for integrating user applications and Adding Libraries for integrating libraries.

Compiling Tips

When you are done configuring your kernel and application, you can compile uClinux by running 'make'.

$ make

If you are attempting to build uClinux and being plagued with errors at some stage of the build process but you cannot find it, you can run 'make single' so that it builds each component one by one and will stop as soon as the error is thrown. This is slower to build but easier to debug.

$ make single

If you only want to recompile up to the romfs stage you can run make romfs.

$ make romfs

If you only want to recompile romfs into the uImage or root file system without modifying the contents of romfs (for example if you have modifications in the start up scripts or added custom applications) you can run make image.

$ make image

If you're facing issues compiling a certain library or application, you can compile that component solo by tagging _only on the target. You can also clean specific targets by tagging _clean to the target. This lets you quickly debug specific components.

$ make lib/libsdl_only
$ make lib/libsdl_clean

To set up your tool chain to use the libraries compiled with uClinux, you need to call make vendor_staging_install to set up the staging libraries. This is necessary for the blackfin gnu utils to compile with uClinux specific libraries rather than your desktop installed libraries.

$ make vendor_staging_install

If you are getting file size errors, this is because the default root file system size is limited to 8192kb. To change this you can edit the variable in the blackfin-linux-dist > Vendors > Analog Devices > BF548 EZKIT > Makefile. Note that too large a size makes the uImage unable to be booted in ram on the boards, so you will have to boot the file system from another form of media such as the SD card (as done in this guide).

Further Reading

You can read the FAQ for common build errors and their solutions & explanations at the wiki page faq.

The page Root Filesystems discusses the root file system and different forms of storing and accessing it.

A basic run through of compiling the kernel can also be found on the wiki page basic_compilation. The page compiling_the_kernel links to several pages relevant to configuration and compiling the kernel.