What's the smallest flash access to avoid RWW violation?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

What's the smallest flash access to avoid RWW violation?

878 Views
nluca
Contributor III

What's the minimum flash size that can be erased/written to avoid the read while write violation on a LPC5410x ? Is it a sector or a page?

I specifically use a LPC54102.

The IAP provides some functions for sectors, some for pages. It seems a page can be erased and programmed, but a whole sector must be prepared for read/write operation.

The reason I'm asking is because we are left with a bit more than a sector size of available flash on the chip. We haven't finished writing the code and we need to permanently store a little data in there. I'd like to know whether I have to reserve the entire last sector for storing data, or if I can reserve just a page for that and make use of the rest of flash for our code.

Thanks.

Labels (1)
0 Kudos
5 Replies

734 Views
soledad
NXP Employee
NXP Employee

Hi,

 

The smallest amount of data that can be written to flash by the copy RAM to flash command is 256 byte (equal to one page). For erase commands, it is possible to erase one page using IAP Erase page command or one sector using the or IAP Erase Sector(s) command.

For both, IAP Erase page command and IAP Erase Sector command, it is necessary to use the "IAP Prepare sector(s) for write operation" command. I hope this helps,

 

Have a great day,

Sol

 

 -------------------------------------------------------------------------------

Note:

- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

 

 

- We are following threads for 7 weeks after the last post, later replies are ignored

Please open a new thread and refer to the closed one, if you have a related question at a later point in time.

-------------------------------------------------------------------------------

0 Kudos

734 Views
nluca
Contributor III

Hi,

I've realised that my question is not well stated.

Is it true that the IAP functions use some ROM code to do the copy? If that so, given that the interrupt are disabled, I would never incur in an RWW violation. The only thing to take into account is that I need to erase at least a page before writing, regardless how small the amount of data to write is.

My question was more relevant for a raw data copy instead: if I didn't use the IAP functions, and do the copy from flash to flash using memcpy, is there any limitation in accessing the flash? Can I copy on different pages within the same sector?

Thanks,

Luca

0 Kudos

734 Views
soledad
NXP Employee
NXP Employee

Hi,

I'd highly recommend you to refer to the application note:  

http://www.nxp.com/documents/application_note/AN11555.zip 

it exemplifies the IAP precautions and I think it can clarify your queries.

Have a nice day!

Regards

Soledad

0 Kudos

734 Views
nluca
Contributor III

Thanks Soledad, very useful doc.

Can you also reply to my second question, please?

Thanks.

0 Kudos

734 Views
soledad
NXP Employee
NXP Employee

Hi, 

Can I copy on different pages within the same sector?

Yes. 

Please check the following link: 

ARM Information Center 

Regards 

Sol 

0 Kudos