Programming operation functions.
More...
Programming operation functions.
===============================================================================
##### Programming operation functions #####
===============================================================================
[..]
This subsection provides a set of functions allowing to manage the FLASH
program operations.
◆ HAL_FLASH_EndOfOperationCallback()
| __weak void HAL_FLASH_EndOfOperationCallback |
( |
uint32_t |
ReturnValue | ) |
|
FLASH end of operation interrupt callback.
- Parameters
-
| ReturnValue | The value saved in this parameter depends on the ongoing procedure Mass Erase: Bank number which has been requested to erase Page Erase: Page which has been erased (if 0xFFFFFFFF, it means that all the selected pages have been erased) Program: Address which was selected for data program |
- Return values
-
Definition at line 456 of file stm32l4xx_hal_flash.c.
◆ HAL_FLASH_IRQHandler()
| void HAL_FLASH_IRQHandler |
( |
void |
| ) |
|
Handle FLASH interrupt request.
- Return values
-
Definition at line 313 of file stm32l4xx_hal_flash.c.
320 CLEAR_BIT(FLASH->CR, (FLASH_CR_PG | FLASH_CR_MER1 | FLASH_CR_PER | FLASH_CR_PNB));
321 #if defined (STM32L471xx) || defined (STM32L475xx) || defined (STM32L476xx) || defined (STM32L485xx) || defined (STM32L486xx) || \ 322 defined (STM32L496xx) || defined (STM32L4A6xx) || \ 323 defined (STM32L4R5xx) || defined (STM32L4R7xx) || defined (STM32L4R9xx) || defined (STM32L4S5xx) || defined (STM32L4S7xx) || defined (STM32L4S9xx) 334 error = (FLASH->SR & FLASH_FLAG_SR_ERRORS);
335 error |= (FLASH->ECCR & FLASH_FLAG_ECCC);
343 __HAL_FLASH_CLEAR_FLAG(error);
373 if(__HAL_FLASH_GET_FLAG(FLASH_FLAG_EOP) != 0U)
376 __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP);
440 __HAL_FLASH_DISABLE_IT(FLASH_IT_EOP | FLASH_IT_OPERR);
void HAL_FLASH_OperationErrorCallback(uint32_t ReturnValue)
FLASH operation error interrupt callback.
__IO FLASH_ProcedureTypeDef ProcedureOnGoing
void HAL_FLASH_EndOfOperationCallback(uint32_t ReturnValue)
FLASH end of operation interrupt callback.
__IO uint32_t NbPagesToErase
void FLASH_PageErase(uint32_t Page, uint32_t Banks)
Erase the specified FLASH memory page.
FLASH_ProcedureTypeDef
FLASH Procedure structure definition.
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)
void FLASH_FlushCaches(void)
Flush the instruction and data caches.
FLASH_ProcessTypeDef pFlash
Variable used for Program/Erase sectors under interruption.
◆ HAL_FLASH_OperationErrorCallback()
| __weak void HAL_FLASH_OperationErrorCallback |
( |
uint32_t |
ReturnValue | ) |
|
FLASH operation error interrupt callback.
- Parameters
-
| ReturnValue | The value saved in this parameter depends on the ongoing procedure Mass Erase: Bank number which has been requested to erase Page Erase: Page number which returned an error Program: Address which was selected for data program |
- Return values
-
Definition at line 474 of file stm32l4xx_hal_flash.c.
◆ HAL_FLASH_Program()
| HAL_StatusTypeDef HAL_FLASH_Program |
( |
uint32_t |
TypeProgram, |
|
|
uint32_t |
Address, |
|
|
uint64_t |
Data |
|
) |
| |
Program double word or fast program of a row at a specified address.
- Parameters
-
| TypeProgram | Indicate the way to program at a specified address. This parameter can be a value of FLASH Program Type |
| Address | specifies the address to be programmed. |
| Data | specifies the data to be programmed This parameter is the data for the double word program and the address where are stored the data for the row fast program |
- Return values
-
| HAL_StatusTypeDef | HAL Status |
Definition at line 171 of file stm32l4xx_hal_flash.c.
173 HAL_StatusTypeDef status;
174 uint32_t prog_bit = 0;
190 if(READ_BIT(FLASH->ACR, FLASH_ACR_DCEN) != 0U)
193 __HAL_FLASH_DATA_CACHE_DISABLE();
201 if(TypeProgram == FLASH_TYPEPROGRAM_DOUBLEWORD)
205 prog_bit = FLASH_CR_PG;
207 else if((TypeProgram == FLASH_TYPEPROGRAM_FAST) || (TypeProgram == FLASH_TYPEPROGRAM_FAST_AND_LAST))
213 if(TypeProgram == FLASH_TYPEPROGRAM_FAST_AND_LAST)
215 prog_bit = FLASH_CR_FSTPG;
static void FLASH_Program_Fast(uint32_t Address, uint32_t DataAddress)
Fast program a row double-word (64-bit) at a specified address.
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)
void FLASH_FlushCaches(void)
Flush the instruction and data caches.
HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout)
Wait for a FLASH operation to complete.
FLASH_ProcessTypeDef pFlash
Variable used for Program/Erase sectors under interruption.
__IO FLASH_CacheTypeDef CacheToReactivate
static void FLASH_Program_DoubleWord(uint32_t Address, uint64_t Data)
Program double-word (64-bit) at a specified address.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))
◆ HAL_FLASH_Program_IT()
| HAL_StatusTypeDef HAL_FLASH_Program_IT |
( |
uint32_t |
TypeProgram, |
|
|
uint32_t |
Address, |
|
|
uint64_t |
Data |
|
) |
| |
Program double word or fast program of a row at a specified address with interrupt enabled.
- Parameters
-
| TypeProgram | Indicate the way to program at a specified address. This parameter can be a value of FLASH Program Type |
| Address | specifies the address to be programmed. |
| Data | specifies the data to be programmed This parameter is the data for the double word program and the address where are stored the data for the row fast program |
- Return values
-
Definition at line 253 of file stm32l4xx_hal_flash.c.
255 HAL_StatusTypeDef status =
HAL_OK;
266 if(READ_BIT(FLASH->ACR, FLASH_ACR_DCEN) != 0U)
269 __HAL_FLASH_DATA_CACHE_DISABLE();
278 if(TypeProgram == FLASH_TYPEPROGRAM_FAST_AND_LAST)
289 __HAL_FLASH_ENABLE_IT(FLASH_IT_EOP | FLASH_IT_OPERR);
291 if(TypeProgram == FLASH_TYPEPROGRAM_DOUBLEWORD)
296 else if((TypeProgram == FLASH_TYPEPROGRAM_FAST) || (TypeProgram == FLASH_TYPEPROGRAM_FAST_AND_LAST))
__IO FLASH_ProcedureTypeDef ProcedureOnGoing
static void FLASH_Program_Fast(uint32_t Address, uint32_t DataAddress)
Fast program a row double-word (64-bit) at a specified address.
FLASH_ProcessTypeDef pFlash
Variable used for Program/Erase sectors under interruption.
__IO FLASH_CacheTypeDef CacheToReactivate
static void FLASH_Program_DoubleWord(uint32_t Address, uint64_t Data)
Program double-word (64-bit) at a specified address.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))