Sign in

username:

password:



Not a member?

Search rabbit-semi



Search tips

Subscribe to rabbit-semi



Ads

Discussion Groups

Discussion Groups | Rabbit-Semi | Erasing NAND Flash using NFLASH_USEERASEBLOCKSIZE=0?

This is a group for folks designing and programming embedded systems using the Rabbit Semiconductor C-programmable microcontroller. Rabbit Semi is a spin-off from Z-World who makes a variety of embedded modules and tools. This group is not affiliated with either Rabbit or Z-World, but is a user forum for sharing ideas, asking questions, flaunting knowledge, and other typical user group stuff. The Rabbit is a powerful uC, supported by a full-featured C-compiler.

Erasing NAND Flash using NFLASH_USEERASEBLOCKSIZE=0? - pdaderko - Jun 16 13:37:23 2008

Hi,

I'm looking to be able to erase flash from within my program, but I
have a question about doing it with NFLASH_USEERASEBLOCKSIZE=0. The
function nf_eraseBlock takes two arguments: nf_device * dev and long
page. I know what the dev argument is, but what about the page
number? Is this the erase page number (16K blocks), or the write page
number (512 byte blocks)?

The erase sample says NFLASH_USEERASEBLOCKSIZE must be 1, but does
that mean I can't erase the flash if I'm writing in 512 byte blocks?
I don't mind if I can only erase in 16K blocks (I really just want to
be able to erase the entire flash), I just need to know what argument
to pass to it, or if I need to modify the lib to allow this.

And yes, if I need to, I can use 16K write blocks, but it performs
much better using 512 byte blocks, so I'd prefer to keep using it like
this.

Thanks,
Pat
------------------------------------



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )


Re: Erasing NAND Flash using NFLASH_USEERASEBLOCKSIZE=0? - pdaderko - Jun 23 22:13:11 2008

--- In r...@yahoogroups.com, "pdaderko" wrote:
>
> Hi,
>
> I'm looking to be able to erase flash from within my program, but I
> have a question about doing it with NFLASH_USEERASEBLOCKSIZE=0. The
> function nf_eraseBlock takes two arguments: nf_device * dev and long
> page. I know what the dev argument is, but what about the page
> number? Is this the erase page number (16K blocks), or the write page
> number (512 byte blocks)?
>
> The erase sample says NFLASH_USEERASEBLOCKSIZE must be 1, but does
> that mean I can't erase the flash if I'm writing in 512 byte blocks?
> I don't mind if I can only erase in 16K blocks (I really just want to
> be able to erase the entire flash), I just need to know what argument
> to pass to it, or if I need to modify the lib to allow this.
>
> And yes, if I need to, I can use 16K write blocks, but it performs
> much better using 512 byte blocks, so I'd prefer to keep using it like
> this.
>
> Thanks,
> Pat
>

I think I answered my own question, but in case someone comes across
this in the future, nf_eraseBlock() takes the page number of the write
block, but erases the entire erase block. So, since there's 32 write
blocks for a single erase block (512 byte write block, 16KB erase
block), with NFLASH_USEERASEBLOCKSIZE=0, doing
nf_eraseBlock(nand_flash, 0) through nf_eraseBlock(nand_flash, 31) all
erase the first erase block (first 16KB of the flash). So, for me to
erase the entire chip, I do a loop incrementing by 32 while less than
the number of pages.

Pat
------------------------------------



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )