cancel
Showing results for 
Search instead for 
Did you mean: 

Incorrect Flash Size

John54
Associate

Hello. I am confused about the amount of flash on an STM32F105VBT6. From the overview for the STM32F105/107 devices, I gather that this MCU should have 128 Kbytes of flash. And in STM32CubeProgrammer, in the lower right, it says that the target has 128 Kbytes of flash as well. However, I was able to program 139 Kbytes of flash, and it seems like I can successfully write 0x00000000 to the 4 bytes at 0x0803FFFC to 0x0803FFFF. So, the MCU seems to have 256 Kbytes, which is what an STM32F105VC should have. Does anyone know what's going on?

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

In short, the flash is likely there, you can use it, but it hasn't been tested. In all likelihood, it will work fine, but isn't something guaranteed to work by ST.

ST uses the same die for multiple chips, which saves on fab costs.

ST only tests 128 kB of flash on chips on which they guarantee it in order to save on testing costs.

See discussion here, among many other threads:

https://community.st.com/t5/stm32-mcus-products/stm32f030f4-with-32k-of-flash/m-p/638951

 

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

4 REPLIES 4
TDK
Guru

In short, the flash is likely there, you can use it, but it hasn't been tested. In all likelihood, it will work fine, but isn't something guaranteed to work by ST.

ST uses the same die for multiple chips, which saves on fab costs.

ST only tests 128 kB of flash on chips on which they guarantee it in order to save on testing costs.

See discussion here, among many other threads:

https://community.st.com/t5/stm32-mcus-products/stm32f030f4-with-32k-of-flash/m-p/638951

 

If you feel a post has answered your question, please click "Accept as Solution".
Pavel A.
Evangelist III

Psst! you've found an anomaly in the Matrix. You can exploit it if you are careful and keep it secret. If you report it, they will send the bots and restore the rendering to the dull norm.

Trust the manual (except you are really sure it is wrong).

The "fact" that you can write on the last word of 256K, but chip should just have 128K of flash - does not mean anything:

  • it can be an coincidence that this location is read back as 0
  • it can be that the flash memory is "aliased": you might see the same physical memory again, e.g.
    an address beyond 128KB wraps back to start
  • if you do not run a real "memory test" over the entire 256KB region (writing special, incrementing patterns for an "alias-free" check) you cannot confirm: you have 256KB instead of 128KB (as mentioned in DS)

BTW:
I cannot imagine that STM leave in 256KB flash, if just 128KB are "provided" via datasheet: this is space and power consumption. I am pretty sure, if DS says "you have just 128KB" - you really just 128KB.

You are trapped by a wrong "illusion": if you write a zero, e.g. at the end of 128KB and there is an "address aliasing": you can read back a 0 also at 256KB end. But it does not mean you have really 256KB (where I am pretty sure, you do not have if DS says 128KB).

Thank you for your response. I'll follow your suggestion and learn how to write a better memory test.