Skip to contentSkip to conversation

is any bug in cp?

U-Boot hacklu.uboot 3 participants 7 messages Apr 15, 2011 – Apr 18, 2011 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

hi,in my uboot.

there is some bugs when I cp to flash like this:
cp.b addr1 addr2 0x100

when the two addr in the same bank of a flash. it go wrongs

finally the date of addr2 is 0x8080808080...

cp to another bank of flash is work correctly. cp from mem to flash or from flash to mem also correctly.

how is this??

#2 lore raw

Dear "hacklu.uboot",

Quoted 10 lines · In message <[email protected]> you wrote:

there is some bugs when I cp to flash like this:
cp.b addr1 addr2 0x100

when the two addr in the same bank of a flash. it go wrongs

finally the date of addr2 is 0x8080808080...

cp to another bank of flash is work correctly. cp from mem to flash or from flash to mem also correctly.

You cannot copy directly within the same bank of NOR flash. While in programming mod, you cannot read any user data from that device. This is a "feature" of how NOR flash works and no bug in the code. Just don't do it.

Best regards,

Wolfgang Denk

Signature · 7 lines
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
There are two ways of constructing a software design. One way  is  to
make  it  so  simple that there are obviously no deficiencies and the
other is to make it so complicated that there are  no  obvious  defi-
ciencies.                             - Charles Anthony Richard Hoare
#3 lore raw

em..
how linux does that?
does linux read the data to mem first before it write to the same bank of a nor flash?

thanks much~

------------------
hacklu.uboot
2011-04-15

-------------------------------------------------------------
????????????Wolfgang Denk
???????????????2011-04-15 16:44:47
????????????hacklu.uboot
?????????u-boot
?????????Re: [U-Boot] is any bug in cp?

Dear "hacklu.uboot",

Quoted 10 lines · In message <[email protected]> you wrote:

there is some bugs when I cp to flash like this:
cp.b addr1 addr2 0x100

when the two addr in the same bank of a flash. it go wrongs

finally the date of addr2 is 0x8080808080...

cp to another bank of flash is work correctly. cp from mem to flash or from flash to mem also correctly.

You cannot copy directly within the same bank of NOR flash. While in programming mod, you cannot read any user data from that device. This is a "feature" of how NOR flash works and no bug in the code. Just don't do it.

Best regards,

Wolfgang Denk

Signature · 7 lines
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
There are two ways of constructing a software design. One way  is  to
make  it  so  simple that there are obviously no deficiencies and the
other is to make it so complicated that there are  no  obvious  defi-
ciencies.                             - Charles Anthony Richard Hoare
#4 lore raw

Dear "=?utf-8?B?aGFja2x1LnVib290?=",

Quoted 2 lines · In message <[email protected]> you wrote:

em..
how linux does that?

What exactly are you doing in Linux? Are we talking about user-space access through a file sytem (and thus block devices) based on the MTD layer? Or about raw access to the flash devices? Or about in-kernel code directly accessing some CFI driver routines?

Quoted 1 line

does linux read the data to mem first before it write to the same bank of a nor flash?

For user space operations on file system level: yes.

Best regards,

Wolfgang Denk

Signature · 7 lines
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
In any group of employed individuals the only naturally  early  riser
is  _always_  the office manager, who will _always_ leave reproachful
little notes ... on the desks of their subordinates.
                                - Terry Pratchett, _Lords and Ladies_
#5 lore raw

thanks ,
I have understanded.

------------------
hacklu.uboot
2011-04-18

-------------------------------------------------------------
????????????Wolfgang Denk
???????????????2011-04-15 18:21:23
????????????hacklu.uboot
?????????u-boot
?????????Re:Re: Re: [U-Boot] is any bug in cp?

Dear "=?utf-8?B?aGFja2x1LnVib290?=",

Quoted 2 lines · In message <[email protected]> you wrote:

em..
how linux does that?

What exactly are you doing in Linux? Are we talking about user-space access through a file sytem (and thus block devices) based on the MTD layer? Or about raw access to the flash devices? Or about in-kernel code directly accessing some CFI driver routines?

Quoted 1 line

does linux read the data to mem first before it write to the same bank of a nor flash?

For user space operations on file system level: yes.

Best regards,

Wolfgang Denk

Signature · 7 lines
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
In any group of employed individuals the only naturally  early  riser
is  _always_  the office manager, who will _always_ leave reproachful
little notes ... on the desks of their subordinates.
                                - Terry Pratchett, _Lords and Ladies_
#6 lore raw
In reply to hacklu.uboot

This makes sense as one should *not* copy from one sector in a flash to the same sector in a flash. Flash is erased in sectors, usually 128K and should be treated as a complete sector.

The cp command is usually used to copy from RAM to FLASH or from FLASH to RAM. What you are doing seems illogical.

Charles

Quoted 21 lines · hacklu.uboot

hi,in my uboot.

there is some bugs when I cp to flash like this:
cp.b addr1 addr2 0x100

when the two addr in the same bank of a flash. it go wrongs

finally the date of addr2 is 0x8080808080...

cp to another bank of flash is work correctly. cp from mem to flash or from flash to mem also correctly.

how is this?

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Signature · 1 line
Charles Krinke
#7 lore raw

'cp' can also copy from flash to another bank of flash. I have test it.
thanks all the same

------------------
hacklu.uboot
2011-04-18

-------------------------------------------------------------
????????????Charles Krinke
???????????????2011-04-15 22:02:13
????????????hacklu.uboot
?????????u-boot
?????????Re: [U-Boot] is any bug in cp?

This makes sense as one should *not* copy from one sector in a flash to the same sector in a flash. Flash is erased in sectors, usually 128K and should be treated as a complete sector.

The cp command is usually used to copy from RAM to FLASH or from FLASH to RAM. What you are doing seems illogical.

Charles

Quoted 21 lines · hacklu.uboot

hi,in my uboot.

there is some bugs when I cp to flash like this:
cp.b addr1 addr2 0x100

when the two addr in the same bank of a flash. it go wrongs

finally the date of addr2 is 0x8080808080...

cp to another bank of flash is work correctly. cp from mem to flash or from flash to mem also correctly.

how is this???

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Signature · 1 line
Charles Krinke