[U-Boot-Users] Cannot erase flash sector

Hi there,
I have a question about erasing flash sectors, please tell me what steps I did wrong, thank you.
The following is my boad using u-boot command "flinfo": Bank # 1: SGS Thomson PSD4256G (1 M, uniform sector) Size: 1 MB in 16 Sectors Sector Start Addresses: 20000000 (RO) 20010000 (RO) 20020000 20030000 20040000 20050000 20060000 20070000 20080000 20090000 200A0000 E 200B0000 E 200C0000 E 200D0000 E 200E0000 E 200F0000 (RO)
If I want to erase sector from 20020000 to 20090000 for example, I use the command "erase 20020000 2009ffff" to erase flash, it seems to be ok from erase message:
Erase Flash from 0x20020000 to 0x2009ffff .............. done Erased 8 sectors
But when I use "flinfo" command to see whether those sectors are erased or not, it shows the same above message: Bank # 1: SGS Thomson PSD4256G (1 M, uniform sector) Size: 1 MB in 16 Sectors Sector Start Addresses: 20000000 (RO) 20010000 (RO) 20020000 20030000 20040000 20050000 20060000 20070000 20080000 20090000 200A0000 E 200B0000 E 200C0000 E 200D0000 E 200E0000 E 200F0000 (RO)
If I understand correct, sectors from 20020000 to 20090000 should be displayed (E), but those aren't. I don't know what step I did wrong.
Regards, Joe.

In message 67a3f13e0603240556q6c1db650nbe7562335032839f@mail.gmail.com you wrote:
I have a question about erasing flash sectors, please tell me what steps I did wrong,
...
If I want to erase sector from 20020000 to 20090000 for example, I use
I'm not sure if you mean what you say. For me, this sounds as if you ant to erase the area up to (and probably NOT including) 20090000, but ...
"erase 20020000 2009ffff" to erase flash, it seems to be ok from erase mess=
This obviously erases the next sector, too, i. e. far beyond 20090000.
But when I use "flinfo" command to see whether those sectors are erased or not, it shows the same above message: Bank # 1: SGS Thomson PSD4256G (1 M, uniform sector) Size: 1 MB in 16 Sectors Sector Start Addresses: 20000000 (RO) 20010000 (RO) 20020000 20030000 20040000 20050000 20060000 20070000 20080000 20090000 200A0000 E 200B0000 E 200C0000 E 200D0000 E 200E0000 E 200F0000 (RO)
If I understand correct, sectors from 20020000 to 20090000 should be displayed (E), but those aren't. I don't know what step I did wrong.
Use "md" to verify if the sectors have been erased. If they are, then check why you get a bad display; if they are not erased, fix your flash driver.
Can you use the CFI-driver?
Best regards,
Wolfgang Denk

On 3/24/06, Wolfgang Denk wrote:
you wrote:
I have a question about erasing flash sectors, please tell me what steps I did wrong,
...
If I want to erase sector from 20020000 to 20090000 for example, I use
I'm not sure if you mean what you say. For me, this sounds as if you ant to erase the area up to (and probably NOT including) 20090000, but ...
"erase 20020000 2009ffff" to erase flash, it seems to be ok from erase mess=
This obviously erases the next sector, too, i. e. far beyond 20090000.
Thank you very much for your quick reply :-) You're right, I should erase to 20090000.
But when I use "flinfo" command to see whether those sectors are erased or not, it shows the same above message: Bank # 1: SGS Thomson PSD4256G (1 M, uniform sector) Size: 1 MB in 16 Sectors Sector Start Addresses: 20000000 (RO) 20010000 (RO) 20020000 20030000 20040000 20050000 20060000 20070000 20080000 20090000 200A0000 E 200B0000 E 200C0000 E 200D0000 E 200E0000 E 200F0000 (RO)
If I understand correct, sectors from 20020000 to 20090000 should be displayed (E), but those aren't. I don't know what step I did wrong.
Use "md" to verify if the sectors have been erased. If they are, then check why you get a bad display; if they are not erased, fix your flash driver.
After using "md", I see my linux kernel is loaded. As you mentioned, I should fix my flash driver. My flash driver is based on board/atc/flash.c, I think the problem is the function flash_erase(). Since I'm not an expert, would you give me some hints? Thanks in advance.
Can you use the CFI-driver?
Yes, I'll use that, thanks. Besides, I noticed if I use u-boot 1.1.3, the boot prompt display:
U-Boot 1.1.3 (Mar 24 2006 - 01:59:06)
U-Boot code: A3F00000 -> A3F2252C BSS: -> A3F5738C RAM Configuration: Bank #0: a0000000 64 MB Flash: 2 MB
If I use git to download u-boot current source code, the boot prompt display:
U-Boot 1.1.4 (Mar 24 2006 - 02:32:06)
DRAM: 64 MB Flash: 2 MB
I copy the same board/ and my board.h into current source code. Is that normal output? Thanks again.
Best regards,
Wolfgang Denk
-- Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de Our universe is a fragile house of atoms, held together by the mortar of cause-and-effect. One magician would be two too many. - Terry Pratchett, _The Dark Side of the Sun_
Best regards, Joe.

In message 67a3f13e0603240754t70f1f7d3k1ce193693add6417@mail.gmail.com you wrote:
After using "md", I see my linux kernel is loaded. As you mentioned, I should fix my flash driver. My flash driver is based on board/atc/flash.c, I think the problem is the function flash_erase(). Since I'm not an expert, would you give me some hints?
You must have had your reasons to think that the flah driver of the ATC board was a good choice for you. I cannot comment on this, as I don't know your hardware.
the boot prompt display:
U-Boot 1.1.3 (Mar 24 2006 - 01:59:06)
U-Boot code: A3F00000 -> A3F2252C BSS: -> A3F5738C RAM Configuration: Bank #0: a0000000 64 MB Flash: 2 MB
If I use git to download u-boot current source code, the boot prompt display:
U-Boot 1.1.4 (Mar 24 2006 - 02:32:06)
DRAM: 64 MB Flash: 2 MB
I copy the same board/ and my board.h into current source code. Is that normal output? Thanks again.
See http://www.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=commit;h=57cac1fa547fa5...
Best regards,
Wolfgang Denk

On 3/25/06, Wolfgang Denk wrote:
In message 67a3f13e0603240754t70f1f7d3k1ce193693add6417@mail.gmail.com you wrote:
After using "md", I see my linux kernel is loaded. As you mentioned, I should fix my flash driver. My flash driver is based on board/atc/flash.c, I think the problem is the function flash_erase(). Since I'm not an expert, would you give me some hints?
You must have had your reasons to think that the flah driver of the ATC board was a good choice for you. I cannot comment on this, as I don't know your hardware.
Thank you for pointing out. ATC's flash driver is suitable for me, I just thought my only problem(can't erase sectors) is flash driver, not related others files, such as lowlevel_init.S. I'll reread my flash spec again :(
the boot prompt display:
U-Boot 1.1.3 (Mar 24 2006 - 01:59:06)
U-Boot code: A3F00000 -> A3F2252C BSS: -> A3F5738C RAM Configuration: Bank #0: a0000000 64 MB Flash: 2 MB
If I use git to download u-boot current source code, the boot prompt display:
U-Boot 1.1.4 (Mar 24 2006 - 02:32:06)
DRAM: 64 MB Flash: 2 MB
I copy the same board/ and my board.h into current source code. Is that normal output? Thanks again.
See http://www.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=commit;h=57cac1fa547fa5...
I see, thanks a lot :-)
Best regards,
Wolfgang Denk
-- Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de Too much of anything, even love, isn't necessarily a good thing. -- Kirk, "The Trouble with Tribbles", stardate 4525.6
Best regards, Joe.
participants (2)
-
Joe Culler
-
Wolfgang Denk