Skip to main content
Explorer
September 22, 2023
Question

stm32f103vgt6 flash issue

  • September 22, 2023
  • 3 replies
  • 1649 views

I am currently using the STM32F103VGT6 MCU controller, which has an internal flash 1MB divided into two banks, each with a size of 512KB. I have written a code that is 600KB in size. After writing to the entirety of Bank 1, I attempted to write to Bank 2 but have been unsuccessful. Is there a specific setting that needs to be adjusted in order to write to Bank 2?

    This topic has been closed for replies.

    3 replies

    Super User
    September 22, 2023

    > After writing to the entirety of Bank 1, I attempted to write to Bank 2

    How?

    Is your mcu genuine ST part from a reputable source? The are many counterfeited STM32F103 out there.

    JW

    madhavi UAuthor
    Explorer
    September 22, 2023

    I bought it exclusively from STMicroelectronics. The part number is STM32F103VGT6.

    Super User
    September 22, 2023

    Do you have problems programming the entire flash using STLink and CubeProgrammer?

    JW

    madhavi UAuthor
    Explorer
    September 22, 2023

    I was able to download the program using STLink, but when I tried to execute it, I received an INVSTATE hardfault error. Upon further investigation, I connected to the STLink utility and saw that the data in bank2 memory location.I could only see ffffffff data in bank2 memory after the download process. This was confirmed me that it is not allowing me to write.

    Super User
    September 22, 2023

    Check the option bytes. Make sure no write protection is on. Note, that all Bank2 (together with upper half of Bank 1) is write-protected by a single bit. See PM0068.

    JW