Skip to contentSkip to conversation

flash memory access

U-Boot-Users Paul McAvoy 3 participants 10 messages Mar 1, 2003 – Mar 2, 2003

lore
Share & tools
lore
#0 lore raw

Hi, I am having difficulties figuring out what is going on with my board setup.

I am able to read flash memory, set the write-protect on it okay, but when I try to erase, or write flash memory, the system hangs.

I run the command:

Quoted 4 lines

Saving Environment to Flash...
int> Protect off 25080000 ... 2509FFFF
Un-Protected 1 sectors
Erasing Flash...Erasing sector 135/135 ... a

(with some of my debug code in there)

Flash memory starts for me at: 0x24000000
I have an Atmel chip, 32Megbyts, 256 * 128K sectors.

Reading through the manuals for the board, and the flash chip, I am unable to find any relevant docs when it comes to erasing / writing issues.

Anyone have any comments which might help me out in this situation?

Thanks!

- Paul

Signature · 1 line
PGP key		- http://queda.net/paulmcav-gpg.txt
#1 lore raw

Hmm.. after more reading, I have found that in order to program _ANY_ of the flash on my atmel chip the following is the case:

1) the entire chip has to be erased, setting all bits to 1
2) any bytes can be programmed setting the bits to 0

This leads me to conclude that in order to program flash, I would have to copy the entire contents into memory, erase the chip, and then re-flash it.

Does anyone else have this similar situation? How has it been dealt with?

- Paul

Quoted 28 lines · Paul McAvoy

Hi, I am having difficulties figuring out what is going on with my board setup.

I am able to read flash memory, set the write-protect on it okay, but when I try to erase, or write flash memory, the system hangs.

I run the command:

Quoted 4 lines

Saving Environment to Flash...
int> Protect off 25080000 ... 2509FFFF
Un-Protected 1 sectors
Erasing Flash...Erasing sector 135/135 ... a

(with some of my debug code in there)

Flash memory starts for me at: 0x24000000
I have an Atmel chip, 32Megbyts, 256 * 128K sectors.

Reading through the manuals for the board, and the flash chip, I am unable to find any relevant docs when it comes to erasing / writing issues.

Anyone have any comments which might help me out in this situation?

Thanks!

- Paul

Signature · 1 line
PGP key		- http://queda.net/paulmcav-gpg.txt
#2 lore raw
Quoted 5 lines · In message <[email protected]> you wrote:

Hmm.. after more reading, I have found that in order to program _ANY_ of the flash on my atmel chip the following is the case:

1) the entire chip has to be erased, setting all bits to 1
2) any bytes can be programmed setting the bits to 0

...

Quoted 1 line
Quoted 1 line

I have an Atmel chip, 32Megbyts, 256 * 128K sectors.

This makes no sense. If the flash chip has 256 sectors (aka "erase units"), you can always erase each individual sector without any influence on the other 255 sectors.

Best regards,

Wolfgang Denk

Signature · 6 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
Niklaus Wirth has lamented that, whereas Europeans pronounce his name
correctly (Ni-klows Virt), Americans invariably mangle it into (Nick-
les Worth). Which is to say that Europeans  call  him  by  name,  but
Americans call him by value.
#3 lore raw

I was using the reference of 256 * 128K sectors from some other demo sorce code that came with the board. But after looking at the datasheet for the device:
http://www.atmel.com/dyn/products/product_card.asp?family_id=624&family_name
=Flash+Memory&part_id=1761

There is no mention of any sectors on the chip, and the only way to re-program it (apparently) is to re-flash the entire thing.

-p

----- Original Message -----
From: "Wolfgang Denk" <[email protected]>
To: "Paul McAvoy" <[email protected]>
Cc: <[email protected]>
Sent: Saturday, March 01, 2003 3:16 PM
Subject: Re: [U-Boot-Users] flash memory access

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

Hmm.. after more reading, I have found that in order to program _ANY_ of

the

Quoted 25 lines
Quoted 4 lines

flash on my atmel chip the following is the case:

1) the entire chip has to be erased, setting all bits to 1
2) any bytes can be programmed setting the bits to 0

...

Quoted 1 line
Quoted 1 line

I have an Atmel chip, 32Megbyts, 256 * 128K sectors.

This makes no sense. If the flash chip has 256 sectors (aka "erase units"), you can always erase each individual sector without any influence on the other 255 sectors.

Best regards,

Wolfgang Denk

