All of lore.kernel.org
 help / color / mirror / Atom feed
* Unable to get u-boot running on i.MX6 SABRE for Smart Devices Eval Board
@ 2014-11-04 22:44 Guillaume Fournier
  2014-11-05  0:03 ` Fabio Estevam
  2014-11-05  0:23 ` Eric Bénard
  0 siblings, 2 replies; 27+ messages in thread
From: Guillaume Fournier @ 2014-11-04 22:44 UTC (permalink / raw)
  To: meta-freescale

Hello,

I am new to Yocto and I am having a hard time getting a basic environment
setup.  I have read a lot of documentation but I'm still stock so I'd like
to seek your help.

Problem: I can't get u-boot to start on my evaluation board.  No output
whatsoever on the UART.
Board used: i.MX6 Series SABRE for Smart Devices (MCIMX6DL-SDP)

Here are the steps I followed to get to the point where I am:
***********************************************************************
BSP setup on a Ubuntu 12.04.5 LTS
***********************************************************************
1) Made sure following required packages were installed
   $ sudo apt-get install gawk wget git-core diffstat unzip texinfo
build-essential chrpath libsdl1.2-dev xterm curl
2) Created a working directory
   $ mkdir ~/axion-dev
3) CD to that directory
4) Installed the REPO tool
   $ mkdir ~/axion-dev/bin
   $ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo >
~/axion-dev/bin/repo
   $ chmod a+x ~/axion-dev/bin/repo
5) Downloaded BSP source code
   $ PATH=${PATH}:~/axion-dev/bin
   $ mkdir ~/axion-dev/fsl-community-bsp
   $ cd ~/axion-dev/fsl-community-bsp
   $ git config --global user.email "gfournier@brioconcept.com"
   $ git config --global user.name "Guillaume Fournier"
   $ repo init -u https://github.com/Freescale/fsl-community-bsp-platform -b
daisy
   $ repo sync
   $ repo start axion --all

***********************************************************************
Built and installed cross development toolchain
***********************************************************************
1) Setup the build environment (this changes the current working directory)
   $ source ./setup-environment build
   Accepted the EULA
2) Choose "imx6dlsabresd" as the machine.
3) Modified ~/axion-dev/fsl-community-bsp/build/conf/local.conf to change
   the MACHINE parameter with the name of the selected machine.  For
instance:
   MACHINE ??= 'imx6dlsabresd'
4) Launched the build
   $ bitbake meta-toolchain
5) Grabbed a coffee and waited...
6) Launched
~/axion-dev/fsl-community-bsp/build/tmp/deploy/sdk/poky-eglibc-x86_64-meta-t
oolchain-cortexa9hf-vfp-neon-toolchain-1.6.1.sh
   When asked where to install, I choose ~/axion-dev/toolchain
   
***********************************************************************
Got and built u-boot
***********************************************************************
1) Got Freescale u-boot
   $ cd ~/axion-dev
   $ git clone https://github.com/Freescale/u-boot-fslc.git
2) Ran toolchain environment script.  This sets all relevant environment
variables for cross-compilation
   $
~/axion-dev/toolchain/environment-setup-cortexa9hf-vfp-neon-poky-linux-gnuea
bi
3) Built u-boot
   $ cd ~/axion-dev/u-boot-fslc
   $ make LDFLAGS="" CC="$CC" mrproper
   $ make LDFLAGS="" CC="$CC" mx6dlsabresd_config
   $ make LDFLAGS="" CC="$CC"
   
   The reason behind the [LDFLAGS="" CC="$CC"] is this:
   
   u-boot top level Makefile contains:
   PLATFORM_LIBGCC := -L $(shell dirname `$(CC) $(CFLAGS)
-print-libgcc-file-name`) -lgcc
   The above call gets resolved to "-L ."  Doing ${CC}
-print-libgcc-file-name shows the proper value. The reason
   for this is that U-Boot does not pickup $CC from our environment (which
is including the --sysroot option). Without this
   option -print-libgcc-file-name resolve to a simple file name without a
