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
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
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?
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.
Please specify exact step by step sequence, how exactly you are programming your flash
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
Please specify ho exactly (using which commands) you are doing Step 2.
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.
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!
-----------------------------------------------------------------------------------------------------------------------