--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd at denx.de Niklaus Wirth has lamented that, whereas Europeans pronounce his name correctly (Ni-klows Virt), Americans invariably mangle it into (Nick- les Worth). Which is to say that Europeans call him by name, but Americans call him by value.

#4 lore raw

Hello,

it is not particularly helpful if you ask others for help and give misleading and/or false information. The link you provided leads to an Atmel 4 MBIT chip (=512 KBytes), which indeed can only be erased in whole (optionally excluding a small boot region which IS too small to hold U-Boot).

This Chip has neither 32MB nor 256 Sectors at 128K each...

After using up 128 KBytes or so for U-Boot, what do you intend to do with the Rest of 384 KBytes?? Put in a LinuX Kernel?? That won't fit at all!

Are you really sure THAT old chip is on the board? Would not make any sense for a newer design...

Regards Reinhard

----- Original Messages (Snipped) -----
From: "Paul McAvoy" <[email protected]>
To: <[email protected]>

Quoted 5 lines

I was using the reference of 256 * 128K sectors from some other demo sorce code that came with the board. But after looking at the datasheet for the device:

http://www.atmel.com/dyn/products/product_card.asp?family_id=624&family_name
=Flash+Memory&part_id=1761

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

I have an Atmel chip, 32Megbyts, 256 * 128K sectors.

#5 lore raw
In reply to Paul McAvoy
Quoted 5 lines · In message <000901c2e058$c149ac50$1400a8c0@bodhi> you wrote:

I was using the reference of 256 * 128K sectors from some other demo sorce code that came with the board. But after looking at the datasheet for the device:
http://www.atmel.com/dyn/products/product_card.asp?family_id=624&family_name
=Flash+Memory&part_id=1761

Aaaaargghhhh!!

You started asking about "an Atmel chip, 32Megbyts, 256 * 128K sectors" (your own words, includinh the typo). You did not bother to list the exact type, so we could only guess from the parameters you quoted. Of course I assumed these were at least correct!

Quoted 2 lines

There is no mention of any sectors on the chip, and the only way to re-program it (apparently) is to re-flash the entire thing.

I don't know how you manage to do this, but ALL of your information is wrong.

The chip is neiter 32 Megabytes, nor 32 Megabits, but 512 k x 8 (512k Bytes, 4096 Mbit).

The chips has neither 256 * 128K sectors (those would have to be

virtual  sectors  anyway  :-),  but  your  statement  that  you  have
"re-flash the entire thing" is wrong either - it  is  a  Bottom  Boot

type with a dedicated 16 kB boot sector.

I am a bit surprised to see this chip in any current design, so I would not be surprised if in you rnext message you will tell us that it is some other chip in fact.

You know, I understand when people post vague questions about things they cannot understand; but looking up a chip type and reading its spec is pretty straightforward, and you are expected to do your homework. Instead, you wasted my time.

Wolfgang Denk

Signature · 3 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
A supercomputer is a machine that runs an endless loop in 2 seconds.
#6 lore raw

I'm sorry. I am confused here.

When I boot the board, I am told by the ROM boot monitor (as well as specs for the board) that there is 32MBytes of flash memory.

I am unable to determine anything about the flash configuration from the documentation I get from Arm's website. So, looking at the board, I found an atmel chip, The actual chip number is:

AT49LV040
90JC
0152

I am really sorry about this confusion. It is entirely my fault! After realizing my mistake, I took another look at the board, and found the actual flash chip with 32Megs available. It is a Sharp LHF32K01.

This is my first foray into working with non x86 hardware. All my previous experience with hardware has been in a non-programming role as well. I am
also working on this project solo. So I apologize for sending out confusing
messages. Feel free to just respond with 'you are a donkeys rear' in the
future if necessary.

Thanks for your time.

- Paul

Quoted 47 lines · Wolfgang Denk
Quoted 5 lines · In message <000901c2e058$c149ac50$1400a8c0@bodhi> you wrote:

I was using the reference of 256 * 128K sectors from some other demo sorce code that came with the board. But after looking at the datasheet for the device:
http://www.atmel.com/dyn/products/product_card.asp?family_id=624&family_name
=Flash+Memory&part_id=1761

Aaaaargghhhh!!

You started asking about "an Atmel chip, 32Megbyts, 256 * 128K sectors" (your own words, includinh the typo). You did not bother to list the exact type, so we could only guess from the parameters you quoted. Of course I assumed these were at least correct!

Quoted 2 lines

There is no mention of any sectors on the chip, and the only way to re-program it (apparently) is to re-flash the entire thing.

I don't know how you manage to do this, but ALL of your information is wrong.

The chip is neiter 32 Megabytes, nor 32 Megabits, but 512 k x 8 (512k Bytes, 4096 Mbit).

The chips has neither 256 * 128K sectors (those would have to be

virtual  sectors  anyway  :-),  but  your  statement  that  you  have
"re-flash the entire thing" is wrong either - it  is  a  Bottom  Boot

type with a dedicated 16 kB boot sector.

I am a bit surprised to see this chip in any current design, so I would not be surprised if in you rnext message you will tell us that it is some other chip in fact.

You know, I understand when people post vague questions about things they cannot understand; but looking up a chip type and reading its spec is pretty straightforward, and you are expected to do your homework. Instead, you wasted my time.

Wolfgang Denk

Signature · 3 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
A supercomputer is a machine that runs an endless loop in 2 seconds.
#7 lore raw

----- Original Message -----
From: "Paul McAvoy" <[email protected]>
To: <[email protected]>
Sent: Sunday, March 02, 2003 7:45 PM
Subject: Re: [U-Boot-Users] flash memory access

Quoted 1 line

I'm sorry. I am confused here.

THAT seems obvious ;)

Quoted 1 line

When I boot the board, I am told by the ROM boot monitor (as well as specs

for

Quoted 1 line

the board) that there is 32MBytes of flash memory.

Really BYTES or is that BITS??

Quoted 2 lines

I am really sorry about this confusion. It is entirely my fault! After realizing my mistake, I took another look at the board, and found the

actual

Quoted 1 line

flash chip with 32Megs available. It is a Sharp LHF32K01.

THAT Chip has 32 MegaBITS, aka 4 MegaBYTES

So you either have EIGHT of them on that board, or you are still confused

Quoted 1 line

This is my first foray into working with non x86 hardware. All my

previous

Quoted 2 lines

experience with hardware has been in a non-programming role as well. I am
also working on this project solo. So I apologize for sending out

confusing

Quoted 2 lines

messages. Feel free to just respond with 'you are a donkeys rear' in the
future if necessary.

In THAT case I would familiarize myself thoroughly with non x86 Hardware (which IMHO is more straightforward than x86 hardware anyway) and with programming hardware in general.

#8 lore raw
Quoted 9 lines · Reinhard Meyer
Quoted 1 line

I'm sorry. I am confused here.

THAT seems obvious ;)

Quoted 1 line

When I boot the board, I am told by the ROM boot monitor (as well as specs

for

Quoted 1 line

the board) that there is 32MBytes of flash memory.

Really BYTES or is that BITS??

Bytes

Quoted 5 lines
Quoted 1 line

flash chip with 32Megs available. It is a Sharp LHF32K01.

THAT Chip has 32 MegaBITS, aka 4 MegaBYTES

So you either have EIGHT of them on that board, or you are still confused

There are 8 chips on the board.

- Paul

#9 lore raw

----- Original Message -----
From: "Paul McAvoy" <[email protected]>
To: <[email protected]>
Sent: Sunday, March 02, 2003 8:50 PM
Subject: Re: [U-Boot-Users] flash memory access

Quoted 6 lines · Reinhard Meyer
Quoted 5 lines
Quoted 1 line

I'm sorry. I am confused here.

THAT seems obvious ;)

Quoted 1 line

When I boot the board, I am told by the ROM boot monitor (as well as

specs

Quoted 12 lines
Quoted 4 lines

for

Quoted 1 line

the board) that there is 32MBytes of flash memory.

Really BYTES or is that BITS??

Bytes

Quoted 5 lines
Quoted 1 line

flash chip with 32Megs available. It is a Sharp LHF32K01.

THAT Chip has 32 MegaBITS, aka 4 MegaBYTES

So you either have EIGHT of them on that board, or you are still

confused

Quoted 2 lines

There are 8 chips on the board.

Then you will have to figure out how they are arranged. It is likely that they are arranged such that the FLASH is 32 Bits wide. So it could be two banks of four chips in 8-Bit mode or 4 banks of two chips in 16-Bit mode.

That hugely affects how they will be programmed.

Why don't you give ALL the Information you have found out so far? This messaging goes on for days, and every exchange seems to pull out some more info out of your nose....