Compiling imx53qsb uboot and Linux source separately

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

Compiling imx53qsb uboot and Linux source separately

2,763 Views
jk1z
Contributor I

Dear All,

I just started to work in imx53QSB.

I would like to compile the u-boot, linux sources separately (ie. not using LTIB script) in a Fedora machine. (Currently I am not having ubuntu). 

After compilation I will test with that U-boot and Linux uImage in my board.

To compile the u-boot and Linux source, which cross compiler I need to use?

From LTIB script I came to know that, it uses the compiler - /usr/bin/gcc4.4.

Can I copy that compiler to my FEDORA machine and set the PATH to it, will it work? 

Is there anything to be noted for using FEDORA or any other flavor of Linux instead of UBUNTU?

how about the tool chain for this?

Kindly suggest.

Regards,

jk

Labels (1)
0 Kudos
23 Replies

2,194 Views
jk1z
Contributor I

hi fillipo,

its working. I can load my kernel image and able to boot.

many thanks

0 Kudos

2,194 Views
Filippo
Contributor III

jk,

Sorry, I forgot under Device Driver -> Character devices -> Serial drivers you should have MXC Internal serial port support and Support for console on a MXC...

If you give me your email I can send you my running kernel ...

Filippo

0 Kudos

2,194 Views
jk1z
Contributor I

Fillipo, Wolfgang,

if you have any working uImage could you please share? I check with that.

if suppose there is error in my uImage.

-jk

0 Kudos

2,194 Views
jk1z
Contributor I

hi fillipo,

I have just checked the config in menuconfig - the console support is there

[*] Virtual terminal x x
x x [*] Enable character translations in console x x
x x [*] Support for console on virtual terminal x x
x x [ ] Support for binding and unbinding console drivers x x
x x [*] /dev/kmem virtual device support x x
x x [ ] Non-standard serial port support x x
x x < > GSM MUX line discipline support (EXPERIMENTAL) x x
x x <*> MXC IIM device driver x x
x x <M> IMX SIM support x x
x x Serial drivers ---> x x
x x [*] Unix98 PTY support x x
x x [ ] Support multiple instances of devpts x x
x x [*] Legacy (BSD) PTY support

===========================

by the way, I did not get the config file path, there is no file config.gz in /proc directory.

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

@ wolfgang,

now I have written the uImage in 2048 offset and while creating partition in the uSDcard, I used starting block as 6144 in fdisk cmd,

b'coz uImage is `2MB size.

so from 2048 offset + 2MB - the uImage will be threre

at 6144 offset = rootfs starts 

still the image booting is not there.

is this ok? 

=========================

0 Kudos

2,194 Views
Filippo
Contributor III

Ok, system is up. I suppose you have no serial console support in the kernel.
What if you use the original kernel ? Do you get the output on the serial port? I suppose yes.
There is a simple way to recover the configuration file from the original kernel, and you can use it.
In the mid time, can you kindly understand if on Drivers-->Character devices you have Virtual terminal  and Support for serial console both checked in your kernel config?

Anyway, to get the original .config from the running kernel you have to go on the target, under /proc, and you will find a file called "config.gz", the actual configuration of the running kernel : grab it and use it as a base for your tests.

Maybe this helps
Filippo

0 Kudos

2,194 Views
Filippo
Contributor III

JK,

if you see the uboot prompt I think you have not overwritten it.
let me do a couple of tests to see the messages, but it seems to me you have no console, or you have compiled the kernel without serial support in it.
wait a couple of minutes, I bring up my system ...

Filippo

0 Kudos

2,194 Views
WolfgangW
Contributor I

Hi jk,

so from your U-Boot environment, we see that bootcmd calls bootcmd_mmc, and there the kernel is loaded with 'mmc read 0 ${loadaddr} 0x800 0x1800'. 0x800 is 2048, as this is counted in sectors of 512 bytes, the offset of the kernel (uImage) is 1M.

So writing the kernel as you did was perfectly ok. I suspect that you overwrote the kernel by creating a partition over it's location afterwards. ;-) Did you remember leaving some space at the start of the device (start of first partition at something like 6MB or so, I don't recall the original value)?

BTW, for re-writing U-Boot, take u-boot.bin and write it with
dd if=u-boot.bin of=/dev/mmcblk0 bs=512 skip=1 seek=1
to skip the first block on both SD card and image.

