public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] Swiching u-boot image in SPI-NOR
@ 2014-03-14  7:17 JYOTI DUBEY
  2014-03-14  8:45 ` Wolfgang Denk
  2014-03-14  9:13 ` Stefano Babic
  0 siblings, 2 replies; 4+ messages in thread
From: JYOTI DUBEY @ 2014-03-14  7:17 UTC (permalink / raw)
  To: u-boot

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!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] Swiching u-boot image in SPI-NOR
  2014-03-14  7:17 [U-Boot] Swiching u-boot image in SPI-NOR JYOTI DUBEY
@ 2014-03-14  8:45 ` Wolfgang Denk
  2014-03-14  9:13 ` Stefano Babic
  1 sibling, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2014-03-14  8:45 UTC (permalink / raw)
  To: u-boot

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

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"We all agree on the necessity of compromise. We just can't agree  on
when it's necessary to compromise."
                - Larry Wall in  <1991Nov13.194420.28091@netlabs.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] Swiching u-boot image in SPI-NOR
  2014-03-14  7:17 [U-Boot] Swiching u-boot image in SPI-NOR JYOTI DUBEY
  2014-03-14  8:45 ` Wolfgang Denk
@ 2014-03-14  9:13 ` Stefano Babic
  2014-03-14  9:52   ` JYOTI DUBEY
  1 sibling, 1 reply; 4+ messages in thread
From: Stefano Babic @ 2014-03-14  9:13 UTC (permalink / raw)
  To: u-boot

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 at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] Swiching u-boot image in SPI-NOR
  2014-03-14  9:13 ` Stefano Babic
@ 2014-03-14  9:52   ` JYOTI DUBEY
  0 siblings, 0 replies; 4+ messages in thread
From: JYOTI DUBEY @ 2014-03-14  9:52 UTC (permalink / raw)
  To: u-boot

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 at denx.de
> =====================================================================
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-03-14  9:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-14  7:17 [U-Boot] Swiching u-boot image in SPI-NOR JYOTI DUBEY
2014-03-14  8:45 ` Wolfgang Denk
2014-03-14  9:13 ` Stefano Babic
2014-03-14  9:52   ` JYOTI DUBEY

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox