QSPI FLASH write protect

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

QSPI FLASH write protect

4,198 Views
kensu
Contributor V

Hi,

I am using LPC1830, and I use the dfusec tool to download application image to QSPI flash , also I use dfusec tool to download other user data into flash to another location.

I have a question about QSPI write protection.

I use normal SPI(two SIO) in my other project, and I will use one GPIO to control the write protect pin.

This is my first time to use QPSI(4 SIO), I am not sure how to handle the "write protect".

Now I only use DFUSEC for my download tool.

1. I think the write protect enalbe/disable is handle by DFUSEC tool, it will use the SPIFI API for lock/unlock?

2. After DFUSEC tool complete the wrte, the QSPI will be in "write protect" status? Should I call lock api again?

3. If I write my download tool I need use SPIFI command in my tool, is my understanding correct?

Thanks

Ken

Labels (1)
0 Kudos
5 Replies

2,497 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Ken,

The write protection is handled by the caller not by the driver. Serial flash devices provide write-protection in several ways.  Most devices simply have 2 to 5 bits in their status registers that specify what fraction of the device is write protected, possibly in conjunction with a “fraction at top or bottom” bit and/or a “fraction is protected/unprotected” bit.  For such devices the driver simply saves the status byte, then clears all of the 2 to 5 bits so that the whole device is write-enabled.  Some serial flash devices use individual protection bits for each sector.  These include SST quad devices, Atmel devices, and Macronix devices that provide a “WPSEL” command and on which such a command has been executed (Setting WPSEL is an irrevocable operation). 

Hope it helps!

Best Regards,
Carlos Mendoza
Technical Support Engineer

0 Kudos

2,497 Views
kensu
Contributor V

Hi

Thanks for reply,

I understood the QSPI more now.

"The write protection is handled by the caller not by the driver. "

I think I understood.

But I want to confirm if I use DFUSEC tool to write flash, the DFUSEC tool is caller, right? and the QSPI API is the driver.

I want to know if DFUSEC tool will enable the QSPI write protect after upgrade.

Thanks

Ken

0 Kudos

2,497 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Ken,

 

The DFUSEC can't enable the write protection, this protection needs to be handled by you application, you could use the SPIFI Iib spifiDevPageProgram function to write to the status register of your memory to set the write protection.

 

Hope it helps!

 

Best Regards,
Carlos Mendoza
Technical Support Engineer

0 Kudos

2,497 Views
kensu
Contributor V

Hi,

Thanks for your reply, I understood,

I want to confirm again, 

Can dfusec not disable write protect too?

If QSPI is enabled write protect from application, then I use the DFUSEC to upgrade QSPI, 

Can QSPI work? 

Thanks

Ken

0 Kudos

2,497 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Ken,

 

No, the DFUSEC can't disable the write protection, this protection needs to be handled by you application. If the memory is protected then the tool is not going to be able to perform the program an erase instructions.

 

Hope it helps!

 

Best Regards,
Carlos Mendoza
Technical Support Engineer

0 Kudos