cancel
Showing results for 
Search instead for 
Did you mean: 

How much flash the BSP_QSPI_Erase_Block() erases ?

ICohe.1
Associate III

I am using STM32F769I-DISO board with an MX25L51245G QSPI chip

As I understand it, I must erase before writing. So if I have 100 bytes of date on the QSPI

and I want to change byte number 51 in my 100 byte data I should first eras this location.

However the only function I can use for erasing is BSP_QSPI_Erase_Block(). I I want to keep the rest of the data unchanged, I must first read the unchanged data so I can save it after the erase operation. But I hav no idea how big is this block and therefore how much unchanged data I have to keep in RAM and rewrite after the erase. So How large this bock is ?

1 ACCEPTED SOLUTION

Accepted Solutions

Journal your structure across multiple sectors, have a sequence number and checksum so you can locate the most recent and complete copy. When you reach the end of the last sector, erase the first

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

3 REPLIES 3

Depends what command you chose to use 0x20/0x21 (4KB), 0x52 (32KB) or 0xD8/0xDC (64KB)

Make a secondary function to pick one suitable for your purpose. The current one should be evident from the source/defines.

Here's the datasheet for the part, you might want to review that to understand how it works, and the general mechanics

https://www.macronix.com/Lists/Datasheet/Attachments/7574/MX25L51245G,%203V,%20512Mb,%20v1.3.pdf

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
ICohe.1
Associate III

So I must buffer the whole sector(4KB) , change the bytes needed , erase the sector and write the buffer back to flash.

If something happen (power down) after erase and before write, I lose the whole sector. I could of course make a copy , set a flag, change,erase and write back, then delete that flage.

If something happen just after erase, the flag will tell me to use the copy. Any better idea, Thanks

Journal your structure across multiple sectors, have a sequence number and checksum so you can locate the most recent and complete copy. When you reach the end of the last sector, erase the first

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..