path. And thus dirname resolve it further to "."
   So the fix is to do: make LDFLAGS="" CC="$CC"
   This passes the ${CC} environment variable to the Makefile which in turns
resolve the PLATFORM_LIBGCC correctly

   As read here:
https://lists.yoctoproject.org/pipermail/yocto/2013-October/016385.html

***********************************************************************
Flashed an SD card with u-boot
***********************************************************************
1) Downloaded Mfgtools-Rel-4.1.0_130816_MX6DL_UPDATER.gz from Freescale onto
a Windows machine
   Also called IMX_6DL_6S_MFG_TOOL: Tool and documentation for downloading
OS images to the i.MX 6DualLite and i.MX6Solo. 
   Size (K): 73917 Format: gz Rev #: L3.0.35_4.1.0 Modified: 9/5/2013
 
http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=RDIMX6SABREPL
AT&fpsp=1&tab=Design_Tools_Tab
2) Uncompressed it
3) Modified {INSTALL_FOLDER}\cfg.ini so it looks like this:
   [profiles]
   chip = MX6DL Linux Update

   [platform]
   board = SabreSD

   [LIST]
   name = AXION-i.MX6DL-SABRESD-SD
4) Modified {INSTALL_FOLDER}\Profiles\MX6DL Linux Update\OS
Firmware\ucl2.xml to add this list entry:
   <LIST name="AXION-i.MX6DL-SABRESD-SD" desc="Choose SD as media">  
        <CMD state="BootStrap" type="boot" body="BootStrap" file
="u-boot-mx6dl-sabresd.bin" >Loading U-boot</CMD>
        <CMD state="BootStrap" type="load" file="uImage"
address="0x10800000" loadSection="OTH" setSection="OTH"
HasFlashHeader="FALSE" >Loading Kernel.</CMD>
        <CMD state="BootStrap" type="load" file="initramfs.cpio.gz.uboot"
address="0x10C00000" loadSection="OTH" setSection="OTH"
HasFlashHeader="FALSE" >Loading Initramfs.</CMD>
        <CMD state="BootStrap" type="jump" > Jumping to OS image. </CMD>

        <CMD state="Updater" type="push" body="send"
file="mksdcard.sh.tar">Sending partition shell</CMD>
        <CMD state="Updater" type="push" body="$ tar xf $FILE ">
Partitioning...</CMD>
        <CMD state="Updater" type="push" body="$ sh mksdcard.sh
/dev/mmcblk1"> Partitioning...</CMD>
        <CMD state="Updater" type="push" body="send"
file="axion/u-boot.bin">Sending u-boot.bin</CMD>
        <CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mmcblk1
bs=1k seek=1 skip=1 conv=fsync">write u-boot.bin to sd card</CMD>
        <CMD state="Updater" type="push" body="send"
file="files/uImage">Sending kernel uImage</CMD>
        <CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mmcblk1
bs=1M seek=1 conv=fsync">write kernel image to sd card</CMD>
        <CMD state="Updater" type="push" body="$ mkfs.ext3 -j
/dev/mmcblk1p1">Formatting rootfs partition</CMD>
        <CMD state="Updater" type="push" body="$ mkdir -p /mnt/mmcblk1p1"/> 
        <CMD state="Updater" type="push" body="$ mount -t ext3
/dev/mmcblk1p1 /mnt/mmcblk1p1"/>
        <CMD state="Updater" type="push" body="pipe tar -jxv -C
/mnt/mmcblk1p1" file="files/rootfs.tar.bz2">Sending and writing rootfs</CMD>
        <CMD state="Updater" type="push" body="frf">Finishing rootfs
write</CMD>
        <CMD state="Updater" type="push" body="$ umount
/mnt/mmcblk1p1">Unmounting rootfs partition</CMD>
        <CMD state="Updater" type="push" body="$ echo Update
Complete!">Done</CMD>
   </LIST>
