EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

SERIAL FLASH - reading not ok

Started by Eva Garcia October 19, 2004

Hi,,

can anyone suggest why I only read the contents of the buffer in the
serial flash (at45db642) instead of the page wanted. If I write many
pages to memory, and try to read the first written, I'll get the
results of the last data loaded to the buffer of the serial flash.

The initialization of the serial flash went on smoothly.

Here's the snippet of code:

//init
sf_init();

//writing
sf_writeRAM (arrayTest1, 0, SIZEBLOCK);
sf_writePage(&sf_dev, 1, pageToWrite);

//reading
sf_readPage(&sf_dev, 1, pageToRead);
sf_readRAM(arrayTest2, 0, SIZEBLOCK);

Thanks for the help!

a


The function sf_writePage is non-blocking. It merely begins the flash write
process.
You must poll the device using the function sf_isWriting() to see when the
write has completed.
You can also use the function sf_RAMToPage() which does block until the
write is complete.
Hope that helps.

-charlie At 07:13 PM 10/19/2004 +0000, you wrote:
>
>
>Hi,,
>
>can anyone suggest why I only read the contents of the buffer in the
>serial flash (at45db642) instead of the page wanted. If I write many
>pages to memory, and try to read the first written, I'll get the
>results of the last data loaded to the buffer of the serial flash.
>
>The initialization of the serial flash went on smoothly.
>
>Here's the snippet of code:
>
> //init
> sf_init();
>
> //writing
> sf_writeRAM (arrayTest1, 0, SIZEBLOCK);
> sf_writePage(&sf_dev, 1, pageToWrite);
>
> //reading
> sf_readPage(&sf_dev, 1, pageToRead);
> sf_readRAM(arrayTest2, 0, SIZEBLOCK);
>
>Thanks for the help!
>
>a >Yahoo! Groups Links >

Charlie Krauter
Software Engineer
Rabbit Semiconductor
ckrauter@ckra...




The 2024 Embedded Online Conference