cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F411CC - (256kB) Flash Sectors

sean lannon
Associate II
Posted on July 10, 2017 at 18:49

Can anyone confirm what the Flash sector sizes are on this MCU version?

All documentation lumps the F411xC with the F411xE even though the former has 256kB of flash, and the latter has 512kB. The stm32f4xx_hal_flash_ex header defines the same number of sectors as the F411xE, so I'm assuming all the sectors for the STM32F411CC are just half of all the sectors outlined in the datasheet (RM0383 / DocID026448 Rev 1 - page 43).

The ST-LINK tool > Erase sectors option matches the datasheet, which is misleading as it shows a total of 512kB when counting up each sector!

0690X00000607UiQAI.png

I just want to be 100% certain. My guess is that the sectors are using the same Start address but have the following sizes:

  • Sector 0: 8K
  • Sector 1: 8K
  • Sector 2: 8K
  • Sector 3: 8K
  • Sector 4: 32K
  • Sector 5: 64K
  • Sector 6: 64K
  • Sector 7: 64K

Thanks!

#stm32f4xx-flash #flash-stm32 #stm32f411cc
1 ACCEPTED SOLUTION

Accepted Solutions
Posted on July 11, 2017 at 13:00

Yeah, sorry should have been 16-bit, typing quickly from memory.

>>t

hat there is 256kB of flash on the die

More like there is 512KB on all the die, and in your case they only spent time testing 256KB of it.

>>

Or there are the same number of sectors at half capacity..

Really not how this works.

Used to buy F205 parts with 256KB for a product, they all had 1MB on-die. 

Time on the tester is very expensive, the tester is expensive so they'll only have a few, Flash is very slow to erase and write multiple times, the flash test is going to take longer than most other logic on the rest of the IC, so they increase throughput by testing a fraction of the memory on some devices and create price stratification. They use one die because you have less work to do characterizing/validating the design, and less packaging/fixturing, and less reconfiguration between runs of wafer/die.

A data sheet covering multiple memory and pin devices is typically describing a single die whose performance they have characterized, and meets (defines) the published specs.

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

8 REPLIES 8
Posted on July 11, 2017 at 02:28

Pretty sure it's not that, the two parts likely share a common die.

16 + 16 + 16 + 16 + 64 + 128 = 256

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on July 11, 2017 at 02:40

printf('FLASH %d KB\n', *((uint32_t *)0x1FFF7A22) ); // Flash Memory on die test

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on July 11, 2017 at 11:48

With:

printf('FLASH %u KB\n', *((uint32_t *)0x1FFF7A22) ); // Flash Memory on die test

Output:   FLASH 3928883456 KB

Posted on July 11, 2017 at 12:04

So this is what I originally thought, but this would mean there are only sectors 0 - 5, but the ST-LINK seemed to allow me to erase sector 7 without warning...

If there are only 5 sectors then the header is wrong as it assumes it has the same as the F411xE, and the ST-LINK is doing something funny by allowing me to believe I can erase a sector 7. Or there are the same number of sectors at half capacity..

A long winded test I guess would be to set all memory in an address range to a non-reset value, then reset a sector and just count the number of bytes that have been reset.

I would imagine if a sector truly doesn't exist a call to HAL_FLASHEx_Erase() would return a sector error, and it's possible the ST-LINK ignores it (but unlikely?) so I can try a manual call to the above along with a call to erase a sector that I know definitely doesn't exist on the xC/E (say 9) and see what happens..

Posted on July 11, 2017 at 12:19

grep'd the address which led to the &sharpdefine FLASHSIZE_BASE, then a grep of that leads to stm32f4xx_ll_utils.h. Will see what that yields, hopefully the flash size base is followed by sector sizes..

Posted on July 11, 2017 at 12:21

Now we're cooking on gas - cast to uint16_t it confirms what I already know, that there is 256kB of flash on the die, but the low level util functions might have more answers..

Posted on July 11, 2017 at 13:00

Yeah, sorry should have been 16-bit, typing quickly from memory.

>>t

hat there is 256kB of flash on the die

More like there is 512KB on all the die, and in your case they only spent time testing 256KB of it.

>>

Or there are the same number of sectors at half capacity..

Really not how this works.

Used to buy F205 parts with 256KB for a product, they all had 1MB on-die. 

Time on the tester is very expensive, the tester is expensive so they'll only have a few, Flash is very slow to erase and write multiple times, the flash test is going to take longer than most other logic on the rest of the IC, so they increase throughput by testing a fraction of the memory on some devices and create price stratification. They use one die because you have less work to do characterizing/validating the design, and less packaging/fixturing, and less reconfiguration between runs of wafer/die.

A data sheet covering multiple memory and pin devices is typically describing a single die whose performance they have characterized, and meets (defines) the published specs.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on July 11, 2017 at 13:07

I'm with your now, makes perfect sense!

Consider this solved! 🙂

Thank you very much for your speedy & concise response!