Skip to main content
Explorer II
May 30, 2025
Solved

Flash structure confusing page number

  • May 30, 2025
  • 1 reply
  • 342 views

Hii

I am using stm32g0b0cet6, while writing bootloader, i am confused with the page number and the total storage.

Its total storage is 512 kb, According to the reference manual, The Main memory is shown like below

skuma8_0-1748584125478.png

Question1: If each page is 2kb & total number of pages are 383, then total flash should would be 2x383 = 768 kb. (contradiction ot total flash size)

Question2: According to the memory address given of first & last page, the total memory comes up after calculation is 512 kb. here is the calculation:

0x0807F800(last page starting address) - 0x08000000 (0th page starting address) = 0x7F800 = 522240 bytes
Add the last page size (2 KB = 2048 bytes):
522240 + 2048 = 524288 bytes = 512 KB

So if it is 512 kb, divided by page size 2kb, it should have total number of page as 256. right? but reference manual have mention 383.

 

    This topic has been closed for replies.
    Best answer by Pavel A.

    Mind the gap. Note that the numeration is not continuous:  0-127 then 256-383. Total 2*128 = 256 pages.

     

     

    1 reply

    Pavel A.Answer
    Super User
    May 30, 2025

    Mind the gap. Note that the numeration is not continuous:  0-127 then 256-383. Total 2*128 = 256 pages.