Skip to main content
Visitor II
May 11, 2020
Solved

How to program FLASH using Standard Peripherals Library?

  • May 11, 2020
  • 1 reply
  • 1580 views

Hi everyone.

At this moment I'm working in an integration on an old project which used Standard Peripherals Library instead of HAL libraries.

Here, when I try to write in FLASH memory I find the next line:

assert_param(IS_FLASH_ADDRESS(Address));

Which basically is checking if the given address is inside the range [0x08000000, 0x080FFFFF). In my particular case, I'm trying to write inside the range [0x00000000, 0x0003FFFF], that is also flash memory for user when BOOT pins are set in a certain way.

Is possible to write in this positions using this libraries?

I'm working with a STM32F105VC, and the line I talked you about is inside the function FLASH_ProgramWord(...) of this lib.

Thank you. My best regards.

Areify.

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

    The flash is still accessible at 0x08000000 even when mapped to 0x0. Just write to it in it's original location.

    That or redefine IS_FLASH_ADDRESS, but that seems like a bad idea.

    1 reply

    TDKAnswer
    Super User
    May 11, 2020

    The flash is still accessible at 0x08000000 even when mapped to 0x0. Just write to it in it's original location.

    That or redefine IS_FLASH_ADDRESS, but that seems like a bad idea.

    areifyAuthor
    Visitor II
    May 11, 2020

    Redefinition is a bad idea because is an existing project (if not, I would use HAL) and other parts of code are working with this library.

    Do you mean that if I write at 0x08000000 it will apply to 0x00000000? Are you sure that BOOT pins configuration work as a mapping activation/deactivation?

    Super User
    May 11, 2020
    Yes and yes, per the “Boot configuration�? section of the RM.