Skip to main content
rs_it
Associate
July 3, 2014
Question

STM32F429ZI - erasing upper half of 2MB flash

  • July 3, 2014
  • 3 replies
  • 756 views
Posted on July 03, 2014 at 21:20

We're writing a bootloader and found out that flash sectors 0-11 (lower bank) can be erased, but sectors 12-23 (upper bank) can't (by a program running from flash). The chip sets WRPERR bit in FLASH->SR register, which means Write protection error. But we have all the sectors NOT write protected.

Upper sectors can be erased by a STlink-v2 programmer (which is not exactly what we need - but it's a prove they CAN be erased).

Writing new content into upper sectors works fine.

Any help/idea will be appreciated.

#stm32f4-erasing-flash-bank
This topic has been closed for replies.

3 replies

Tesla DeLorean
Guru
July 4, 2014
Posted on July 04, 2014 at 02:10

Probably because you're not programming the sector number properly, the numbering sequence has a hole in it. Bit 7 of FLASH_CR is effectively a BANK Select

01011 is Sector 11 (Bank 0, Sector 11)

10000 is Sector 12 (Bank 1, Sector 0) 0x08100000
Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
rs_it
rs_itAuthor
Associate
July 4, 2014
Posted on July 04, 2014 at 13:29

I see! I didn't notice it in the manual.

I tried it and yes, this is it!!! Now it works!!! We are so happy!!!

Thank you very much, you are simply God!!!

Can I do smth for you?

Bob
Tesla DeLorean
Guru
July 4, 2014
Posted on July 04, 2014 at 22:58

Can I do smth for you?

Do you have an interesting dev boards?
Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..