How to get fresh checkout of u-boot working on sabresd ?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to get fresh checkout of u-boot working on sabresd ?

Jump to solution
4,873 Views
abraham_v
Contributor IV

I've followed the instructions in the "Android_User_Guide.pdf" and am able to create u-boot, linux kernel & android images working on the iMX6Q sabresd development board. The images were loaded using the "MFGTool" provided on the main iMX6 website.

Frankly, I found the u-boot sources in there difficult to navigate and checked out a fresh copy with this command,

>git clone git://git.denx.de/u-boot-imx.git u-boot-imx

Here's what I did next,

> cd u-boot-imx

> export ARCH=arm

> export CROSS_COMPILE=~/toolchain-android/bin/arm-eabi-

> make distclean

> make mx6qsabresd_config

> make

This generates the u-boot.bin image file without problems, but when I try to load it on the board using the MFGTool, it doesn't boot! :smileysad: Any suggestions on what I could try?

Not sure how relevant this is, but I'm trying to boot off the eMMC present on the board and NOT an external SD card.

-Abraham V.

Labels (2)
Tags (1)
1 Solution
1,903 Views
AnsonHuang
NXP Employee
NXP Employee

Hi, Abraham

     I think I have figured out the root cause of your issue, I also clone a git repository from git://git.denx.de/u-boot-imx.git and using master branch, I build a uboot using mx6qsabresd_config, the only difference is I didn't use android tool chain, but it shouldn't matter. I can make this uboot work on my sabresd board.

    When your build done, you should use u-boot.imx instead of u-boot.bin, u-boot.bin is without our IMX IVT header. So please check whether there is a u-boot.imx in your build result, if yes, it should work. And the u-boot which is working on your board is a little different from u-boot.imx, when you try to burn it into eMMC, please use below command "dd if=u-boot.imx of=/dev/<your-sd-card> bs=1k seek=1". If you want to use MFG tool, maybe you need to cat the old working u-boot.bin's first 1K data into the head of this u-boot.imx, in a word, u-boot.bin = 1K(dummy data) + (old)u-boot.imx.

     BTW, the branch imx_v2009.08_3.0.35_4.0.0 is based on v2009.08 uboot, and the git repository you used should be based on v2012 uboot, so you can NOT find it.

View solution in original post

0 Kudos
Reply
7 Replies
1,903 Views
AnsonHuang
NXP Employee
NXP Employee

Hi, Abraham

     Your steps looks OK, can you send me the u-boot.bin file? I can try it on my site and maybe I can find some clues from your u-boot.bin. I can look into the HEX value or even do some debug on it. BTW, when you clone the git repository, can you use "git branch" to see which branch you are at?

0 Kudos
Reply
1,903 Views
abraham_v
Contributor IV

Hello AnsonHuang,

Thanks for the assistance. :smileyhappy: I'm attaching 2 files with this reply. Following the instructions in "Android_User_Guide.pdf" I can create one "u-boot.bin" file. This is attached as "u-boot.bin.working".

After cloning the repository from git://git.denx.de/u-boot-imx.git and compiling, I'm creating another "u-boot.bin" file. This I'm attaching as "u-boot.bin.notworking".

And it looks like I'm on the master branch. Here's what I see,

> git branch -a

* master

  remotes/origin/HEAD -> origin/master

  remotes/origin/arm_master

  remotes/origin/ea20

  remotes/origin/ima3-mx53

  remotes/origin/master

  remotes/origin/master_merge

  remotes/origin/mcx

  remotes/origin/next

  remotes/origin/spl_linux_mainline

  remotes/origin/spl_linux_twister

  remotes/origin/teejet_mtventoux

  remotes/origin/teejet_mtventoux_mainline

>

How do you debug the u-boot.bin file? In addition to solving my current problem, I'd like to learn how to fix/debug this on my own.

-Abraham V.

0 Kudos
Reply
1,903 Views
AnsonHuang
NXP Employee
NXP Employee

Hi, Abraham

     I looked into your u-boot.bin.notworking, apparently, this is not FSL's uboot, that means the u-boot you build is not based on our ROM format, maybe the source code is not corect.

     From the u-boot.bin.working, open it using HEX, you can see the first 32 bit data is a JUMP instruction, and offset 0x400 is our ROM's IVT header, 0x402000d1. But the not working uboot you build is not having these content, so it is not working.

     So, please use branch imx_v2009.08_3.0.35_4.0.0 to build u-boot.bin.

0 Kudos
Reply
1,903 Views
abraham_v
Contributor IV

I found Vincent's u-boot guide on the following link,

https://community.freescale.com/docs/DOC-95015

