[U-Boot] Swiching u-boot image in SPI-NOR

Hello I am trying to bring in u-boot.imx (uboot image of u-boot 2013) onto SPI-NOR of nitrogen 6x board.I used following commands:
sf probe 1 sf erase 0 0x40000 fatload mmc 0:1 12000000 u-boot.imx
reading u-boot.imx 343040 bytes read in 54 ms (6.1 MiB/s)
sf write 0x12000000 0x0 343040
ERROR: attempting write past flash size (0x200000)
I have no clue as how to overcome this error.Can somebody help me with this error.
Thanks in Advance!

Dear JYOTI DUBEY,
In message CAE0zQkuaek52RPtRoMM=LGVHA5OCsaMywX+FBag8sedC3YNJew@mail.gmail.com you wrote:
fatload mmc 0:1 12000000 u-boot.imx
reading u-boot.imx 343040 bytes read in 54 ms (6.1 MiB/s)
The size is here printed as a decimal number, but ...
sf write 0x12000000 0x0 343040
ERROR: attempting write past flash size (0x200000)
...sf expexts hex input; so you actually passed 0x343040 which is about 10 times the correct value.
You can easily avoid this problem by using the automatially set variable "filesize" instead.
I have no clue as how to overcome this error.Can somebody help me with this error.
Try:
fatload mmc 0:1 12000000 u-boot.imx sf write 12000000 0 $filesize
Best regards,
Wolfgang Denk

Hi Jvoty,
On 14/03/2014 08:17, JYOTI DUBEY wrote:
Hello I am trying to bring in u-boot.imx (uboot image of u-boot 2013) onto SPI-NOR of nitrogen 6x board.I used following commands:
sf probe 1 sf erase 0 0x40000 fatload mmc 0:1 12000000 u-boot.imx
reading u-boot.imx 343040 bytes read in 54 ms (6.1 MiB/s)
sf write 0x12000000 0x0 343040
ERROR: attempting write past flash size (0x200000)
Please read *carefully* the i.MX manual. The SOC expects to read the i.MX header at a specific address, depending on the selected media. On most media (SD, SPI,..) this is 0x400. It is wrong to copy u-boot.imx at the beginning of the flash.
And, as already remarked by Wolfgang, U-Boot uses hexadecimal values, not decimal.
You are not erasing enough flash. Check the size, for a nitrogen quad I get:
-rw-rw-r-- 1 stefano stefano 363520 mar 14 10:03 u-boot.imx
You are erasing only 256KB, this is not enough.
Try:
sf erase 0 60000 sf write 0x12000000 400 ${filesize}
Best regards, Stefano Babic

Yeah got it. Just specified the correct offset and converted the file size to hex value.
Thank you!
On Fri, Mar 14, 2014 at 2:43 PM, Stefano Babic sbabic@denx.de wrote:
Hi Jvoty,
On 14/03/2014 08:17, JYOTI DUBEY wrote:
Hello I am trying to bring in u-boot.imx (uboot image of u-boot 2013)
onto
SPI-NOR of nitrogen 6x board.I used following commands:
sf probe 1 sf erase 0 0x40000 fatload mmc 0:1 12000000 u-boot.imx
reading u-boot.imx 343040 bytes read in 54 ms (6.1 MiB/s)
sf write 0x12000000 0x0 343040
ERROR: attempting write past flash size (0x200000)
Please read *carefully* the i.MX manual. The SOC expects to read the i.MX header at a specific address, depending on the selected media. On most media (SD, SPI,..) this is 0x400. It is wrong to copy u-boot.imx at the beginning of the flash.
And, as already remarked by Wolfgang, U-Boot uses hexadecimal values, not decimal.
You are not erasing enough flash. Check the size, for a nitrogen quad I get:
-rw-rw-r-- 1 stefano stefano 363520 mar 14 10:03 u-boot.imx
You are erasing only 256KB, this is not enough.
Try:
sf erase 0 60000 sf write 0x12000000 400 ${filesize}
Best regards, Stefano Babic
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de =====================================================================
participants (3)
-
JYOTI DUBEY
-
Stefano Babic
-
Wolfgang Denk