Skip to main content
John Smith_3
Visitor II
August 10, 2017
Question

Can I rely on a unused FLASH register bit remaining unused?

  • August 10, 2017
  • 1 reply
  • 654 views
Posted on August 10, 2017 at 12:03

I'm using a STM32L433CCU6 and due to some bad maths on my part, have shipped code to production that attempts to erase flash pages incorrectly.

The error is that instead of erasing page number n, I'm erasing page number n+128. The chip I'm using only has 256KB of application flash so actually only has 128 pages of flash all up.

 

Because of some dumb luck, this is actually working as the most significant bit of the flash page number in the PNB register seems to be ignored. See the image below that I took from the datasheet. 

0690X00000607iPQAQ.png

My question is can I rely on this working for this chip in the future? It's an easy change in my firmware to be sure, but a product recall is not so easy! Is it possible that the 10th bit will be used for something in the future, or will it effectively be a ''do not care'' bit forever, making my code functionally correct even if it is logically incorrect.

Thanks for your time,

John.

    This topic has been closed for replies.

    1 reply

    Tesla DeLorean
    Guru
    August 10, 2017
    Posted on August 10, 2017 at 14:57

    The behaviour of the chips you have already shipped won't change.

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