|
L14-Click 1.0
STM32WLE5CC LoRaWAN Sensor Platform
|
This file provides set of firmware functions to manage Flash Interface functionalities. More...
Go to the source code of this file.
Macros | |
| #define | PAGE_INDEX(__ADDRESS__) |
| Get internal flash page index from page address. | |
Enumerations | |
| enum | { FLASH_IF_MEM_EMPTY = 0 , FLASH_IF_MEM_NOT_EMPTY = 1 } |
| Flash empty status enumeration. More... | |
Functions | |
| static FLASH_IF_StatusTypedef | FLASH_IF_INT_Write (void *pDestination, const void *pSource, uint32_t uLength) |
| This function writes a data buffer in flash (data are 64-bit aligned). | |
| static FLASH_IF_StatusTypedef | FLASH_IF_INT_Read (void *pDestination, const void *pSource, uint32_t uLength) |
| This function reads flash. | |
| static FLASH_IF_StatusTypedef | FLASH_IF_INT_Erase (void *pStart, uint32_t uLength) |
| This function does an erase of n (depends on Length) pages in user flash area. | |
| static FLASH_IF_StatusTypedef | FLASH_IF_INT_Clear_Error (void) |
| Clear error flags raised during previous operation. | |
| FLASH_IF_StatusTypedef | FLASH_IF_Init (void *pAllocRamBuffer) |
| This function initializes the internal and external flash interface. | |
| FLASH_IF_StatusTypedef | FLASH_IF_DeInit (void) |
| This function de-initializes the internal and external flash interface. | |
| FLASH_IF_StatusTypedef | FLASH_IF_Write (void *pDestination, const void *pSource, uint32_t uLength) |
| This function writes a data buffer in internal or external flash. | |
| FLASH_IF_StatusTypedef | FLASH_IF_Read (void *pDestination, const void *pSource, uint32_t uLength) |
| This function reads a amount of data from flash and copy into the output data buffer. | |
| FLASH_IF_StatusTypedef | FLASH_IF_Erase (void *pStart, uint32_t uLength) |
| This function erases a amount of internal or external flash pages depending of the length. | |
| void | HAL_FLASH_EndOfOperationCallback (uint32_t ReturnValue) |
| void | HAL_FLASH_OperationErrorCallback (uint32_t ReturnValue) |
Variables | |
| static uint8_t * | pAllocatedBuffer = NULL |
This file provides set of firmware functions to manage Flash Interface functionalities.
Copyright (c) 2026 STMicroelectronics. All rights reserved.
This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.
Definition in file flash_if.c.
| #define PAGE_INDEX | ( | __ADDRESS__ | ) |
Get internal flash page index from page address.
Definition at line 58 of file flash_if.c.
Referenced by FLASH_IF_INT_Erase(), and FLASH_IF_INT_Write().
| anonymous enum |
Flash empty status enumeration.
| Enumerator | |
|---|---|
| FLASH_IF_MEM_EMPTY | |
| FLASH_IF_MEM_NOT_EMPTY | |
Definition at line 44 of file flash_if.c.
| FLASH_IF_StatusTypedef FLASH_IF_DeInit | ( | void | ) |
This function de-initializes the internal and external flash interface.
Definition at line 129 of file flash_if.c.
References FLASH_IF_OK, and pAllocatedBuffer.
| FLASH_IF_StatusTypedef FLASH_IF_Erase | ( | void * | pStart, |
| uint32_t | uLength ) |
This function erases a amount of internal or external flash pages depending of the length.
| pStart | pointer of flash address to erase |
| uLength | number of bytes to erase |
Definition at line 175 of file flash_if.c.
References FLASH_IF_ERROR, and FLASH_IF_INT_Erase().
| FLASH_IF_StatusTypedef FLASH_IF_Init | ( | void * | pAllocRamBuffer | ) |
This function initializes the internal and external flash interface.
| pAllocRamBuffer | pointer used to store a FLASH page in RAM when partial replacement is needed |
Definition at line 115 of file flash_if.c.
References FLASH_IF_OK, and pAllocatedBuffer.
|
static |
Clear error flags raised during previous operation.
| FLASH_IF_StatusTypedef | status |
Definition at line 394 of file flash_if.c.
References FLASH_IF_LOCK_ERROR, and FLASH_IF_OK.
Referenced by FLASH_IF_INT_Erase(), and FLASH_IF_INT_Write().
|
static |
This function does an erase of n (depends on Length) pages in user flash area.
| pStart | pointer of flash address to be erased |
| uLength | number of bytes |
Definition at line 342 of file flash_if.c.
References FLASH_IF_BUSY, FLASH_IF_ERASE_ERROR, FLASH_IF_INT_Clear_Error(), FLASH_IF_LOCK_ERROR, FLASH_IF_OK, FLASH_IF_PARAM_ERROR, and PAGE_INDEX.
Referenced by FLASH_IF_Erase(), and FLASH_IF_INT_Write().
|
static |
This function reads flash.
| pDestination | Start address for target location |
| pSource | flash address to read |
| uLength | number of bytes |
Definition at line 324 of file flash_if.c.
References FLASH_IF_OK, and FLASH_IF_PARAM_ERROR.
Referenced by FLASH_IF_INT_Write(), and FLASH_IF_Read().
|
static |
This function writes a data buffer in flash (data are 64-bit aligned).
| pDestination | Start address for target location. It has to be 8 bytes aligned. |
| pSource | pointer on buffer with data to write |
| uLength | Length of data buffer in bytes. It has to be 8 bytes aligned. |
Definition at line 199 of file flash_if.c.
References FLASH_IF_ERASE_ERROR, FLASH_IF_INT_Clear_Error(), FLASH_IF_INT_Erase(), FLASH_IF_INT_Read(), FLASH_IF_LOCK_ERROR, FLASH_IF_OK, FLASH_IF_PARAM_ERROR, FLASH_IF_WRITE_ERROR, PAGE_INDEX, and pAllocatedBuffer.
Referenced by FLASH_IF_Write().
| FLASH_IF_StatusTypedef FLASH_IF_Read | ( | void * | pDestination, |
| const void * | pSource, | ||
| uint32_t | uLength ) |
This function reads a amount of data from flash and copy into the output data buffer.
| pDestination | pointer of target location to copy the flash sector |
| pSource | pointer of flash address to read |
| uLength | number of bytes to read |
Definition at line 159 of file flash_if.c.
References FLASH_IF_ERROR, and FLASH_IF_INT_Read().
Referenced by OnRestoreContextRequest().
| FLASH_IF_StatusTypedef FLASH_IF_Write | ( | void * | pDestination, |
| const void * | pSource, | ||
| uint32_t | uLength ) |
This function writes a data buffer in internal or external flash.
| pDestination | pointer of flash address to write. It has to be 8 bytes aligned. |
| pSource | pointer on buffer with data to write |
| uLength | length of data buffer in bytes. It has to be 8 bytes aligned. |
Definition at line 143 of file flash_if.c.
References FLASH_IF_ERROR, and FLASH_IF_INT_Write().
Referenced by OnStoreContextRequest().
| void HAL_FLASH_EndOfOperationCallback | ( | uint32_t | ReturnValue | ) |
Definition at line 425 of file flash_if.c.
| void HAL_FLASH_OperationErrorCallback | ( | uint32_t | ReturnValue | ) |
Definition at line 442 of file flash_if.c.
|
static |
Definition at line 65 of file flash_if.c.
Referenced by FLASH_IF_DeInit(), FLASH_IF_Init(), and FLASH_IF_INT_Write().