2017-07-10 09:49 AM
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!
I just want to be 100% certain. My guess is that the sectors are using the same Start address but have the following sizes:
Thanks!
#stm32f4xx-flash #flash-stm32 #stm32f411ccSolved! Go to Solution.
2017-07-11 06:00 AM
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.
2017-07-10 05:28 PM
Pretty sure it's not that, the two parts likely share a common die.
16 + 16 + 16 + 16 + 64 + 128 = 256
2017-07-10 07:40 PM
printf('FLASH %d KB\n', *((uint32_t *)0x1FFF7A22) ); // Flash Memory on die test
2017-07-11 04:48 AM
With:
printf('FLASH %u KB\n', *((uint32_t *)0x1FFF7A22) ); // Flash Memory on die testOutput: FLASH 3928883456 KB
2017-07-11 05:04 AM
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..
2017-07-11 05:19 AM
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..
2017-07-11 05:21 AM
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..
2017-07-11 06:00 AM
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.
2017-07-11 06:07 AM
I'm with your now, makes perfect sense!
Consider this solved! :)
Thank you very much for your speedy & concise response!