cancel
Showing results for 
Search instead for 
Did you mean: 

How to Main Flash memory programming

peng jun
Associate II
Posted on July 15, 2018 at 05:31

Hi?From the  <PM0075  Programming manual>  ? P15?Mass Erase  as below code is successful ?Now?I  want to Main Flash memory programming  ,  but  I don't  how to do it  .  Anybody Know?.....

Thanks!

/******************************************************/

 STM32_flashUnlock();

FLASH_Status flashEraseAllOptionBytes_STM32(void)

{

   FLASH_Status status = FLASH_COMPLETE;

   uint32_t flash_CR,flash_SR;

  flash_CR = readMem((uint32_t)&(FLASH->CR));

  flash_CR |= CR_MER_Set;

  writeMem((uint32_t)&(FLASH->CR), flash_CR);

  flash_CR |= CR_STRT_Set;

  writeMem((uint32_t)&(FLASH->CR), flash_CR);

  status = FLASH_WaitForLastOperation(((uint32_t)0x000B0000));

return 0x09;

}

**********************************************************************/

#flash?-memory-programm #swd
1 REPLY 1

What STM32?

Trying reviewing the examples under HAL/Cube trees

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..