u-boot on the i.MX6 sabre sd platform in a few commands

cancel
Showing results for 
Search instead for 
Did you mean: 

u-boot on the i.MX6 sabre sd platform in a few commands

u-boot on the i.MX6 sabre sd platform in a few commands

Here is a quick summary at booting u-boot on the i.MX 6 sabre sd platform.

This assumes you already have a "working" Linux development environment with some ARM cross-compilers at hand (e.g. Debian + Emdebian).

Get u-boot sources

We will use git to fetch the U-Boot sources:

  $ git clone git://git.denx.de/u-boot.git

This should create a u-boot directory with all the latest sources.

Note that for more stability you might want to checkout a release instead of the latest version; to do so, list the available release tags with e.g. git tag -l 'v2*', and git checkout <the-desired-tag>.

Compile

Assuming your cross compiler is called e.g. arm-linux-gnueabihf-gcc, you can compile by doing:

  $ cd u-boot

  $ export CROSS_COMPILE=arm-linux-gnueabihf-

  $ make mx6qsabresd_config

  $ make

This should create a number of files, including u-boot.imx.

Put on SD

U-boot should reside at offset 1024B of your SD card. To put it there, do:

  $ dd if=u-boot.imx of=/dev/<your-sd-card> bs=1k seek=1

  $ sync

Your SD card device is typically something in /dev/sd<X> or /dev/mmcblk<X>. Note that you need write permissions on the SD card for the command to succeed, so you might need to su - as root, or use sudo, or do a chmod a+w as root on the SD card device node to grant permissions to users.

Boot!

Your SD card is ready for booting. Insert it in the SD card slot of your i.MX6 sabre sd platform, connect to the USB to UART port with a serial terminal set to 115200 baud, no parity, 8bit data, power up the platform and you should see something like:

  U-Boot 2013.07-rc1-00014-g74771f4 (Jun 20 2013 - 19:05:09)

  CPU:   Freescale i.MX6Q rev1.2 at 792 MHz

  Reset cause: POR

  Board: MX6Q-SabreSD

  DRAM:  1 GiB

  MMC:   FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2

  *** Warning - bad CRC, using default environment

  In:    serial

  Out:   serial

  Err:   serial

  Net:   FEC [PRIME]

  Warning: FEC using MAC address from net device

  Hit any key to stop autoboot:  0

Enjoy!

See also...

Labels (2)
Tags (3)
Comments

Nice Post Vincent!

One question, before building I wonder if one needs to checkout a specific branch/tag, because compiling from master is not always the best in terms of stability.

Leo

Thanks for pointing that out; I added a note about that.

...your remark is also valid for Linux by the way, so I added a note in the Linux post, too. So double thanks :smileyhappy:

Hi,

make mx6qsabresd_config
doesn't work on imx_v2009.08_3.0.35_4.0.0

use make mx6q_sabresd_config
instead

Hi Vincent,

I have question regarding how the boot flow is with the u-boot image. I have a board that is similar to Sabrelite or Nitrogen6x board. I want u-boot to boot my board directly from a SD card. I followed the above steps to copy the u-boot.imx to the partition on SD card and connect to a serial console with minicom, but it won't boot.

However, if I set a mode allows to download u-boot image over the USB OTG port on the device, it starts to boot. I wonder if you have any comment.

Bill

Hi Bill,

What is the mode you use for SD boot?

On sabre sd, boot_mode is set to "boot from board settings" (internal, 10), and the boot switch 6 allows to select "boot from sd" (bt_cfg1[7..5] == 010)

If I read SRC_SBMR1 with u-boot, I have:

  U-Boot > md.l 0x20D8004

  020d8004: 00007040                               @p..

...where the '4' accounts for the 010x we want.

What do you see there when booting from USB?

Best regards,

V.

please help, when i make u-boot, i get a "segment error".

here is info:

******************************************************************************************

board/freescale/mx6sabresd/libmx6sabresd.o: In function `board_late_init':

/home/gongyf/uboot-src/u-boot/board/freescale/mx6sabresd/mx6sabresd.c:460: undefined reference to

`add_board_boot_modes'

armv7l-timesys-linux-gnueabi-ld.bfd: BFD (Timesys 20121029) 2.22.52.20120222 assertion fail elf32-arm.c:13908

/bin/bash: line 1:  8266 segment error armv7l-timesys-linux-gnueabi-ld.bfd -pie -T u-boot.lds --gc-sections -Bstatic

