Skip to main content
Explorer II
February 13, 2024
Solved

STM32F030F4 with 32K of flash?

  • February 13, 2024
  • 3 replies
  • 3175 views

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

    This topic has been closed for replies.
    Best answer by TDK

    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.

    3 replies

    TDKAnswer
    Super User
    February 13, 2024

    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.

    Graduate
    February 13, 2024

    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".

    :)

    CasteloAuthor
    Explorer II
    February 14, 2024

    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.

    Graduate II
    February 14, 2024

    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 */

     

    Graduate
    February 14, 2024

     

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

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