Erases all FLASH pages.
- Note:
- This function can be used for all STM32F10x devices.
- Parameters:
-
- Return values:
-
FLASH | Status: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. |
Returns the FLASH User Option Bytes values.
- Note:
- This function can be used for all STM32F10x devices.
- Parameters:
-
- Return values:
-
The | FLASH User Option Bytes values:IWDG_SW(Bit0), RST_STOP(Bit1) and RST_STDBY(Bit2). |
Erases the FLASH option bytes.
- Note:
- This functions erases all option bytes except the Read protection (RDP).
-
This function can be used for all STM32F10x devices.
- Parameters:
-
- Return values:
-
FLASH | Status: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. |
Programs a half word at a specified Option Byte Data address.
- Note:
- This function can be used for all STM32F10x devices.
- Parameters:
-
Address,: | specifies the address to be programmed. This parameter can be 0x1FFFF804 or 0x1FFFF806. |
Data,: | specifies the data to be programmed. |
- Return values:
-
FLASH | Status: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. |
Configures to boot from Bank1 or Bank2.
- Note:
- This function can be used only for STM32F10x_XL density devices.
- Parameters:
-
FLASH_BOOT,: | select the FLASH Bank to boot from. This parameter can be one of the following values:
- FLASH_BOOT_Bank1: At startup, if boot pins are set in boot from user Flash position and this parameter is selected the device will boot from Bank1(Default).
- FLASH_BOOT_Bank2: At startup, if boot pins are set in boot from user Flash position and this parameter is selected the device will boot from Bank2 or Bank1, depending on the activation of the bank. The active banks are checked in the following order: Bank2, followed by Bank1. The active bank is recognized by the value programmed at the base address of the respective bank (corresponding to the initial stack pointer value in the interrupt vector table). For more information, please refer to AN2606 from www.st.com.
|
- Return values:
-
FLASH | Status: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. |
Get the total size of this CPU's FLASH.
- Note:
- This function can be used for all STM32F10x devices.
- Return values:
-
Get the last valid address in the FLASH.
- Note:
- This function can be used for all STM32F10x devices.
- Return values:
-
Programs a half word at a specified address.
- Note:
- This function can be used for all STM32F10x devices.
- Parameters:
-
Address,: | specifies the address to be programmed. |
Data,: | specifies the data to be programmed. |
- Return values:
-
FLASH | Status: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. |
Write protects the desired pages
- Note:
- This function can be used for all STM32F10x devices.
- Parameters:
-
FLASH_Pages,: | specifies the address of the pages to be write protected. This parameter can be:
- For STM32_Low-density_devices: value between FLASH_WRProt_Pages0to3 and FLASH_WRProt_Pages28to31
- For STM32_Medium-density_devices: value between FLASH_WRProt_Pages0to3 and FLASH_WRProt_Pages124to127
- For STM32_High-density_devices: value between FLASH_WRProt_Pages0to1 and FLASH_WRProt_Pages60to61 or FLASH_WRProt_Pages62to255
- For STM32_Connectivity_line_devices: value between FLASH_WRProt_Pages0to1 and FLASH_WRProt_Pages60to61 or FLASH_WRProt_Pages62to127
- For STM32_XL-density_devices: value between FLASH_WRProt_Pages0to1 and FLASH_WRProt_Pages60to61 or FLASH_WRProt_Pages62to511
- FLASH_WRProt_AllPages
|
- Return values:
-
FLASH | Status: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. |
Returns the FLASH Write Protection Option Bytes Register value.
- Note:
- This function can be used for all STM32F10x devices.
- Parameters:
-
- Return values:
-
The | FLASH Write Protection Option Bytes Register value |
Checks whether the FLASH Read Out Protection Status is set or not.
- Note:
- This function can be used for all STM32F10x devices.
- Parameters:
-
- Return values:
-
Checks whether the FLASH Prefetch Buffer status is set or not.
- Note:
- This function can be used for all STM32F10x devices.
- Parameters:
-
- Return values:
-
FLASH | Prefetch Buffer Status (SET or RESET). |
Read data from FLASH at specified address.
This function copies data from FLASH to a user provided buffer.
- Parameters:
-
dst | Pointer to address where to copy data to. |
src | Pointer to address in FLASH to read from. |
len | Number fo bytes to copy. |
- Returns:
- FLASH Status.
Erase FLASH Page at specified address.
This routine is called by Stm32FlashWritePage to erase before programming.
- Parameters:
-
page | Pointer to address of page to erase. |
- Returns:
- FLASH Status.
Program FLASH Page.
This routine writes a complete page of FLASH.
- Parameters:
-
dst | Pointer to beginning of a FLASH page. |
src | Pointer to source data to be written to page. |
- Returns:
- FLASH Status.
Program any data to FLASH.
This function writes data from source address to FLASH. It handles erasing and assembling of data automatically.
- Parameters:
-
dst | Pointer to address anywhere in FLASH. |
src | Pointer to source data. |
len | Number of bytes to be written. |
- Returns:
- FLASH Status.
Nut/OS specific handling for parameters in FLASH.
This function enables to read system specific parameters from processors FLASH. The sectors used for storage are configureable via nutconf.
- Parameters:
-
pos | Offset of parameter(s) in configured page(s). |
data | Pointer where to copy data from flash to. |
len | Number of bytes to be copied. |
- Returns:
- FLASH_Status.
Nut/OS specific handling for parameters in FLASH.
This function enables to store system specific parameters in processors FLASH. The sectors used for storage are configureable via nutconf. FLASH is only updated if content differs.
- Parameters:
-
pos | Offset of parameter(s) in configured page(s). |
data | Pointer to source data. |
len | Number of bytes to be written. |
- Returns:
- FLASH_Status.
References __IO, FLASH_BankRegT::AR, FLASH_BankRegT::CR, FLASH, FLASH_ACR_PRFTBS, FLASH_ClearFlag(), FLASH_CONF_SECTOR, FLASH_CONF_SIZE, FLASH_CR_OPTER, FLASH_CR_OPTPG, FLASH_CR_PER, FLASH_CR_PG, FLASH_CR_STRT, FLASH_EraseAllBank1Pages(), FLASH_EraseAllBank2Pages(), FLASH_Lock(), FLASH_OBR_RDPRT, FLASH_SR_EOP, FLASH_SR_PGERR, FLASH_SR_WRPRTERR, FLASH_Unlock(), max, memcmp(), memcpy(), NULL, NUTASSERT, NutHeapAlloc, NutHeapFree, OB, RESET, SET, and Stm32FlashWaitReady().