crc checksum fails to boot kernel

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

crc checksum fails to boot kernel

1,937 Views
vijayb1
Contributor II

Hi,

we have fw upgrade feature implemented. At times we see CRC check sum fails on the updated image.

Once we update the boot args to the correct image size issue gets resolved.

What is the way to update the bootargs to take the correct image size.

we do not want to give default bigger size, as it will unduly delay the boot process.

tftp boot calculates this dynamically based on the downloaded size. Is there a way we can direct uboot to read image header from partition and copies the required size and then calculate crc?

Thanks

Vijay

0 Kudos
9 Replies

1,465 Views
vijayb1
Contributor II

Hi Alexander,

Yep, that is the way it is now. My question was if we are not using tftp, right now I do software upgrade without using tftp, Accessing the NOR flash to update the image. I do not have a way to update the $filesize. So uboot fails to load the image as uImage size is bigger than the default $filesize.

So was looking If there is way in u-boot to read image size header from flash uImage sector.

As this is memory mapped device, can I do a memread ( i don't know what is right approach to read the address) and get the file size from uImage header.

Thanks

Vijay

0 Kudos

1,465 Views
alexander_yakov
NXP Employee
NXP Employee

I do not understand what you exactly mean by "I do software upgrade without using tftp, accessing the NOR flash to update the image". If you are programming a new image into flash directly, without using u-boot, than what stops you from updating u-boot environment variables in the same time?

0 Kudos

1,465 Views
vijayb1
Contributor II

We program flash directly using NOR flash driver to access the sector location. Still we use uboot to load the image from flash sector.

In case of tftp when download happens it updates the $flashsize, in my case I do not have access to the environment variable to update the size once I program the flash. So uboot looks up $flashsize and copies the image to RAM and does CRC calculation.

In our case we are not using Linux kernel image but rather a different real time os. Hope I was able to clear the doubt.

0 Kudos

1,465 Views
alexander_yakov
NXP Employee
NXP Employee

Please specify exact step by step sequence, how exactly you are programming your flash

0 Kudos

1,465 Views
vijayb1
Contributor II

Once System is up.

1) Start Software upgrade process if required

2) Send the image to NOR flash driver

3) Write kernel image to sector (0x80200000), there is no way for us to update sizekernel boot args.

4) reboot the system

5) uboot loads the image

since sizekernel is not updated with correct image size it fails to load the full image so crc fails on the copied image

0 Kudos

1,465 Views
alexander_yakov
NXP Employee
NXP Employee

Please specify ho exactly (using which commands) you are doing Step 2.

0 Kudos

1,465 Views
vijayb1
Contributor II

step 2

1) This is separate application that sends the kernel image via USB.

2) Upgrade process as part of kernel image reads the data vis USB and writes it using NOR flash driver

Thanks

Vijay

0 Kudos

1,465 Views
alexander_yakov
NXP Employee
NXP Employee

This "separate application" must be aware about what is received via USB, this received file must be checked if this is really a file with new image, but not just a junk, so this application must verify file signature and checksum. As long as it needs to verify checksum, it should know exact image size. This image size information should be used to update u-boot environment variables after successful image reprogramming. Another way is reprogramming u-boot environment variables part in flash. I do not see other options.

0 Kudos

1,465 Views
alexander_yakov
NXP Employee
NXP Employee

When tftp transfer is completed, uboot stores transferred file size to "filesize" environment variable.

So if you wish to transfer file size as boot args, please use $filesize


Have a great day,
Alexander

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

0 Kudos