Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: CRC checksum error when booting kernel
PostPosted: Sat Jan 01, 2011 9:30 pm 
Offline

Joined: Thu Dec 30, 2010 6:49 pm
Posts: 38
Hi,

i am facing issues with uImage on my AtmelSAM9G45 development kit. I compiled linux-2.6.30 and converted to uImage. I am able to successfully flash the kernel image but when it tries to boot, it throws CRC checksum error. I am using the kernel source provided by the vendor. One difference i notice is vendors uImage size is around 1.5 MB but when i compile the kernel and after conversion my uImage size is 2.5MB. Will this lead to CRC errors? If so, how do i create uImage with new file size... . i am very much knew to this and not able to figure this out.Can any one please help me on this..

Thanks
Prashanth


Top
 Profile  
 
 Post subject: Re: CRC checksum error when booting kernel
PostPosted: Tue Jan 04, 2011 12:31 pm 
Offline

Joined: Tue Jan 04, 2011 12:08 pm
Posts: 1
You need to update the u-boot environment with the length of the new kernel.

For sake of argument, let's say your new kernel size is 0x280000 Bytes.
At the u-boot prompt, type printenv and see if you have a line like:

bootcmd=nand read 0x72200000 0x00200000 0x00180034; bootm 0x72200000

so do:

setenv bootcmd nand read 0x72200000 0x00200000 0x280000\; bootm0x72200000
saveenv
boot

And then you should be good to go.


Top
 Profile  
 
 Post subject: Re: CRC checksum error when booting kernel
PostPosted: Wed Jan 05, 2011 8:23 am 
Offline

Joined: Thu Dec 30, 2010 6:49 pm
Posts: 38
Thanks for the reply. I have tried the same, but it didn't work. Below are the details of my settings.

Default factory settings:
==================
U-Boot> print
bootargs=console=ttySAC0,115200 tft=m root=/dev/mtdblock6 mtdparts=atmel_nand:12
8k(bootstrap)ro,256k(uboot)ro,128k(env1)ro,128k(env2)ro,1M(logo)ro,2M(linux),-(r
oot) rw rootfstype=yaffs2
bootcmd=nand read 0x72000000 0x1A0000 0x200000; bootm
bootdelay=1
baudrate=115200
ethaddr=08:00:3e:26:0a:55
ipaddr=192.192.192.203
serverip=192.192.192.105
netmask=255.255.255.0
splashimage=0x21000000
bootlogo=0
lcdtype=800x480
ethact=macb0


From the above info we see they have allocated 2MB for the Kernel and the one given by vendor is around 1.5MB. My compiled kernel is ~2.3MB so i need more space.

To change this to 3MB, i did the following
setenv bootcmd nand read 0x72000000 0x1A0000 0x300000; bootm
saveenv
reset


When i do a print, i get back the same readings.


I used mkimage to create uImage. Below is the syntax
mkimage -A arm -O linux -T kernel -C none -a 0x20400000 -e 0x20400040 -d arch/arm/boot/zImage uImage

This built a uImage of size 2.3MB

Next i copied uImage using tftp as follows

tftp 0x70000000 uImage

Then erased the nand flash
nand erase 0x1a0000 0x300000

Then copied the image as follows
nand write 0x70000000 0x1a0000 0x300000 (3MB)

then do "reset"

