# Make U-boot for ccimx6sbc seperately from Yocto

**URL:** <https://forums.digi.com/t/make-u-boot-for-ccimx6sbc-seperately-from-yocto/15324>\
**Category:** Linux\
**Tags:** uboot, u-boot, ccimx6sbc\
**Created:** [August 26, 2015, 10:11pm UTC](https://forums.digi.com/t/make-u-boot-for-ccimx6sbc-seperately-from-yocto/15324 "2015-08-26T22:11:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jason](https://avatars.discourse-cdn.com/v4/letter/j/dc4da7/32.png) [@Jason](https://forums.digi.com/u/Jason)\
**Post date:** [August 26, 2015, 10:11pm UTC](https://forums.digi.com/t/make-u-boot-for-ccimx6sbc-seperately-from-yocto/15324/1 "2015-08-26T22:11:10Z")

</div>

Hi

I am trying to make the u-boot for ccimx6sbc from source code in Yocto folder here:  
tmp/work/ccimx6sbc-dey-linux-gnueabi/u-boot-dey/2013.04-r0/git/

The problem is: After dd the u-boot.imx to the sdcard, the uboot can start but stops at MMC like bellow:  
U-Boot 2013.04 - dub-2.3.3.2-gf954d01 (Aug 26 2015 - 14:19:48)

CPU: Freescale i.MX6Q rev1.5 at 792 MHz  
CPU: Temperature 39 C, calibration data: 0x5a550a69  
Reset cause: POR  
I2C: ready  
DRAM: 1 GiB  
MMC:  
THE CONCOLE FREEZE HERE…

My steps are:

1. copy the ccimx6sbc uboot source to a folder
2. go in the folder and do: make distclean and make clean
3. configure to ccimx6sbc\_config
4. make with x-tools

Could somebody help me? Thanks a lot in advance.

Jason

---

<div class="post-metadata">

**Author:** ![LeonidM](https://avatars.discourse-cdn.com/v4/letter/l/d26b3c/32.png) [@LeonidM](https://forums.digi.com/u/LeonidM)\
**Post date:** [August 31, 2015, 10:35am UTC](https://forums.digi.com/t/make-u-boot-for-ccimx6sbc-seperately-from-yocto/15324/2 "2015-08-31T10:35:06Z")

</div>

Rather than copying from Yocto, it may make sense to just clone from [GitHub - digidotcom/yocto-uboot: U-Boot for Digi Embedded for Yocto](https://github.com/digidotcom/yocto-uboot) and follow these instructions from a similar question: How does one compile u-boot using the yocto toolchain/sdk?.  
This uses the toolchain generated by Yocto, but it should be possible to use another toolchain if the right flags are set.

How does one compile u-boot using the yocto toolchain/sdk?  
On a project (a few in fact), I will be required to make changes to u-boot. I can make these within Yocto, but that is less than ideal. I would like to be able to make and test changes outside of Yocto as I can do with the kernel.  
What I have working currently is to the do the following:

1. Build an sdk from Yocto using 'bitbake -c populate\_sdk`
2. Install that SDK on my development machine
3. Checkout U-Boot (I am working off the tag dey-1.6.2.2-2009.08 currently.
4. Source the environment setup script for my SDK
5. As with the kernel. unset LDFLAGS
6. Apply the patch below.
7. make ccimx53js\_config && make all  
The patch (step 6) is the only part I am not happy with having to perform. Without this, U-Boot cannot link against libs (the first one I hit is libgcc.a) that are in the sysroot. The environment setup script sets up LD as the following (LD=arm-dey-linux-gnueabi-ld --sysroot=/home/posborne/Projects/WDNU-II/sdk/sysroots/armv7a-vfp-neon-dey-linux-gnueabi).  
Patch (will use environment defined CC/LD/etc.):  
diff --git a/config.mk b/config.mk  
index 02d204a..a8682c5 100644  
— a/config.mk  
+++ b/config.mk  
@@ -65,17 +65,17 @@ cc-option = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \

# 

# Include the make variables (CC, etc…)

# 

-AS = $(CROSS\_COMPILE)as  
-LD = $(CROSS\_COMPILE)ld  
-CC = $(CROSS\_COMPILE)gcc  
-CPP = $(CC) -E  
-AR = $(CROSS\_COMPILE)ar  
-NM = $(CROSS\_COMPILE)nm  
-LDR = $(CROSS\_COMPILE)ldr  
-STRIP = $(CROSS\_COMPILE)strip  
-OBJCOPY = $(CROSS\_COMPILE)objcopy  
-OBJDUMP = $(CROSS\_COMPILE)objdump  
-RANLIB = $(CROSS\_COMPILE)RANLIB  
+AS ?= $(CROSS\_COMPILE)as  
+LD ?= $(CROSS\_COMPILE)ld  
+CC ?= $(CROSS\_COMPILE)gcc  
+CPP ?= $(CC) -E  
+AR ?= $(CROSS\_COMPILE)ar  
+NM ?= $(CROSS\_COMPILE)nm  
+LDR ?= $(CROSS\_COMPILE)ldr  
+STRIP ?= $(CROSS\_COMPILE)strip  
+OBJCOPY ?= $(CROSS\_COMPILE)objcopy  
+OBJDUMP ?= $(CROSS\_COMPILE)objdump  
+RANLIB ?= $(CROSS\_COMPILE)RANLIB

#########################################################################

So, has anyone gotten this to work without patching U-Boot?  
• Comment  
The Yocto SDK is designed to build applications, and u-boot and Linux need special treatment. For example, the SDK environment preparation script sets up CFLAGS and LDFLAGS which do not work with neither u-boot or Linux.  
To compile externally I have been using my own script for u-boot which does something like:  
CROSS\_COMPILE=arm-dey-linux-gnueabi-  
TOOLCHAIN\_PATH=${SDK\_INSTALL\_PATH}/sysroots/x86\_64-pokysdk-linux/usr/bin/arm-dey-linux-gnueabi  
export PATH=${TOOLCHAIN\_PATH}:${PATH}  
make ${PRODUCT}\_config  
make -j4 CROSS\_COMPILE=${CROSS\_COMPILE} u-boot.imx  
This is similar to what I did to use the DEL toolchain.  
With the current Yocto SDK however, it breaks with:  
arm-dey-linux-gnueabi-ld.bfd: cannot find -lgcc  
This is an SDK problem which was fixed in u-boot by the following commit:  
commit 52b1bf2c5cd2f8af880dab503d0039b35570665b  
Author: Wolfgang Denk  
Date: Thu Jul 23 13:15:59 2009 +0200  
Make linking against libgcc configurable

```
Many (especially ARM) tool chains seem to come with broken or
otherwise unusable (for the purposes of builing U-Boot) run-time
support libraries `libgcc.a'. By using the "USE_PRIVATE_LIBGCC"
setting we allow to use alternative libraries instead.
 
"USE_PRIVATE_LIBGCC" can either be set as an environment variable in
the shell, or as a command line argument when running "make", i. e.
    $ make USE_PRIVATE_LIBGCC=yes
or
    $ USE_PRIVATE_LIBGCC=yes
    $ export USE_PRIVATE_LIBGCC
    $ make
 
The value of "USE_PRIVATE_LIBGCC" is the name of the directory which
contains the alternative run-time support library `libgcc.a'. The
special value "yes" selects the directory $(OBJTREE)/lib_$(ARCH) .
 
Note that not all architectures provide an alternative `libgcc.a' in
their lib_$(ARCH) directories - so far, only ARM does.
 
Signed-off-by: Wolfgang Denk 
Cc: Jean-Christophe PLAGNIOL-VILLARD 
Cc: Prafulla Wadaskar 
cc: Stefan Roese 

```

So, the final way tobuild u-boot externally with the current Yocto SDK is:  
CROSS\_COMPILE=arm-dey-linux-gnueabi-  
TOOLCHAIN\_PATH=${SDK\_INSTALL\_PATH}/sysroots/x86\_64-pokysdk-linux/usr/bin/arm-dey-linux-gnueabi  
export PATH=${TOOLCHAIN\_PATH}:${PATH}  
make ${PRODUCT}\_config  
USE\_PRIVATE\_LIBGCC=“yes” make -j4 CROSS\_COMPILE=${CROSS\_COMPILE} u-boot.imx
