Recently i was going through freescale document AN4173 on building uboot using eclipse.

The document was released with an old version of eclipse and on windows, and being a linux user I thought to give it a try on a newer version of eclipse (kepler) on ubuntu.

 

  1. We will download and install eclipse on Ubuntu.
  2. Configure and build uboot sources using eclipse

 

Download Cross Compiler

git clone git://github.com/embest-tech/fsl-linaro-toolchain.git

Download Uboot:

git clone git://github.com/embest-tech/u-boot-imx.git -b embest_imx_3.0.35_4.0.0

 

Build Uboot from command line:

cd u-boot-imx/

export ARCH=arm

export CROSS_COMPILE=~/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi-

make distclean

make mx6solo_RIoTboard_config

make

 

Now we will try the same using eclipse IDE (just for fun ).

 

Download eclipse bundle from https://www.eclipse.org/downloads/packages/release/Kepler/SR2

se3m1f.jpg

I am using ubuntu 14.04 32 bit so will use 32 bit eclipse kepler.

qravbr.jpg

 

We need to configure eclipse IDE for Uboot builds.

 

Open Eclipse executable by click on it.

2ec3zb9.jpg

 


Click File > New > Project

Select C/C++ > C Project


 


Select Project Type > Executable > Empty Project.

Select Toolchains > Cross GCC

name the project and Click next.

xqky1l.jpg

 

Select both Debug & Release, click Next.

2lv214.jpg

 


Click Finish to complete project creation.

select Project > Properties on menubar or  hit {alt+enter} on keyboard to display the properties windows.

 

 

 

Highlight C/C++ build and select Builder settings

 

 

uncheck Generate Makefiles automatically.

Update the Build Directory with uboot source code path.

15yer1z.jpg

 

 

Select Behaviour

Empty the Build(incremental build) field.

Change clean to distclean

 

2wmhsfq.jpg

 

 

Next we need to pass the environment variables for Cross Compilation.

Highlight C/C++ build > Environment

 

 

 

Click on ADD and create variable to pass cross compiler to build system.

NAME:  CROSS_COMPILE

VALUE: arm-fsl-linux-gnueabi-

 

Tick add to all configurations.

 

 

 

 

Similarly update the target architecture with ARCH variable.

NAME:  ARCH

VALUE: arm

Tick add to all configurations.

 

 

 

 

Similarly update path with cross compiler location

NAME:  PATH

VALUE: /home/tushar/riot_github/fsl-linaro-toolchain/bin/

Tick add to all configurations.

 

 

 

Highlight C/C++ build > Settings, select Binary Parsers

Untick Elf Parser and Tick on GNU Elf Parser

Click OK to save settings and close window.

 

 

If you are trying the tutorial on Windows select PE Windows Parser.

 

 

Select Project > Make Target > Build  in menubar or  hit {shift+f9} in keyboard to get make targets menu.

 

 

 

We have two activities (make mx6solo_RioTboard_config & clean) to be performed on project, so we create two targets.

 

Click Add and create as shown below.

 

 

 

Once configured we have two build targets.

 

 

 

 

with all setting completed we will proceed to build our bootloader.

Hit {shift+f9} to pop up the build target window.

 

 

 

Select distclean & click build

2n0ldud.jpg

 

 

a “make distclean” command will run removing all the object and temporary files.

On build complete we will get below in console window.

ao2rg6.jpg

 

 

Again Hit {shift+f9} to pop up the build target window.

Select mx6solo_RIoTboard_config & click build.


 

 

a “make mx6solo_RIoTboard_config” command will run and configure the uboot to be build for Riotboard.

On config complete we will get below in console window.

 

 

 

With the above build we have a uboot source ready for Riotboard.

In menubar Select Project > Build Project to fire the make command and build the bootloader.

 

 

 

 

On build complete we will get in console ...

 

 

 

Our shiny new bootloader is available at “~/u-boot-imx/u-boot.bin” and ready to be booted.

 

You can refer document DOC-68087 for flashing uboot using linux platform.