5) Created a directory under {INSTALL_FOLDER}\Profiles\MX6DL Linux Update\OS
Firmware\ named "axion"
6) Copied u-boot.bin from Linux box ~/axion-dev/u-boot-fslc to Windows box
{INSTALL_FOLDER}\Profiles\MX6DL Linux Update\OS Firmware\axion
7) Connected eval board to the Windows box using USB cable (on USB OTG
connector)
8) Set all DIP switches on the eval board to OFF (SW6)
9) Powered the board
10)Ran MfgTool2.exe and hit Start
11)Once done, unpowered the board
12)Flip SW6 to '01000010'
13)Connected eval board to the Windows box using USB cable (USB TO UART
connector)
14)Launched a terminal (I used PuTTY) on the virtual com port created
(115200 N81)
15)Powered the board

I would expect u-boot to come up here and it doesn't.  I don't have anything
output on the serial port.  I have tried with supplied i.MX6DL-SABRESD-SD
profile in IMX_6DL_6S_MFG_TOOL and it works fine, I get the expected u-boot
printouts.

What am I doing wrong ?

Guillaume Fournier
Hardware Designer
Brioconcept Consulting Inc.



^ permalink raw reply	[flat|nested] 27+ messages in thread
* Re: Unable to get u-boot running on i.MX6 SABRE for Smart Devices Eval Board
@ 2014-11-05 20:43 Guillaume Fournier
  2014-11-05 21:04 ` Otavio Salvador
  0 siblings, 1 reply; 27+ messages in thread
From: Guillaume Fournier @ 2014-11-05 20:43 UTC (permalink / raw)
  To: meta-freescale

To try and figure out where the problem resides, I started from scratch.

1) got latest BSP: repo init -u
https://github.com/Freescale/fsl-community-bsp-platform -b dizzy
2) modified local.conf so MACHINE is imx6dlsabresd
3) On "bitbake meta-toolchain", I got these QA warnings:
WARNING: QA Issue: gcc-cross-canadian-arm: found library in wrong location:
/opt/poky/1.7/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnuea
bi/gcc/arm-poky-linux-gnueabi/4.9.1/liblto_plugin.so
gcc-cross-canadian-arm: found library in wrong location:
/opt/poky/1.7/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnuea
bi/gcc/arm-poky-linux-gnueabi/4.9.1/liblto_plugin.so.0.0.0
gcc-cross-canadian-arm: found library in wrong location:
/opt/poky/1.7/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnuea
bi/gcc/arm-poky-linux-gnueabi/4.9.1/liblto_plugin.so.0 [libdir]

I'm not sure these are relevant to my problem so I kept on going.

4) got latest u-boot: git clone https://github.com/Freescale/u-boot-fslc.git
5) started a fresh shell, ran toolchain environment script, cd to
u-boot-fslc
6) make LDFLAGS="" CC="$CC" mx6dlsabresd_config
7) make LDFLAGS="" CC="$CC" u-boot.imx
8) Programmed u-boot.imx on SD card: cfimager -f u-boot.imx -raw -offset
1024 -d d
9) Try to boot target -> not booting, no UART output

Could the problem be related to the Device Configuration Data since u-boot
spits out something on the UART pretty early ?

Guillaume Fournier
Brioconcept Consulting Inc.



^ permalink raw reply	[flat|nested] 27+ messages in thread
* Re: Unable to get u-boot running on i.MX6 SABRE for Smart Devices Eval Board
@ 2014-11-06 17:31 Guillaume Fournier
  2014-11-06 17:47 ` Otavio Salvador
  0 siblings, 1 reply; 27+ messages in thread
From: Guillaume Fournier @ 2014-11-06 17:31 UTC (permalink / raw)
  To: meta-freescale

I was able to get the board to boot this morning.

The problem had to do with this error message I got when building u-boot
with my Yocto generated toolchain:
"arm-poky-linux-gnueabi-ld.bfd: cannot find -lgcc"

To solve this problem, I initially went looking on the web and found this:
https://lists.yoctoproject.org/pipermail/yocto/2013-October/016385.html

