/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / STM32 Flash write / read

Username:     
Password:     
             

Forum

# 1   2008-06-17 14:13:51 STM32 Flash write / read

schulzj
New member
Registered: 2008-06-09
Posts: 1

STM32 Flash write / read

It is possible during writing (erasing) in one page to read in another page, or is the flash full inaccessible during write/erase operations?

Offline

 

# 2   2008-06-18 08:08:24 STM32 Flash write / read

ZHA
New member
Registered: 2007-08-30
Posts: 8

Re: STM32 Flash write / read

Hi,
During a write operation to the Flash memory, any attempt to read the Flash memory will
stall the bus. The read operation will proceed correctly once the write operation has
completed. This means that code or data fetches cannot be made while a write/erase
operation is ongoing.
For more details, please refer to STM32 Flash programming manual:
http://www.st.com/mcu/modules.php?name= … g%20Manual
Regards,

Offline

 

# 3   2008-06-18 08:28:07 STM32 Flash write / read

pascalR
New member
Registered: 2007-08-23
Posts: 3

Re: STM32 Flash write / read

Hello,
In Application Programming is possible.
Please have a look to http://www.st.com/mcu/devicedocs-STM32F103R6-110.html
for "Flash Reference Manual" and AN2757 exemple.
Best Regards

Offline

 

# 4   2012-03-14 13:58:19 STM32 Flash write / read

saurabh.bansal.90
New member
Registered: 2012-02-08
Posts: 5

Re: STM32 Flash write / read

i am new to this kind of platform.
i am enable to erase & write the data to DATA EEPROM memory in STM32F103RBT6 on Keil uVision 3 IDE. Whenever this code is run, the uC freezes & even not work after RESET. Please help me to get out of this problem.
i am using the following code...

FLASH_Unlock();
FLASH_ClearFlag(FLASH_FLAG_BSY | FLASH_FLAG_EOP | FLASH_FLAG_PGERR | FLASH_FLAG_WRPRTERR);
while(FLASHStatus != FLASH_COMPLETE)
    FLASHStatus = FLASH_ErasePage(FLASH_Start_Address);
while(FLASHStatus != FLASH_COMPLETE)
    FLASHStatus = FLASH_ProgramHalfWord(FLASH_Start_Address, 0xABAB);

FLASH_Status FLASH_ErasePage(u32 Page_Address)
{
  FLASH_Status status = FLASH_COMPLETE;

  /* Check the parameters */
  assert(IS_FLASH_ADDRESS(Page_Address));

  /* Wait for last operation to be completed */
  status = FLASH_WaitForLastOperation(EraseTimeout);
 
  if(status == FLASH_COMPLETE)
  {
    /* if the previous operation is completed, proceed to erase the page */
    FLASH->CR|= CR_PER_Set;
    FLASH->AR = Page_Address;
    FLASH->CR|= CR_STRT_Set;
   
    /* Wait for last operation to be completed */
    status = FLASH_WaitForLastOperation(EraseTimeout);

    if(status != FLASH_BUSY)
    {
      /* if the erase operation is completed, disable the PER Bit */
      FLASH->CR &= CR_PER_Reset;
    }
  }
  /* Return the Erase Status */
  return status;
}
FLASH_Status FLASH_ProgramHalfWord(u32 Address, u16 Data)
{
  FLASH_Status status = FLASH_COMPLETE;

  /* Check the parameters */
  assert(IS_FLASH_ADDRESS(Address));

  /* Wait for last operation to be completed */
  status = FLASH_WaitForLastOperation(ProgramTimeout);
 
  if(status == FLASH_COMPLETE)
  {
    /* if the previous operation is completed, proceed to program the new data */
    FLASH->CR |= CR_PG_Set;
 
    *(vu16*)Address = Data;
    /* Wait for last operation to be completed */
    status = FLASH_WaitForLastOperation(ProgramTimeout);

    if(status != FLASH_BUSY)
    {
      /* if the program operation is completed, disable the PG Bit */
      FLASH->CR &= CR_PG_Reset;
    }
  }
  /* Return the Program Status */
  return status;
}

Offline

 

Board footer