EDIT: Oops, sorry - the kernel image is correctly loaded (u-boot would detect a wrong checksum in any other case), so my guess the kernel image got overwritten by the newly created partition is wrong.

As Filippo pointed out, there seems to be some other setting wrong during kernel compilation!

Regards,
Wolfgang

0 Kudos

2,194 Views
jk1z
Contributor I

hi, I have uboot working now. if suppose, we overwritten the u-boot then how to recover it?

-rgds,

jk

0 Kudos

2,194 Views
jk1z
Contributor I

hi fillipo & wolfgang

here the printenv 

MX53-LOCO U-Boot >
MX53-LOCO U-Boot >
MX53-LOCO U-Boot >
MX53-LOCO U-Boot > printenv
bootdelay=3
baudrate=115200
loadaddr=0x70800000
netdev=eth0
ethprime=FEC0
uboot=u-boot.bin
kernel=uImage
nfsroot=/opt/eldk/arm
bootargs_nfs=setenv bootargs ${bootargs} root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp
bootcmd_net=run bootargs_base bootargs_nfs; tftpboot ${loadaddr} ${kernel}; bootm
ethact=FEC0
bootfile=dexter/uImage
filesize=2D47BC
fileaddr=70800000
gatewayip=10.192.241.254
netmask=255.255.255.0
ipaddr=10.192.241.192
serverip=10.192.225.224
dnsip=10.211.0.3
bootcmd_mmc=run bootargs_base bootargs_mmc; mmc read 0 ${loadaddr} 0x800 0x1800; bootm
lvds=video=mxcdi0fb:RGB666,XGA ldb
bootcmd_obds=ext2load mmc 0:1 0x70800000 /unit_tests/obds.bin; go 70800000
lcd=video=mxcdi0fb:RGB24,SEIKO-WVGA
vga=video=mxcdi1fb:GBR24,XGA di1_primary tve
hdmi=video=mxcdi0fb:RGB24,1024x768M@60
bootcmd=run bootcmd_mmc
bootargs_mmc=set bootargs ${bootargs} root=/dev/mmcblk0p1 rw rootwait
bootargs_base=setenv bootargs console=ttymxc0,115200 ${vga}
stdin=serial
stdout=serial
stderr=serial

Environment size: 1001/131068 bytes
MX53-LOCO U-Boot >

rgds -jk

0 Kudos

2,194 Views
jk1z
Contributor I

hi Fillipo,

I have taken the linux source from the vmware, /home/lucid/ltib/rpm/BUILD/linux, to the feodra machine and compiled once using arm-none-linux-gnueabi- . I have the uImage. I just added a printk statement to the source and compiled.

The compilation is successful. I have flashed this to the uSD card.

In the host machine connected uSD card and saw mmcblk0 partition.

where I copied the uImage using 'dd' command (I saw this in a Readme doc from freescale) 

dd if=uImage of=/dev/mmcblk0 bs=512 seek=2048 && sync && sync 

after I created partion using fdisk and created a ext3 partition for rootfs.

Now if I plug the card in imx53wsb and boot, 

Hit any key to stop autoboot: 0

MMC read: dev # 0, block # 2048, count 6144 partition # 0 ...
6144 blocks read: OK
## Booting kernel from Legacy Image at 70800000 ...
Image Name: Linux-2.6.35.3-744-g27fdf7b
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2112408 Bytes = 2 MB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK

Starting kernel ...

It stuck at Starting kernel....

If I want to check my own uImage what needs/care to be taken?

rgds,

jk

0 Kudos

2,194 Views
WolfgangW
Contributor I

Hello jk,

for the regular boot process of MX53QSB, the uImage is stored on the "raw" SD card (/dev/mmcblkX or /dev/sdX), not in any partition or filesystem. You have to write the uImage to this location with dd, specifying an offset (bs=... seek=...). DO NOT write it without the offset, you will overwrite u-boot and the partition table!

Sorry, I am not sure about the exact offset and don't have a plain linux image around for testing right now.

As Filippo already said, please confirm that u-boot is starting first!

If u-boot starts, stop the boot process at the u-boot prompt and give us the output of printenv, from the boot commands, we can calculate the offset needed. (If there is nobody else with a better memory who can tell it before. ;-) )

Best regards,
Wolfgang

0 Kudos

2,194 Views
Filippo
Contributor III

jk,

only to understand, what if you insert the sd in your pc?
Do you see partitions?
And if yes, what do you see in ?
When you power up the board, do you see the usual u-boot outputs?