He seems to be using a different u-boot source link than me, so I did a fresh checkout of it. One concern I have is that his instructions are about booting from one of the on-board SD-card slots. I'm trying to boot off the eMMC. Either way, I followed his instructions but can't build a working image. (Something gets built, but it doesn't load on my sabresd board).

To solve the issue, I tried running the 'objdump' tool on the generated "u-boot" file that gets created on the top-level. Here is a snippet of what I see for the NOT-working binary,

u-boot:     file format elf32-littlearm

Disassembly of section .text:

17800000 <__image_copy_start>:

17800000:   13 00 00 ea 14 f0 9f e5 14 f0 9f e5 14 f0 9f e5     ................

17800010:   14 f0 9f e5 14 f0 9f e5 14 f0 9f e5 14 f0 9f e5     ................

17800020 <_undefined_instruction>:

17800020:   17800120    .word   0x17800120

17800024 <_software_interrupt>:

17800024:   17800180    .word   0x17800180

17800028 <_prefetch_abort>:

17800028:   178001e0    .word   0x178001e0

1780002c <_data_abort>:

1780002c:   17800240    .word   0x17800240

NOTE: The above is for a compile from checking out the code from git://git.denx.de/u-boot.git.

Now here is the same thing for my working file,

u-boot:     file format elf32-littlearm

Disassembly of section .text:

27800000 <ivt_header-0x400>:

27800000:   ea0001b6    b   278006e0 <_start>

    ...

27800400 <ivt_header>:

27800400:   402000d1    .word   0x402000d1

27800404 <app_code_jump_v>:

27800404:   278006e0    .word   0x278006e0

27800408 <reserv1>:

27800408:   00000000    .word   0x00000000

2780040c <dcd_ptr>:

2780040c:   2780042c    .word   0x2780042c

I recognize the IVT header and DTD layout from figure 8-21 of the Processor Reference Manual. What I can't figure out is why it's not coming for the fresh u-boot checkout.

AnsonHuang - Could you tell me the exact link from where you downloaded the u-boot source? I can't find the branch you mention in either git://git.denx.de/u-boot-imx.git or git://git.denx.de/u-boot.git

-Abraham V.

0 Kudos
Reply
1,904 Views
AnsonHuang
NXP Employee
NXP Employee

Hi, Abraham

     I think I have figured out the root cause of your issue, I also clone a git repository from git://git.denx.de/u-boot-imx.git and using master branch, I build a uboot using mx6qsabresd_config, the only difference is I didn't use android tool chain, but it shouldn't matter. I can make this uboot work on my sabresd board.

    When your build done, you should use u-boot.imx instead of u-boot.bin, u-boot.bin is without our IMX IVT header. So please check whether there is a u-boot.imx in your build result, if yes, it should work. And the u-boot which is working on your board is a little different from u-boot.imx, when you try to burn it into eMMC, please use below command "dd if=u-boot.imx of=/dev/<your-sd-card> bs=1k seek=1". If you want to use MFG tool, maybe you need to cat the old working u-boot.bin's first 1K data into the head of this u-boot.imx, in a word, u-boot.bin = 1K(dummy data) + (old)u-boot.imx.

     BTW, the branch imx_v2009.08_3.0.35_4.0.0 is based on v2009.08 uboot, and the git repository you used should be based on v2012 uboot, so you can NOT find it.

0 Kudos
Reply
1,903 Views
abraham_v
Contributor IV

It WORKS !!!! :smileyhappy: Thank you so much AnsonHuang !!

For those interested here are the steps I followed to generate a u-boot.bin file which works with the MFGTool.

File needed before starting: The original "u-boot.bin" file that is created after following the instructions in "Android_User_Guide.pdf". In my case, I compiled the the file, but I would expect a pre-built image to work as well. What is important is that this file is already working on the sabresd board and can be loaded with the MFGTool. I will refer to this file as "u-boot.bin.working"

First checkout the repository with this command (by default you should be in master branch),

>git clone git://git.denx.de/u-boot-imx.git u-boot-imx

Now copy our working file into it,

>cp u-boot.bin.working ~/u-boot-imx/

Next configure and compile uboot to work with the sabresd board,

> cd u-boot-imx

> export ARCH=arm

> export CROSS_COMPILE=~/toolchain-android/bin/arm-eabi-

> make mx6qsabresd_config

> make

As AnsonHuang mentioned, you'll find a "u-boot.imx" file created. This needs to be padded with some dummy data from the u-boot.bin.working before it can be used by the MFGTool. So do this,

>dd if=u-boot.imx of=u-boot.bin.working bs=1k seek=1

And finally to rename our file (I use the copy command so we still have the u-boot.bin.working file in the current directory if we want to build again),

>cp u-boot.bin.working u-boot.bin

I then transferred this file (u-boot.bin) to a windows box and loaded it on the sabresd board using the MFGtool. Instead of booting android, it seems to try booting from the network - but that's another problem and (I think) should be solved by configuring the boot arguments.

Thanks again Yongcai !

-Abraham V.

0 Kudos
Reply
1,903 Views
AnsonHuang
NXP Employee
NXP Employee

Can you try branch imx_v2009.08_3.0.35_4.0.0, Vincent just post a guide of uboot build, please check it:) Master branch may not work.

0 Kudos
Reply