Basically u-boot top level Makefile contains:
PLATFORM_LIBGCC := -L $(shell dirname `$(CC) $(CFLAGS)
-print-libgcc-file-name`) -lgcc
The above call gets resolved to "-L ."  Doing ${CC} -print-libgcc-file-name
shows the proper value. The reason for this is that U-Boot does not pickup
$CC from our environment (which is including the --sysroot option). Without
this option -print-libgcc-file-name resolve to a simple file name without a
path. And thus dirname resolve it further to "."  So the fix suggested was
to do: make LDFLAGS="" CC="$CC" This passes the ${CC} environment variable
to the Makefile which in turns resolve the PLATFORM_LIBGCC correctly.

However, this had other implications.  One of them changed -mfloat-abi=soft
to hard and, I believe, rendered the binary/imx file unusable on the target
(it might however be for another reason that it was not booting... keep on
reading).

A better solution is to add the following line in the
environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi script:
export KCFLAGS="--sysroot=$SDKTARGETSYSROOT"

This KCFLAGS gets appended to the CFLAGS in the top level Makefile of
u-boot.  PLATFORM_LIBGCC now returns a valid lgcc path and no other flags
are modified (-mfloat-abi remains soft).



So, here is a build command before any modifications:

arm-poky-linux-gnueabi-gcc -Wp,-MD,fs/fat/.fat.o.d  -nostdinc -isystem
/media/sdb/gfournier/axiondev/toolchain/sysroots/x86_64-pokysdk-linux/usr/bi
n/arm-poky-linux-gnueabi/../../lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux
-gnueabi/4.9.1/include -Iinclude
-I/media/sdb/gfournier/axiondev/u-boot-fslc/arch/arm/include -include
/media/sdb/gfournier/axiondev/u-boot-fslc/include/linux/kconfig.h
-D__KERNEL__ -D__UBOOT__ -DCONFIG_SYS_TEXT_BASE=0x17800000 -Wall
-Wstrict-prototypes -Wno-format-security -fno-builtin -ffreestanding -Os
-fno-stack-protector -g -fstack-usage -Wno-format-nonliteral
-Werror=date-time -D__ARM__ -marm -mno-thumb-interwork -mabi=aapcs-linux
-mword-relocations -march=armv7-a -mno-unaligned-access -ffunction-sections
-fdata-sections -fno-common -ffixed-r9 -msoft-float -pipe
-D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(fat)"
-D"KBUILD_MODNAME=KBUILD_STR(fat)" -c -o fs/fat/fat.o fs/fat/fat.c

The previous build without any modifications was not finding lgcc (it's
missing the --sysroot argument).



Here is a build command after the KCFLAGS modification in
environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi.  Not the added
--sysroot:

arm-poky-linux-gnueabi-gcc -Wp,-MD,net/.arp.o.d  -nostdinc -isystem
/media/sdb/gfournier/axiondev/toolchain/sysroots/x86_64-pokysdk-linux/usr/bi
n/arm-poky-linux-gnueabi/../../lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux
-gnueabi/4.9.1/include -Iinclude
-I/media/sdb/gfournier/axiondev/u-boot-fslc/arch/arm/include -include
/media/sdb/gfournier/axiondev/u-boot-fslc/include/linux/kconfig.h
-D__KERNEL__ -D__UBOOT__ -DCONFIG_SYS_TEXT_BASE=0x17800000 -Wall
-Wstrict-prototypes -Wno-format-security -fno-builtin -ffreestanding -Os
-fno-stack-protector -g -fstack-usage -Wno-format-nonliteral
-Werror=date-time
--sysroot=/media/sdb/gfournier/axiondev/toolchain/sysroots/cortexa9hf-vfp-ne
on-poky-linux-gnueabi -D__ARM__ -marm -mno-thumb-interwork -mabi=aapcs-linux
-mword-relocations -march=armv7-a -mno-unaligned-access -ffunction-sections
-fdata-sections -fno-common -ffixed-r9 -msoft-float -pipe
-D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(arp)"
-D"KBUILD_MODNAME=KBUILD_STR(arp)" -c -o net/arp.o net/arp.c

