STM32F37 Standard Peripheral bibliotheek  1.0
ST Microelectronics bibliotheek documentatie voor de STM32F37 Standard Peripheral Library
 All Data Structures Files Functions Variables Enumerations Enumerator Groups
FLASH Memory Programming functions

FLASH Memory Programming functions. More...

Functions

void FLASH_Unlock (void)
 Unlocks the FLASH control register and program memory access. More...
 
void FLASH_Lock (void)
 Locks the FLASH control register access. More...
 
FLASH_Status FLASH_ErasePage (uint32_t Page_Address)
 Erases a specified page in program memory. More...
 
FLASH_Status FLASH_EraseAllPages (void)
 Erases all FLASH pages. More...
 
FLASH_Status FLASH_ProgramWord (uint32_t Address, uint32_t Data)
 Programs a word at a specified address. More...
 
FLASH_Status FLASH_ProgramHalfWord (uint32_t Address, uint16_t Data)
 Programs a half word at a specified address. More...
 

Detailed Description

FLASH Memory Programming functions.

 ===============================================================================
                ##### FLASH Memory Programming functions #####
 ===============================================================================

    [..] The FLASH Memory Programming functions, includes the following functions:
       (+) void FLASH_Unlock(void);
       (+) void FLASH_Lock(void);
       (+) FLASH_Status FLASH_ErasePage(uint32_t Page_Address);
       (+) FLASH_Status FLASH_EraseAllPages(void);
       (+) FLASH_Status FLASH_ProgramWord(uint32_t Address, uint32_t Data);
       (+) FLASH_Status FLASH_ProgramHalfWord(uint32_t Address, uint16_t Data);

    [..] Any operation of erase or program should follow these steps:
       
       (#) Call the FLASH_Unlock() function to enable the flash control register and 
           program memory access
       (#) Call the desired function to erase page or program data
       (#) Call the FLASH_Lock() to disable the flash program memory access 
      (recommended to protect the FLASH memory against possible unwanted operation)

Function Documentation

FLASH_Status FLASH_EraseAllPages ( void  )

Erases all FLASH pages.

Note
To correctly run this function, the FLASH_Unlock() function must be called before.
Call the FLASH_Lock() to disable the flash memory access (recommended to protect the FLASH memory against possible unwanted operation)
Parameters
None
Return values
FLASHStatus: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT.
FLASH_Status FLASH_ErasePage ( uint32_t  Page_Address)

Erases a specified page in program memory.

Note
To correctly run this function, the FLASH_Unlock() function must be called before.
Call the FLASH_Lock() to disable the flash memory access (recommended to protect the FLASH memory against possible unwanted operation)
Parameters
Page_Address,:The page address in program memory to be erased.
Note
A Page is erased in the Program memory only if the address to load is the start address of a page (multiple of 1024 bytes).
Return values
FLASHStatus: The returned value can be: FLASH_ERROR_PROGRAM, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT.
void FLASH_Lock ( void  )

Locks the FLASH control register access.

Parameters
None
Return values
None
FLASH_Status FLASH_ProgramHalfWord ( uint32_t  Address,
uint16_t  Data 
)

Programs a half word at a specified address.

Note
To correctly run this function, the FLASH_Unlock() function must be called before.
Call the FLASH_Lock() to disable the flash memory access (recommended to protect the FLASH memory against possible unwanted operation)
Parameters
Address,:specifies the address to be programmed.
Data,:specifies the data to be programmed.
Return values
FLASHStatus: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT.
FLASH_Status FLASH_ProgramWord ( uint32_t  Address,
uint32_t  Data 
)

Programs a word at a specified address.

Note
To correctly run this function, the FLASH_Unlock() function must be called before.
Call the FLASH_Lock() to disable the flash memory access (recommended to protect the FLASH memory against possible unwanted operation)
Parameters
Address,:specifies the address to be programmed.
Data,:specifies the data to be programmed.
Return values
FLASHStatus: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT.
void FLASH_Unlock ( void  )

Unlocks the FLASH control register and program memory access.

Parameters
None
Return values
None