Skip to main content
Graduate
January 14, 2024
Question

Can't erase/write some Flash page in STM32G071RB

  • January 14, 2024
  • 2 replies
  • 1363 views

Hello,

I'm writing a Flash HAL driver in order to understand better how this CHIP work.

My functions at the moment work correctly but for some page I have an HardFault(During erase).

For example I can't erase/write the page 0 and others pages.

Please could you explain me why?

Thanks!

    This topic has been closed for replies.

    2 replies

    Super User
    January 14, 2024

    Probably your code is running at page 0. Erasing it causes unexpected behavior.

    dmrsimAuthor
    Graduate
    January 14, 2024

    Hello @TDK , thanks for your reply.
    There is a way to verify that my code is running at page 0?

    Super User
    January 14, 2024

    That's typically where the code starts. If you haven't changed any settings, that's where it is.

    Your linker script should have a section called FLASH. If it's set to 0x08000000, code starts there, at page 0.