arch/arm/cpu/armv7/start.o --start-group api/libapi.o arch/arm/cpu/armv7/libarmv7.o arch/arm/cpu/armv7/mx6/libmx6.o

arch/arm/imx-common/libimx-common.o arch/arm/lib/libarm.o board/freescale/common/libfreescale.o common/libcommon.o

disk/libdisk.o drivers/bios_emulator/libatibiosemu.o drivers/block/libblock.o drivers/crypto/libcrypto.o

drivers/dfu/libdfu.o drivers/dma/libdma.o drivers/fpga/libfpga.o drivers/gpio/libgpio.o drivers/hwmon/libhwmon.o

drivers/i2c/libi2c.o drivers/input/libinput.o drivers/misc/libmisc.o drivers/mmc/libmmc.o drivers/mtd/libmtd.o

drivers/mtd/nand/libnand.o drivers/mtd/onenand/libonenand.o drivers/mtd/spi/libspi_flash.o drivers/mtd/ubi/libubi.o

drivers/net/libnet.o drivers/net/phy/libphy.o drivers/pci/libpci.o drivers/pcmcia/libpcmcia.o

drivers/power/battery/libbattery.o drivers/power/fuel_gauge/libfuel_gauge.o drivers/power/libpower.o

drivers/power/mfd/libmfd.o drivers/power/pmic/libpmic.o drivers/rtc/librtc.o drivers/serial/libserial.o

drivers/sound/libsound.o drivers/spi/libspi.o drivers/tpm/libtpm.o drivers/twserial/libtws.o

drivers/usb/eth/libusb_eth.o drivers/usb/gadget/libusb_gadget.o drivers/usb/host/libusb_host.o drivers/usb/musb-

new/libusb_musb-new.o drivers/usb/musb/libusb_musb.o drivers/usb/phy/libusb_phy.o drivers/usb/ulpi/libusb_ulpi.o

drivers/video/libvideo.o drivers/watchdog/libwatchdog.o fs/cbfs/libcbfs.o fs/cramfs/libcramfs.o fs/ext4/libext4fs.o

fs/fat/libfat.o fs/fdos/libfdos.o fs/jffs2/libjffs2.o fs/libfs.o fs/reiserfs/libreiserfs.o fs/sandbox/libsandboxfs.o

fs/ubifs/libubifs.o fs/yaffs2/libyaffs2.o fs/zfs/libzfs.o lib/libfdt/libfdt.o lib/libgeneric.o lib/lzma/liblzma.o

lib/lzo/liblzo.o lib/rsa/librsa.o lib/zlib/libz.o net/libnet.o post/libpost.o test/libtest.o

board/freescale/mx6sabresd/libmx6sabresd.o --end-group /home/gongyf/uboot-src/u-boot/arch/arm/lib/eabi_compat.o -L

/home/gongyf/timesys/i_MX6QSABRELite/toolchain/bin/../lib/gcc/armv7l-timesys-linux-gnueabi/4.6.3 -lgcc -Map u-

boot.map -o u-boot

make: *** [u-boot] error 139

******************************************************************************************************************************

why?

which toolchain and config did you use?

export CROSS_COMPILE=armv7l-timesys-linux-gnueabi-

make mx6qsabresd_config

make

HI ,

I am following your steps to boot my sabreSD with the pre-built image of u-boot u-boot_imx.bin (even few more u-boot for imx) by dd command . But my sabreSD board is not responding at all and since there is no partition on SD card to load u-boot i cant see that image when i insert my card on my host machine . I have followed two steps of dd and sync  but No response from board at all and i am pretty much sure that boot mode is perfectly fine .

Please share if you have any idea about this problem .

Got a customer with same problem that pointed me that tutorial : Please make sure you got a SabreSD with quad (mx6q), if your SabreSD is a dual light (mx6dl), the binary won't boot, the pinmux is different and you need to change the config name !

Bleeding edge u-boot is fine but you are skiing "off piste", there are also packaged with toolchain solutions such as ltib and Yocto BSP.

Cheers, Philippe.

Hi

vstehle

