
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£¿

Dear "hacklu.uboot",
In message 201104151401034442433@gmail.com 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

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",
In message 201104151401034442433@gmail.com 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

Dear "=?utf-8?B?aGFja2x1LnVib290?=",
In message 201104151715238470584@gmail.com 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?
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

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?=",
In message 201104151715238470584@gmail.com 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?
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

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
On Thu, Apr 14, 2011 at 11:01 PM, hacklu.uboot hacklu.uboot@gmail.comwrote:
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@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot

'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
On Thu, Apr 14, 2011 at 11:01 PM, hacklu.uboot hacklu.uboot@gmail.comwrote:
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@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
participants (3)
-
Charles Krinke
-
hacklu.uboot
-
Wolfgang Denk