0 Kudos

2,194 Views
jk1z
Contributor I

dear fillipo, wolfgang,

i have taken the toolchain from mentor graphics and tried compiling, it is compiled.

But if I want to test the new uImage created with my compilation, where I have to keep the uImage in the u-SD card?

I have kept the uImage in boot directory of SD card, but it seems like it is not booing uImage that I have compiled. ( I have just added a print statement in kernel to check - the compiled image booting)

Any suggestions pls?

rgds,jk

0 Kudos

2,194 Views
Filippo
Contributor III

Hi jk,
I'm sure Wolfgang is right.
Anyway,if you want to use the freescale compiler, look for the gcc-4.4.4-glibc-2.11.1-multilib-1.0 directory on the vm.
In my installation is under /opt/freescale/usr/local, but I have never received the vm dvd, so I installed LTIB on my system, and this is the path on my system, dunno on the vm where it is.
Now hit the following:
tar jcf gcc-4.4.4-glibc-2.11.1-multilib-1.0.tar.bz2 gcc-4.4.4-glibc-2.11.1-multilib-1.0
After a while you will obtain :
gcc-4.4.4-glibc-2.11.1-multilib-1.0.tar.bz2
Move it where you like and then hit:
tar jxf gcc-4.4.4-glibc-2.11.1-multilib-1.0.tar.bz2
and you will have back the gcc-4.4.4-glibc-2.11.1-multilib-1.0 directory in your own dir, with the cross compiler in it.
Add the path to your path and use it as explained above by Wolfgang and me.
Regards
Filippo

0 Kudos

2,194 Views
WolfgangW
Contributor I

Hi jk,

my recommendation would be Mentor Sourcery Lite:

http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/

Follow the link "Download the GNU/Linux Release" in the ARM Processor section. You have to register, but it is free.

Best regards,
Wolfgang

0 Kudos

2,194 Views
jk1z
Contributor I

Dear Fillipo/Wolfgang,

I try to copy the toolchain/compiler from the VM ware that given by Free scale along with IMX53QSB board.

In the virtual Linux I compressed (tar) and brought that to my remote fedora machine.

There in remote machine, I try to untar it, but it gives error and closed. 

How to bring the tool chain/compiler to remote machine? or is there available in web that I can download directly.

rgds,

-jk

0 Kudos

2,194 Views
jk1z
Contributor I

Dear Fillipo,

thanks, I also understood.

rgds,

jk

Filippo said:

Dear jk,
Ok, maybe I have understood ...
The arm-none-linux-gnueabi-SOMETHING is actually a link to arm-fsl-linux-gnueabi-SOMETHING, so they are the same binary. Call it as you like.
I.E. if you start arm-none-linux-gnueabi-gcc you will start arm-fsl-linux-gnueabi-gcc.
regards

jk said:

Dear Fillipo,

I just wanted to know if there any major pros/cons bw the compilers.

coz I have both in my directory :-), thats y I asked.

thanks fillipo.

rgds,

-jk

0 Kudos

2,194 Views
Filippo
Contributor III

Dear jk,
Ok, maybe I have understood ...
The arm-none-linux-gnueabi-SOMETHING is actually a link to arm-fsl-linux-gnueabi-SOMETHING, so they are the same binary. Call it as you like.
I.E. if you start arm-none-linux-gnueabi-gcc you will start arm-fsl-linux-gnueabi-gcc.
regards

jk said:

Dear Fillipo,

I just wanted to know if there any major pros/cons bw the compilers.

coz I have both in my directory :-), thats y I asked.

thanks fillipo.

rgds,

-jk

0 Kudos

2,194 Views
jk1z
Contributor I

Dear Fillipo,

I just wanted to know if there any major pros/cons bw the compilers.

coz I have both in my directory :-), thats y I asked.

thanks fillipo.

rgds,

-jk

0 Kudos

2,194 Views
Filippo
Contributor III

Hi jk,

Regarding the compiler you have used arm-fsl-linux----,

Is there any difference between this and arm-none-linux-gnueabi-----???

Dunno, I have this directory
/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0
I've tarred it and untarred under my own directory, I have no arm-none-linux-gnueabi directory. The binaries are arm-fsl-linux-gnueabi-SOMETHING and there are links to call them arm-none-linux-gnueabi-SOMETHING ... but I'm sure I've not understood your question ...

regards,
Filippo

0 Kudos