make[1]: *** No rule to make target `mx6qsabresd_config'.  Stop.

make: *** [mx6qsabresd_config] Error 2

Why...?

Hi joowonkim,

I just checked with recent versions of u-boot (v2015.01 and commit ab92da9f47d51d363c7de42e2a7bd807e2c1bd54) and it works for me.

You can select the former tag with: git checkout v2015.01

Which version did you try?

Best regards,

V.

Hi vstehle

I succeed download u-boot in my SD Card.

And, I need how to build kernel with u-boot.

Do you know how to build kernel with u-boot in SD Card?

Best regards!

JooWon.

Hi joowonkim,

I am glad you managed to get a working u-boot setup.

If this is a Linux kernel you want to boot now, you might want to have a look at this post: Linux on the i.MX6 sabre sd platform in a few commands. And by the way, if you are aiming at a more elaborated system, you might as well jump to this post instead: Buildroot for the i.MX6 sabre sd platform in a few commands. With Buildroot, you can take care of your toolchain, u-boot, kernel and filesystem in one place; very convenient.

Best regards,

V.

Hi,do you have burn the u-boot.imx to custom board with mfgtoolV2 for imx6qsabresd emmc mode

i.MX 6 Series Software and Development Tool R|Freescale

I still failed .could you help me.

Hi lifusong,

The instructions on this page aim at putting u-boot on an SD card, sorry.

Best regards,

V.

I encounter a issue when compile the u-boot

  HOSTCC  tools/image-host.o

  HOSTCC  tools/mkenvimage.o

  HOSTCC  tools/mkimage.o

  HOSTLD  tools/mkenvimage

  HOSTLD  tools/dumpimage

  HOSTLD  tools/mkimage

  AS      arch/arm/cpu/armv7/start.o

  CC      common/main.o

  CC      common/board_f.o

  CC      common/cmd_version.o

  LD      common/built-in.o

  CC      drivers/video/cfb_console.o

  LD      drivers/video/built-in.o

  LD      drivers/built-in.o

  CC      lib/display_options.o

  LD      lib/built-in.o

  LD      u-boot

arm-poky-linux-gnueabi-ld.bfd: cannot find -lgcc ---this is the error, can some one help me?

thanks

Hello

This is not working for me. I've already tried with several tags and I just can't see anything on the uart terminal. Is not a hardware problem because I have another SD card that boots just fine. The thing is that the mentioned existing SD card was the one it was with the board when it was giving to me so even though it boots is useless to me because I need to be able to build a new image in a new SD card.

What else could I do? Is there any update to this post with new and relevant information?

Thanks!!

Hi Hongjian,

Here is the command you can refer to:

export ARCH=arm

export CROSS_COMPILE=/home/fsl-community-bsp/build/tmp/sysroots/x86_64-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-

export CC="/home/fsl-community-bsp/build/tmp/sysroots/x86_64-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc --sysroot=/home/fsl-community-bsp/build/tmp/sysroots/imx6qsabreauto"

make mx6qsabreauto_defconfig

make CC="$CC"

I have the same problem with you before, and this setting solved my problem.

Hope it will be helpful to you too!

Best regards,

Danwei Luo

---------------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

---------------------------------------------------------------------------------------------------------------------------

Hi Vincent,

i was working to change the Boot Command, some how i got screwed up.

Boot variable got reset, now linux is not running on A9, i have only MQX running on M4 on  IMx6solo Sabre Board

what is the Boot command variable to enable the linux to run on A9.

this is to enable M4

setenv bootcmd "run m4boot;${bootcmd}" 

what is the variable for A9?

i Have imx6 sabre sd board with 2gb we have modified to requirment to our project instead of 1gb. my senior collegue has done it and he dumped u-boot 2009 .so now problem we are not able change any other u-boot except u-boot 2009 can i know where we should  do changes in board in order to work other u-boot version

I made our board with MCIMX6Q5EYM10AD . but it dose not work in sdcard boot and uart . i made sure boot mode(10)and boot_mode is set (bt_cfg1[7..5] == 010).

,each voltages are OK((VDDCORE,VDDSOC:1.375V / VDRAM:1.5V/ VDDHIGH_IN: 3V , VREF_DDR:0.75).

and the boot image on the sdcard  works well on sabre board. but the SDCLK showed 347khz at once and go down. What do i check on our board to work with sdcard? 

please anyone help me.sdclk.jpg

Hi,

I have problem in this step. What's wrong?

administrator@hp:~/u-boot$ make mx6qsabresd_config
***
*** Can't find default configuration "arch/../configs/mx6qsabresd_defconfig"!
***
scripts/kconfig/Makefile:121: recipe for target 'mx6qsabresd_defconfig' failed
make[1]: *** [mx6qsabresd_defconfig] Error 1
Makefile:480: recipe for target 'mx6qsabresd_config' failed
make: *** [mx6qsabresd_config] Error 2

Version history
Revision #:
1 of 1
Last update:
‎06-21-2013 01:21 AM
Updated by: