cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F030F4 with 32K of flash?

Castelo
Associate II

Hello! I am experimenting with a STM32F030F4P6. When I connect it to STM32CubeProgrammer via bootoader (UART), there is an info saying the micro has 32Kb of flash, instead of the expected 16Kb for this part.

Is it possible that this microcontroller really have 32Kb of memory? Anyone had similar experiences?

 

Thank you.32Kb.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

The same die is used for multiple chips. It is possible, even likely, that the chip contains the full FLASH available on other packages, however only the 16 kB the datasheet specifies is tested and guaranteed to work. You use the rest at your own risk.

Using the same die for multiple chips cuts down on production costs. Only guaranteeing a portion of the FLASH actually on the chip cuts down on testing costs.

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

View solution in original post

8 REPLIES 8
TDK
Guru

The same die is used for multiple chips. It is possible, even likely, that the chip contains the full FLASH available on other packages, however only the 16 kB the datasheet specifies is tested and guaranteed to work. You use the rest at your own risk.

Using the same die for multiple chips cuts down on production costs. Only guaranteeing a portion of the FLASH actually on the chip cuts down on testing costs.

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

The actual meaning of this chip marking is:

STM32F030F4

F - the chip has 20-pin case and 32 KiB of Flash

4 - you paid for 16 KiB

It's similar for STM32F103C8 vs. CB.

The decoding of the 2nd character after the base number is different in different STM32 famlilies. For L4+ series the interpretation extends to: "you paid for one half only so we disabled the second half".

🙂

Castelo
Associate II

Thank you! Well, if I can really use all 32Kb of memory for the price of 16Kb, then great! I´m using this chip to learn how to program 32 bit micros. Let us see how fast I´m going to reach the 16Kb limit of flash.

Use floating point, and you'll probably get there very quickly

This is the Reference Manual for your part, you can read the tested flash size via a memory location.

https://www.st.com/resource/en/reference_manual/rm0360-stm32f030x4x6x8xc-and-stm32f070x6xb-advanced-armbased-32bit-mcus-stmicroelectronics.pdf

 

STM32Cube_FW_F0_V1.11.4\Drivers\STM32F0xx_HAL_Driver\Inc\stm32f0xx_ll_utils.h

/**
  * @brief  Get Flash memory size
  * @note   This bitfield indicates the size of the device Flash memory expressed in
  *         Kbytes. As an example, 0x040 corresponds to 64 Kbytes.
  * @retval FLASH_SIZE[15:0]: Flash memory size
  */
__STATIC_INLINE uint32_t LL_GetFlashSize(void)
{
  return (uint16_t)(READ_REG(*((uint32_t *)FLASHSIZE_BASE_ADDRESS)));
}
#define FLASHSIZE_BASE        0x1FFFF7CCUL       /*!< FLASH Size register base address */
#define UID_BASE              0x1FFFF7ACUL       /*!< Unique device ID register base address */

 

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

 

return (uint16_t)(READ_REG(*((uint32_t *)FLASHSIZE_BASE_ADDRESS)));

That couldn't have been written by a sober person. 😉

I guess if it makes the compiler and compliance tools happy..

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

Maybe a Whiskey helps to understand...

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

You mean the compiler would be unhappy if it wasn't forced with volatile to read the 32-bit data it has to read anyway, cast it to 16 bits than again to 32. 😉

Another fun piece: boolean type has yet to be discovered by HAL programmers