Skip to main content
Explorer
April 24, 2024
Question

erase and write internal flash

  • April 24, 2024
  • 2 replies
  • 1378 views

Do I need to disable global interrupts for internal flash erase and write operations?

 

 __disable_irq();
 erase();
 __enable_irq();

 __disable_irq();
 write();
 __enable_irq();

 

 

 

 

 

 

    This topic has been closed for replies.

    2 replies

    ST Employee
    May 22, 2024

    Hello @xiewenliang,

    Could you specify the product or serie are you looking to reprogram the internal flash memory on? Additionally, could you share the intended purpose and any other relevant information that might aid in offering you the best support.

    Thanks and Best Regards,

    Dorsaf

    Graduate II
    May 22, 2024

    Generally NO, but you don't want to erase active code or the vector table.

    If you read data/code from the same bank whilst the write/erase is occuring, it will STALL the MCU, basically stuff wait-states. As this can take a lot of time it can block read-time operation, like servicing a UART properly, or USB repressiveness, etc.