The previous build with the KCFLAGS modification is performing as expected
and binary is usable and boots fine.



Here is a build command when calling make LDFLAGS="" CC="$CC" without the
KCFLAGS modification:

arm-poky-linux-gnueabi-gcc  -march=armv7-a -mthumb-interwork
-mfloat-abi=hard -mfpu=neon -mtune=cortex-a9
--sysroot=/media/sdb/gfournier/axiondev/toolchain/sysroots/cortexa9hf-vfp-ne
on-poky-linux-gnueabi -Wp,-MD,net/.bootp.o.d  -nostdinc -isystem
/media/sdb/gfournier/axiondev/toolchain/sysroots/x86_64-pokysdk-linux/usr/bi
n/arm-poky-linux-gnueabi/../../lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux
-gnueabi/4.9.1/include -Iinclude
-I/media/sdb/gfournier/axiondev/u-boot-fslc/arch/arm/include -include
/media/sdb/gfournier/axiondev/u-boot-fslc/include/linux/kconfig.h
-D__KERNEL__ -D__UBOOT__ -DCONFIG_SYS_TEXT_BASE=0x17800000 -Wall
-Wstrict-prototypes -Wno-format-security -fno-builtin -ffreestanding -Os
-fno-stack-protector -g -fstack-usage -Wno-format-nonliteral
-Werror=date-time -D__ARM__ -marm -mno-thumb-interwork -mabi=aapcs-linux
-mword-relocations -march=armv7-a -mno-unaligned-access -ffunction-sections
-fdata-sections -fno-common -ffixed-r9 -pipe    -D"KBUILD_STR(s)=#s"
-D"KBUILD_BASENAME=KBUILD_STR(bootp)"  -D"KBUILD_MODNAME=KBUILD_STR(bootp)"
-c -o net/bootp.o net/bootp.c

Note the huge difference in the build line (and hard vs soft).
The previous build with the make LDFLAGS="" CC="$CC" command line was
creating an unusable binary although it did compile fine.


Long story short, to solve my problem:
Add the following line in the
environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi script:
export KCFLAGS="--sysroot=$SDKTARGETSYSROOT"

May I suggest future releases include this modification in the script ?

Thanks guys for all the support!

Guillaume Fournier, eng.
Hardware Designer
Brioconcept Consulting Inc.




^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2014-11-06 17:57 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-04 22:44 Unable to get u-boot running on i.MX6 SABRE for Smart Devices Eval Board Guillaume Fournier
2014-11-05  0:03 ` Fabio Estevam
2014-11-05 14:38   ` Guillaume Fournier
2014-11-05 14:52     ` Wally Yeh
2014-11-05 15:24       ` Guillaume Fournier
2014-11-05 14:56     ` Daiane Angolini
2014-11-05 15:37       ` Guillaume Fournier
2014-11-05 15:45         ` Otavio Salvador
2014-11-05 16:05           ` Guillaume Fournier
2014-11-05 15:42     ` Otavio Salvador
2014-11-05 15:50       ` Guillaume Fournier
2014-11-05 15:54         ` Otavio Salvador
2014-11-05 15:59           ` Wally Yeh
2014-11-05 16:15           ` Guillaume Fournier
2014-11-05 16:21             ` Gary Thomas
2014-11-05 16:40               ` Otavio Salvador
2014-11-05 16:41               ` Guillaume Fournier
2014-11-05  0:23 ` Eric Bénard
2014-11-05 14:51   ` Guillaume Fournier
2014-11-05 17:25     ` Eric Bénard
  -- strict thread matches above, loose matches on Subject: below --
2014-11-05 20:43 Guillaume Fournier
2014-11-05 21:04 ` Otavio Salvador
2014-11-05 21:50   ` Guillaume Fournier
2014-11-06 17:31 Guillaume Fournier
2014-11-06 17:47 ` Otavio Salvador
2014-11-06 17:53   ` Gary Thomas
2014-11-06 17:56     ` Otavio Salvador

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.