I see the same issue.... not sure what is going on here. Maybe i am missing something silly :(

-Prashanth


Top
 Profile  
 
 Post subject: Re: CRC checksum error when booting kernel
PostPosted: Wed Jan 05, 2011 11:18 am 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 574
The other classic failure mode for a CRC error, is when the DRAM is bad, or incorrectly configured (CPU vs MCLK, and timing, etc). If you have modified AT91Bootstrap go back and look at that.


Top
 Profile  
 
 Post subject: Re: CRC checksum error when booting kernel
PostPosted: Wed Jan 05, 2011 12:29 pm 
Offline

Joined: Thu Dec 30, 2010 6:49 pm
Posts: 38
I didn't modify any of these. In fact i again flashed the one given by the vendor so that i get factory defaults but still the issue is seen. What else could be the problem?


Top
 Profile  
 
 Post subject: Re: CRC checksum error when booting kernel
PostPosted: Wed Jan 05, 2011 10:29 pm 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 574
Read back the content of the file from the NAND to your PC, and compare it against the original uImage file there. Approx 5 minute job using SAM-BA.

Check the integrity of the uImage file, it has two 32-bit CRC's, one for the header and one for the data. There might be tools to do this already, but a quick review of the u-Boot sources suggest it could be coded from scratch in 30-45 minutes. Post the uImage file to RapidShare, or host it somewhere, I'll take a look.

If the file doesn't come back properly, there is something in the Send, Write to NAND, Read from NAND, Receive path. Either hardware or software.

If it comes back properly, and the file checksums are all correct, it's indicative that uBoot is loading it into memory wrong, the memory is bad or being trashed.

If the integrity is bad on the PC, then your creation/packaging is wrong.

At least with these two tests you could converge on where the problem lies.


Top
 Profile  
 
 Post subject: Re: CRC checksum error when booting kernel
PostPosted: Thu Jan 06, 2011 1:37 pm 
Offline

Joined: Thu Dec 30, 2010 6:49 pm
Posts: 38
Issue with CRC was bad config file. I got the one from vendor which can generate 1.7MB file and it works but if the image exceeds more than 2MB, it fails. I was able to get through the CRC error but now it hands at "starting kernel"... it is getting on my nerves as i ams tuck with this from past 1 week. below is the console log of my failure

I will try to read back the kernel image and try to see what is wrong,., once i get this, i will post the same in rapidshare... thanks a lot for your replies...

U-Boot 1.3.4 (Jul 28 2010 - 12:11:07)

DRAM: 256 MB
## Unknown FLASH on Bank 1 - Size = 0x00000000 = 0 MB
Flash: 0 kB
NAND: 256 MiB
In: serial
Out: serial
Err: serial
Net: macb0
Hit any key to stop autoboot: 0

NAND read: device 0 offset 0x1a0000, size 0x200000
2097152 bytes read: OK
## Booting kernel from Legacy Image at 72000000 ...
Image Name:
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1757172 Bytes = 1.7 MB
Load Address: 20400000
Entry Point: 20400040
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK

Starting kernel ...


Top
 Profile  
 
 Post subject: Re: CRC checksum error when booting kernel
PostPosted: Thu Jan 06, 2011 6:39 pm 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 574
Time to break out the JTAG debugger, me thinks.


Top
 Profile  
 
 Post subject: Re: CRC checksum error when booting kernel
PostPosted: Thu Jan 06, 2011 7:06 pm 
Offline

Joined: Thu Dec 30, 2010 6:49 pm
Posts: 38
I was able to get around CRC error once I started using the config file for the board which created image of 1.7MB. The same would fail when I built my own kernel with Kernel config changes which produces image of 2.3MB. What could be possible issues with the configuration which can cause such issues?

As per Atmel site parameters for mkimage are as follows

mkimage -A arm -O linux -C none -T kernel -a 20008000 -e 20008000 -n linux-2.6 -d arch/arm/boot/Image uImage

Here the address are 0x2000800 but Atmel recommended to change it to 0x70008000. Can you throw some more light on this?

Initially I was used to load uImage at address 0x70000000 but Atmel recommended to use 0x72200000. What is the significance of this?
Sorry for asking silly questions as i am new to this...

-Prashanth


Top
 Profile  
 
 Post subject: Re: CRC checksum error when booting kernel
PostPosted: Fri Jan 07, 2011 5:41 pm 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 574
How do I get me one of those jobs?

Ok, they are all addresses in DRAM, on the G45 DDRSDRC0 is located at 0x70000000

During the boot there is a dance
AT91Boot loads into SRAM, initializes SDRAM (DDR, DDR2, whatever)
It loads uBoot into SDRAM
uBoot loads it's environment
uBoot loads the uImage into some scratch space in SDRAM
uBoot examines uImage for integrity, and moves the compressed kernel to the address specified in the header
uBoot calls the entry point in the header
Then it expands itself to some other address, starts and sets up the MMU, and executes at some other virtual address (0xC0000000 ?)

The addresses are picked to fit in the memory map as it starts and not overlap or corrupt each other. Where they may be limited by the 32, 64, 256 MB memory used in the system. One however needs to be cognizant that the addresses are used consistently. ie that the address something is compiled to be at, is the same address it is loaded at and executed. If you change the address in one place, you need to change it in ALL places it is used.

I'm using 9260, 9261 and 9G20's, putting the uBoot at 0x020000 in NAND, uImage at 0x200000 in NAND, with the FS at 0x400000 in NAND (ie 2MB max between for uImage). uBoot is loaded at 0x23F00000, uImage is loaded at 0x22000000 and the compressed kernel moved to 0x20008000 by uBoot and executed there. From there it decompresses and runs somewhere else.

The compressed G45 kernel's I've looked at do indeed load at 0x70008000, it's decompressed somewhere else. The change from 0x20008000 of the other boards is due to the address of the primary DDR bank on the G45.


Top
 Profile  
 
 Post subject: Re: CRC checksum error when booting kernel
PostPosted: Fri Jan 07, 2011 5:43 pm 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 574
The load and entry addresses here don't look right.


NAND read: device 0 offset 0x1a0000, size 0x200000
2097152 bytes read: OK
## Booting kernel from Legacy Image at 72000000 ...
Image Name:
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1757172 Bytes = 1.7 MB
Load Address: 20400000 <<<<<<<
Entry Point: 20400040 <<<<<<<
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK

Starting kernel ...


Top
 Profile  
 
 Post subject: Re: CRC checksum error when booting kernel
PostPosted: Tue Jan 11, 2011 11:38 am 
Offline

Joined: Thu Dec 30, 2010 6:49 pm
Posts: 38
Thanks ... this was really helpful.


Top
 Profile  
 
 Post subject: Re: CRC checksum error when booting kernel
PostPosted: Mon Dec 12, 2011 7:40 am 
Offline

Joined: Mon Dec 12, 2011 6:46 am
Posts: 4
I am having a similar issue and I discovered that my code had grown so much that it was getting placed in the memory location where the filesystem was being put into.

Can I just shift things around to make room for my, now bigger, image? does linux expect the filesystem to be at a fixed memory location?

Thank you for your help


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: