mbed library sources
Dependents: frdm_kl05z_gpio_test
Fork of mbed-src by
targets/cmsis/TARGET_STM/TARGET_DISCO_F407VG/stm32f4xx_hal_nor.c@242:7074e42da0b2, 2014-06-27 (annotated)
- Committer:
- mbed_official
- Date:
- Fri Jun 27 07:30:09 2014 +0100
- Revision:
- 242:7074e42da0b2
- Parent:
- 133:d4dda5c437f0
Synchronized with git revision 124ef5e3add9e74a3221347a3fbeea7c8b3cf353
Full URL: https://github.com/mbedmicro/mbed/commit/124ef5e3add9e74a3221347a3fbeea7c8b3cf353/
[DISCO_F407VG] HAL update.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 133:d4dda5c437f0 | 1 | /** |
mbed_official | 133:d4dda5c437f0 | 2 | ****************************************************************************** |
mbed_official | 133:d4dda5c437f0 | 3 | * @file stm32f4xx_hal_nor.c |
mbed_official | 133:d4dda5c437f0 | 4 | * @author MCD Application Team |
mbed_official | 242:7074e42da0b2 | 5 | * @version V1.1.0RC2 |
mbed_official | 242:7074e42da0b2 | 6 | * @date 14-May-2014 |
mbed_official | 133:d4dda5c437f0 | 7 | * @brief NOR HAL module driver. |
mbed_official | 133:d4dda5c437f0 | 8 | * This file provides a generic firmware to drive NOR memories mounted |
mbed_official | 133:d4dda5c437f0 | 9 | * as external device. |
mbed_official | 133:d4dda5c437f0 | 10 | * |
mbed_official | 133:d4dda5c437f0 | 11 | @verbatim |
mbed_official | 133:d4dda5c437f0 | 12 | ============================================================================== |
mbed_official | 133:d4dda5c437f0 | 13 | ##### How to use this driver ##### |
mbed_official | 133:d4dda5c437f0 | 14 | ============================================================================== |
mbed_official | 133:d4dda5c437f0 | 15 | [..] |
mbed_official | 133:d4dda5c437f0 | 16 | This driver is a generic layered driver which contains a set of APIs used to |
mbed_official | 133:d4dda5c437f0 | 17 | control NOR flash memories. It uses the FMC/FSMC layer functions to interface |
mbed_official | 133:d4dda5c437f0 | 18 | with NOR devices. This driver is used as follows: |
mbed_official | 133:d4dda5c437f0 | 19 | |
mbed_official | 133:d4dda5c437f0 | 20 | (+) NOR flash memory configuration sequence using the function HAL_NOR_Init() |
mbed_official | 133:d4dda5c437f0 | 21 | with control and timing parameters for both normal and extended mode. |
mbed_official | 133:d4dda5c437f0 | 22 | |
mbed_official | 133:d4dda5c437f0 | 23 | (+) Read NOR flash memory manufacturer code and device IDs using the function |
mbed_official | 133:d4dda5c437f0 | 24 | HAL_NOR_Read_ID(). The read information is stored in the NOR_ID_TypeDef |
mbed_official | 133:d4dda5c437f0 | 25 | structure declared by the function caller. |
mbed_official | 133:d4dda5c437f0 | 26 | |
mbed_official | 133:d4dda5c437f0 | 27 | (+) Access NOR flash memory by read/write data unit operations using the functions |
mbed_official | 133:d4dda5c437f0 | 28 | HAL_NOR_Read(), HAL_NOR_Program(). |
mbed_official | 133:d4dda5c437f0 | 29 | |
mbed_official | 133:d4dda5c437f0 | 30 | (+) Perform NOR flash erase block/chip operations using the functions |
mbed_official | 133:d4dda5c437f0 | 31 | HAL_NOR_Erase_Block() and HAL_NOR_Erase_Chip(). |
mbed_official | 133:d4dda5c437f0 | 32 | |
mbed_official | 133:d4dda5c437f0 | 33 | (+) Read the NOR flash CFI (common flash interface) IDs using the function |
mbed_official | 133:d4dda5c437f0 | 34 | HAL_NOR_Read_CFI(). The read information is stored in the NOR_CFI_TypeDef |
mbed_official | 133:d4dda5c437f0 | 35 | structure declared by the function caller. |
mbed_official | 133:d4dda5c437f0 | 36 | |
mbed_official | 133:d4dda5c437f0 | 37 | (+) You can also control the NOR device by calling the control APIs HAL_NOR_WriteOperation_Enable()/ |
mbed_official | 133:d4dda5c437f0 | 38 | HAL_NOR_WriteOperation_Disable() to respectively enable/disable the NOR write operation |
mbed_official | 133:d4dda5c437f0 | 39 | |
mbed_official | 133:d4dda5c437f0 | 40 | (+) You can monitor the NOR device HAL state by calling the function |
mbed_official | 133:d4dda5c437f0 | 41 | HAL_NOR_GetState() |
mbed_official | 133:d4dda5c437f0 | 42 | [..] |
mbed_official | 133:d4dda5c437f0 | 43 | (@) This driver is a set of generic APIs which handle standard NOR flash operations. |
mbed_official | 133:d4dda5c437f0 | 44 | If a NOR flash device contains different operations and/or implementations, |
mbed_official | 133:d4dda5c437f0 | 45 | it should be implemented separately. |
mbed_official | 133:d4dda5c437f0 | 46 | |
mbed_official | 133:d4dda5c437f0 | 47 | *** NOR HAL driver macros list *** |
mbed_official | 133:d4dda5c437f0 | 48 | ============================================= |
mbed_official | 133:d4dda5c437f0 | 49 | [..] |
mbed_official | 133:d4dda5c437f0 | 50 | Below the list of most used macros in NOR HAL driver. |
mbed_official | 133:d4dda5c437f0 | 51 | |
mbed_official | 133:d4dda5c437f0 | 52 | (+) __NOR_WRITE : NOR memory write data to specified address |
mbed_official | 133:d4dda5c437f0 | 53 | |
mbed_official | 133:d4dda5c437f0 | 54 | @endverbatim |
mbed_official | 133:d4dda5c437f0 | 55 | ****************************************************************************** |
mbed_official | 133:d4dda5c437f0 | 56 | * @attention |
mbed_official | 133:d4dda5c437f0 | 57 | * |
mbed_official | 133:d4dda5c437f0 | 58 | * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> |
mbed_official | 133:d4dda5c437f0 | 59 | * |
mbed_official | 133:d4dda5c437f0 | 60 | * Redistribution and use in source and binary forms, with or without modification, |
mbed_official | 133:d4dda5c437f0 | 61 | * are permitted provided that the following conditions are met: |
mbed_official | 133:d4dda5c437f0 | 62 | * 1. Redistributions of source code must retain the above copyright notice, |
mbed_official | 133:d4dda5c437f0 | 63 | * this list of conditions and the following disclaimer. |
mbed_official | 133:d4dda5c437f0 | 64 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
mbed_official | 133:d4dda5c437f0 | 65 | * this list of conditions and the following disclaimer in the documentation |
mbed_official | 133:d4dda5c437f0 | 66 | * and/or other materials provided with the distribution. |
mbed_official | 133:d4dda5c437f0 | 67 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
mbed_official | 133:d4dda5c437f0 | 68 | * may be used to endorse or promote products derived from this software |
mbed_official | 133:d4dda5c437f0 | 69 | * without specific prior written permission. |
mbed_official | 133:d4dda5c437f0 | 70 | * |
mbed_official | 133:d4dda5c437f0 | 71 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
mbed_official | 133:d4dda5c437f0 | 72 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
mbed_official | 133:d4dda5c437f0 | 73 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
mbed_official | 133:d4dda5c437f0 | 74 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
mbed_official | 133:d4dda5c437f0 | 75 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
mbed_official | 133:d4dda5c437f0 | 76 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
mbed_official | 133:d4dda5c437f0 | 77 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
mbed_official | 133:d4dda5c437f0 | 78 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
mbed_official | 133:d4dda5c437f0 | 79 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
mbed_official | 133:d4dda5c437f0 | 80 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
mbed_official | 133:d4dda5c437f0 | 81 | * |
mbed_official | 133:d4dda5c437f0 | 82 | ****************************************************************************** |
mbed_official | 133:d4dda5c437f0 | 83 | */ |
mbed_official | 133:d4dda5c437f0 | 84 | |
mbed_official | 133:d4dda5c437f0 | 85 | /* Includes ------------------------------------------------------------------*/ |
mbed_official | 133:d4dda5c437f0 | 86 | #include "stm32f4xx_hal.h" |
mbed_official | 133:d4dda5c437f0 | 87 | |
mbed_official | 133:d4dda5c437f0 | 88 | /** @addtogroup STM32F4xx_HAL_Driver |
mbed_official | 133:d4dda5c437f0 | 89 | * @{ |
mbed_official | 133:d4dda5c437f0 | 90 | */ |
mbed_official | 133:d4dda5c437f0 | 91 | |
mbed_official | 133:d4dda5c437f0 | 92 | /** @defgroup NOR |
mbed_official | 133:d4dda5c437f0 | 93 | * @brief NOR driver modules |
mbed_official | 133:d4dda5c437f0 | 94 | * @{ |
mbed_official | 133:d4dda5c437f0 | 95 | */ |
mbed_official | 133:d4dda5c437f0 | 96 | #ifdef HAL_NOR_MODULE_ENABLED |
mbed_official | 133:d4dda5c437f0 | 97 | #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) |
mbed_official | 133:d4dda5c437f0 | 98 | |
mbed_official | 133:d4dda5c437f0 | 99 | /* Private typedef -----------------------------------------------------------*/ |
mbed_official | 133:d4dda5c437f0 | 100 | /* Private define ------------------------------------------------------------*/ |
mbed_official | 133:d4dda5c437f0 | 101 | /* Private macro -------------------------------------------------------------*/ |
mbed_official | 133:d4dda5c437f0 | 102 | /* Private variables ---------------------------------------------------------*/ |
mbed_official | 133:d4dda5c437f0 | 103 | /* Private function prototypes -----------------------------------------------*/ |
mbed_official | 133:d4dda5c437f0 | 104 | |
mbed_official | 133:d4dda5c437f0 | 105 | |
mbed_official | 133:d4dda5c437f0 | 106 | /* Private functions ---------------------------------------------------------*/ |
mbed_official | 133:d4dda5c437f0 | 107 | |
mbed_official | 133:d4dda5c437f0 | 108 | /** @defgroup NOR_Private_Functions |
mbed_official | 133:d4dda5c437f0 | 109 | * @{ |
mbed_official | 133:d4dda5c437f0 | 110 | */ |
mbed_official | 133:d4dda5c437f0 | 111 | |
mbed_official | 133:d4dda5c437f0 | 112 | /** @defgroup NOR_Group1 Initialization and de-initialization functions |
mbed_official | 133:d4dda5c437f0 | 113 | * @brief Initialization and Configuration functions |
mbed_official | 133:d4dda5c437f0 | 114 | * |
mbed_official | 133:d4dda5c437f0 | 115 | @verbatim |
mbed_official | 133:d4dda5c437f0 | 116 | ============================================================================== |
mbed_official | 133:d4dda5c437f0 | 117 | ##### NOR Initialization and de_initialization functions ##### |
mbed_official | 133:d4dda5c437f0 | 118 | ============================================================================== |
mbed_official | 133:d4dda5c437f0 | 119 | [..] |
mbed_official | 133:d4dda5c437f0 | 120 | This section provides functions allowing to initialize/de-initialize |
mbed_official | 133:d4dda5c437f0 | 121 | the NOR memory |
mbed_official | 133:d4dda5c437f0 | 122 | |
mbed_official | 133:d4dda5c437f0 | 123 | @endverbatim |
mbed_official | 133:d4dda5c437f0 | 124 | * @{ |
mbed_official | 133:d4dda5c437f0 | 125 | */ |
mbed_official | 133:d4dda5c437f0 | 126 | |
mbed_official | 133:d4dda5c437f0 | 127 | /** |
mbed_official | 133:d4dda5c437f0 | 128 | * @brief Perform the NOR memory Initialization sequence |
mbed_official | 242:7074e42da0b2 | 129 | * @param hnor: pointer to a NOR_HandleTypeDef structure that contains |
mbed_official | 242:7074e42da0b2 | 130 | * the configuration information for NOR module. |
mbed_official | 133:d4dda5c437f0 | 131 | * @param Timing: pointer to NOR control timing structure |
mbed_official | 133:d4dda5c437f0 | 132 | * @param ExtTiming: pointer to NOR extended mode timing structure |
mbed_official | 133:d4dda5c437f0 | 133 | * @retval HAL status |
mbed_official | 133:d4dda5c437f0 | 134 | */ |
mbed_official | 133:d4dda5c437f0 | 135 | HAL_StatusTypeDef HAL_NOR_Init(NOR_HandleTypeDef *hnor, FMC_NORSRAM_TimingTypeDef *Timing, FMC_NORSRAM_TimingTypeDef *ExtTiming) |
mbed_official | 133:d4dda5c437f0 | 136 | { |
mbed_official | 133:d4dda5c437f0 | 137 | /* Check the NOR handle parameter */ |
mbed_official | 133:d4dda5c437f0 | 138 | if(hnor == NULL) |
mbed_official | 133:d4dda5c437f0 | 139 | { |
mbed_official | 133:d4dda5c437f0 | 140 | return HAL_ERROR; |
mbed_official | 133:d4dda5c437f0 | 141 | } |
mbed_official | 133:d4dda5c437f0 | 142 | |
mbed_official | 133:d4dda5c437f0 | 143 | if(hnor->State == HAL_NOR_STATE_RESET) |
mbed_official | 133:d4dda5c437f0 | 144 | { |
mbed_official | 133:d4dda5c437f0 | 145 | /* Initialize the low level hardware (MSP) */ |
mbed_official | 133:d4dda5c437f0 | 146 | HAL_NOR_MspInit(hnor); |
mbed_official | 133:d4dda5c437f0 | 147 | } |
mbed_official | 133:d4dda5c437f0 | 148 | |
mbed_official | 133:d4dda5c437f0 | 149 | /* Initialize NOR control Interface */ |
mbed_official | 133:d4dda5c437f0 | 150 | FMC_NORSRAM_Init(hnor->Instance, &(hnor->Init)); |
mbed_official | 133:d4dda5c437f0 | 151 | |
mbed_official | 133:d4dda5c437f0 | 152 | /* Initialize NOR timing Interface */ |
mbed_official | 133:d4dda5c437f0 | 153 | FMC_NORSRAM_Timing_Init(hnor->Instance, Timing, hnor->Init.NSBank); |
mbed_official | 133:d4dda5c437f0 | 154 | |
mbed_official | 133:d4dda5c437f0 | 155 | /* Initialize NOR extended mode timing Interface */ |
mbed_official | 133:d4dda5c437f0 | 156 | FMC_NORSRAM_Extended_Timing_Init(hnor->Extended, ExtTiming, hnor->Init.NSBank, hnor->Init.ExtendedMode); |
mbed_official | 133:d4dda5c437f0 | 157 | |
mbed_official | 133:d4dda5c437f0 | 158 | /* Enable the NORSRAM device */ |
mbed_official | 133:d4dda5c437f0 | 159 | __FMC_NORSRAM_ENABLE(hnor->Instance, hnor->Init.NSBank); |
mbed_official | 133:d4dda5c437f0 | 160 | |
mbed_official | 133:d4dda5c437f0 | 161 | /* Check the NOR controller state */ |
mbed_official | 133:d4dda5c437f0 | 162 | hnor->State = HAL_NOR_STATE_READY; |
mbed_official | 133:d4dda5c437f0 | 163 | |
mbed_official | 133:d4dda5c437f0 | 164 | return HAL_OK; |
mbed_official | 133:d4dda5c437f0 | 165 | } |
mbed_official | 133:d4dda5c437f0 | 166 | |
mbed_official | 133:d4dda5c437f0 | 167 | /** |
mbed_official | 133:d4dda5c437f0 | 168 | * @brief Perform NOR memory De-Initialization sequence |
mbed_official | 242:7074e42da0b2 | 169 | * @param hnor: pointer to a NOR_HandleTypeDef structure that contains |
mbed_official | 242:7074e42da0b2 | 170 | * the configuration information for NOR module. |
mbed_official | 133:d4dda5c437f0 | 171 | * @retval HAL status |
mbed_official | 133:d4dda5c437f0 | 172 | */ |
mbed_official | 133:d4dda5c437f0 | 173 | HAL_StatusTypeDef HAL_NOR_DeInit(NOR_HandleTypeDef *hnor) |
mbed_official | 133:d4dda5c437f0 | 174 | { |
mbed_official | 133:d4dda5c437f0 | 175 | /* De-Initialize the low level hardware (MSP) */ |
mbed_official | 133:d4dda5c437f0 | 176 | HAL_NOR_MspDeInit(hnor); |
mbed_official | 133:d4dda5c437f0 | 177 | |
mbed_official | 133:d4dda5c437f0 | 178 | /* Configure the NOR registers with their reset values */ |
mbed_official | 133:d4dda5c437f0 | 179 | FMC_NORSRAM_DeInit(hnor->Instance, hnor->Extended, hnor->Init.NSBank); |
mbed_official | 133:d4dda5c437f0 | 180 | |
mbed_official | 133:d4dda5c437f0 | 181 | /* Update the NOR controller state */ |
mbed_official | 133:d4dda5c437f0 | 182 | hnor->State = HAL_NOR_STATE_RESET; |
mbed_official | 133:d4dda5c437f0 | 183 | |
mbed_official | 133:d4dda5c437f0 | 184 | /* Release Lock */ |
mbed_official | 133:d4dda5c437f0 | 185 | __HAL_UNLOCK(hnor); |
mbed_official | 133:d4dda5c437f0 | 186 | |
mbed_official | 133:d4dda5c437f0 | 187 | return HAL_OK; |
mbed_official | 133:d4dda5c437f0 | 188 | } |
mbed_official | 133:d4dda5c437f0 | 189 | |
mbed_official | 133:d4dda5c437f0 | 190 | /** |
mbed_official | 133:d4dda5c437f0 | 191 | * @brief NOR MSP Init |
mbed_official | 242:7074e42da0b2 | 192 | * @param hnor: pointer to a NOR_HandleTypeDef structure that contains |
mbed_official | 242:7074e42da0b2 | 193 | * the configuration information for NOR module. |
mbed_official | 133:d4dda5c437f0 | 194 | * @retval None |
mbed_official | 133:d4dda5c437f0 | 195 | */ |
mbed_official | 133:d4dda5c437f0 | 196 | __weak void HAL_NOR_MspInit(NOR_HandleTypeDef *hnor) |
mbed_official | 133:d4dda5c437f0 | 197 | { |
mbed_official | 133:d4dda5c437f0 | 198 | /* NOTE : This function Should not be modified, when the callback is needed, |
mbed_official | 133:d4dda5c437f0 | 199 | the HAL_NOR_MspInit could be implemented in the user file |
mbed_official | 133:d4dda5c437f0 | 200 | */ |
mbed_official | 133:d4dda5c437f0 | 201 | } |
mbed_official | 133:d4dda5c437f0 | 202 | |
mbed_official | 133:d4dda5c437f0 | 203 | /** |
mbed_official | 133:d4dda5c437f0 | 204 | * @brief NOR MSP DeInit |
mbed_official | 242:7074e42da0b2 | 205 | * @param hnor: pointer to a NOR_HandleTypeDef structure that contains |
mbed_official | 242:7074e42da0b2 | 206 | * the configuration information for NOR module. |
mbed_official | 133:d4dda5c437f0 | 207 | * @retval None |
mbed_official | 133:d4dda5c437f0 | 208 | */ |
mbed_official | 133:d4dda5c437f0 | 209 | __weak void HAL_NOR_MspDeInit(NOR_HandleTypeDef *hnor) |
mbed_official | 133:d4dda5c437f0 | 210 | { |
mbed_official | 133:d4dda5c437f0 | 211 | /* NOTE : This function Should not be modified, when the callback is needed, |
mbed_official | 133:d4dda5c437f0 | 212 | the HAL_NOR_MspDeInit could be implemented in the user file |
mbed_official | 133:d4dda5c437f0 | 213 | */ |
mbed_official | 133:d4dda5c437f0 | 214 | } |
mbed_official | 133:d4dda5c437f0 | 215 | |
mbed_official | 133:d4dda5c437f0 | 216 | /** |
mbed_official | 133:d4dda5c437f0 | 217 | * @brief NOR BSP Wait fro Ready/Busy signal |
mbed_official | 242:7074e42da0b2 | 218 | * @param hnor: pointer to a NOR_HandleTypeDef structure that contains |
mbed_official | 242:7074e42da0b2 | 219 | * the configuration information for NOR module. |
mbed_official | 133:d4dda5c437f0 | 220 | * @param Timeout: Maximum timeout value |
mbed_official | 133:d4dda5c437f0 | 221 | * @retval None |
mbed_official | 133:d4dda5c437f0 | 222 | */ |
mbed_official | 133:d4dda5c437f0 | 223 | __weak void HAL_NOR_MspWait(NOR_HandleTypeDef *hnor, uint32_t Timeout) |
mbed_official | 133:d4dda5c437f0 | 224 | { |
mbed_official | 133:d4dda5c437f0 | 225 | /* NOTE : This function Should not be modified, when the callback is needed, |
mbed_official | 133:d4dda5c437f0 | 226 | the HAL_NOR_BspWait could be implemented in the user file |
mbed_official | 133:d4dda5c437f0 | 227 | */ |
mbed_official | 133:d4dda5c437f0 | 228 | } |
mbed_official | 133:d4dda5c437f0 | 229 | |
mbed_official | 133:d4dda5c437f0 | 230 | /** |
mbed_official | 133:d4dda5c437f0 | 231 | * @} |
mbed_official | 133:d4dda5c437f0 | 232 | */ |
mbed_official | 133:d4dda5c437f0 | 233 | |
mbed_official | 133:d4dda5c437f0 | 234 | /** @defgroup NOR_Group2 Input and Output functions |
mbed_official | 133:d4dda5c437f0 | 235 | * @brief Input Output and memory control functions |
mbed_official | 133:d4dda5c437f0 | 236 | * |
mbed_official | 133:d4dda5c437f0 | 237 | @verbatim |
mbed_official | 133:d4dda5c437f0 | 238 | ============================================================================== |
mbed_official | 133:d4dda5c437f0 | 239 | ##### NOR Input and Output functions ##### |
mbed_official | 133:d4dda5c437f0 | 240 | ============================================================================== |
mbed_official | 133:d4dda5c437f0 | 241 | [..] |
mbed_official | 133:d4dda5c437f0 | 242 | This section provides functions allowing to use and control the NOR memory |
mbed_official | 133:d4dda5c437f0 | 243 | |
mbed_official | 133:d4dda5c437f0 | 244 | @endverbatim |
mbed_official | 133:d4dda5c437f0 | 245 | * @{ |
mbed_official | 133:d4dda5c437f0 | 246 | */ |
mbed_official | 133:d4dda5c437f0 | 247 | |
mbed_official | 133:d4dda5c437f0 | 248 | /** |
mbed_official | 133:d4dda5c437f0 | 249 | * @brief Read NOR flash IDs |
mbed_official | 242:7074e42da0b2 | 250 | * @param hnor: pointer to a NOR_HandleTypeDef structure that contains |
mbed_official | 242:7074e42da0b2 | 251 | * the configuration information for NOR module. |
mbed_official | 133:d4dda5c437f0 | 252 | * @param pNOR_ID : pointer to NOR ID structure |
mbed_official | 133:d4dda5c437f0 | 253 | * @retval HAL status |
mbed_official | 133:d4dda5c437f0 | 254 | */ |
mbed_official | 133:d4dda5c437f0 | 255 | HAL_StatusTypeDef HAL_NOR_Read_ID(NOR_HandleTypeDef *hnor, NOR_IDTypeDef *pNOR_ID) |
mbed_official | 133:d4dda5c437f0 | 256 | { |
mbed_official | 133:d4dda5c437f0 | 257 | /* Process Locked */ |
mbed_official | 133:d4dda5c437f0 | 258 | __HAL_LOCK(hnor); |
mbed_official | 133:d4dda5c437f0 | 259 | |
mbed_official | 133:d4dda5c437f0 | 260 | /* Check the NOR controller state */ |
mbed_official | 133:d4dda5c437f0 | 261 | if(hnor->State == HAL_NOR_STATE_BUSY) |
mbed_official | 133:d4dda5c437f0 | 262 | { |
mbed_official | 133:d4dda5c437f0 | 263 | return HAL_BUSY; |
mbed_official | 133:d4dda5c437f0 | 264 | } |
mbed_official | 133:d4dda5c437f0 | 265 | |
mbed_official | 133:d4dda5c437f0 | 266 | /* Update the NOR controller state */ |
mbed_official | 133:d4dda5c437f0 | 267 | hnor->State = HAL_NOR_STATE_BUSY; |
mbed_official | 133:d4dda5c437f0 | 268 | |
mbed_official | 133:d4dda5c437f0 | 269 | /* Send read ID command */ |
mbed_official | 133:d4dda5c437f0 | 270 | __NOR_WRITE(__NOR_ADDR_SHIFT(0x0555), 0x00AA); |
mbed_official | 133:d4dda5c437f0 | 271 | __NOR_WRITE(__NOR_ADDR_SHIFT(0x02AA), 0x0055); |
mbed_official | 133:d4dda5c437f0 | 272 | __NOR_WRITE(__NOR_ADDR_SHIFT(0x0555), 0x0090); |
mbed_official | 133:d4dda5c437f0 | 273 | |
mbed_official | 133:d4dda5c437f0 | 274 | /* Read the NOR IDs */ |
mbed_official | 133:d4dda5c437f0 | 275 | pNOR_ID->Manufacturer_Code = *(__IO uint16_t *) __NOR_ADDR_SHIFT(MC_ADDRESS); |
mbed_official | 133:d4dda5c437f0 | 276 | pNOR_ID->Device_Code1 = *(__IO uint16_t *) __NOR_ADDR_SHIFT(DEVICE_CODE1_ADDR); |
mbed_official | 133:d4dda5c437f0 | 277 | pNOR_ID->Device_Code2 = *(__IO uint16_t *) __NOR_ADDR_SHIFT(DEVICE_CODE2_ADDR); |
mbed_official | 133:d4dda5c437f0 | 278 | pNOR_ID->Device_Code3 = *(__IO uint16_t *) __NOR_ADDR_SHIFT(DEVICE_CODE3_ADDR); |
mbed_official | 133:d4dda5c437f0 | 279 | |
mbed_official | 133:d4dda5c437f0 | 280 | /* Check the NOR controller state */ |
mbed_official | 133:d4dda5c437f0 | 281 | hnor->State = HAL_NOR_STATE_READY; |
mbed_official | 133:d4dda5c437f0 | 282 | |
mbed_official | 133:d4dda5c437f0 | 283 | /* Process unlocked */ |
mbed_official | 133:d4dda5c437f0 | 284 | __HAL_UNLOCK(hnor); |
mbed_official | 133:d4dda5c437f0 | 285 | |
mbed_official | 133:d4dda5c437f0 | 286 | return HAL_OK; |
mbed_official | 133:d4dda5c437f0 | 287 | } |
mbed_official | 133:d4dda5c437f0 | 288 | |
mbed_official | 133:d4dda5c437f0 | 289 | /** |
mbed_official | 133:d4dda5c437f0 | 290 | * @brief Returns the NOR memory to Read mode. |
mbed_official | 242:7074e42da0b2 | 291 | * @param hnor: pointer to a NOR_HandleTypeDef structure that contains |
mbed_official | 242:7074e42da0b2 | 292 | * the configuration information for NOR module. |
mbed_official | 133:d4dda5c437f0 | 293 | * @retval HAL status |
mbed_official | 133:d4dda5c437f0 | 294 | */ |
mbed_official | 133:d4dda5c437f0 | 295 | HAL_StatusTypeDef HAL_NOR_ReturnToReadMode(NOR_HandleTypeDef *hnor) |
mbed_official | 133:d4dda5c437f0 | 296 | { |
mbed_official | 133:d4dda5c437f0 | 297 | /* Process Locked */ |
mbed_official | 133:d4dda5c437f0 | 298 | __HAL_LOCK(hnor); |
mbed_official | 133:d4dda5c437f0 | 299 | |
mbed_official | 133:d4dda5c437f0 | 300 | /* Check the NOR controller state */ |
mbed_official | 133:d4dda5c437f0 | 301 | if(hnor->State == HAL_NOR_STATE_BUSY) |
mbed_official | 133:d4dda5c437f0 | 302 | { |
mbed_official | 133:d4dda5c437f0 | 303 | return HAL_BUSY; |
mbed_official | 133:d4dda5c437f0 | 304 | } |
mbed_official | 133:d4dda5c437f0 | 305 | |
mbed_official | 133:d4dda5c437f0 | 306 | __NOR_WRITE(NOR_MEMORY_ADRESS, 0x00F0); |
mbed_official | 133:d4dda5c437f0 | 307 | |
mbed_official | 133:d4dda5c437f0 | 308 | /* Check the NOR controller state */ |
mbed_official | 133:d4dda5c437f0 | 309 | hnor->State = HAL_NOR_STATE_READY; |
mbed_official | 133:d4dda5c437f0 | 310 | |
mbed_official | 133:d4dda5c437f0 | 311 | /* Process unlocked */ |
mbed_official | 133:d4dda5c437f0 | 312 | __HAL_UNLOCK(hnor); |
mbed_official | 133:d4dda5c437f0 | 313 | |
mbed_official | 133:d4dda5c437f0 | 314 | return HAL_OK; |
mbed_official | 133:d4dda5c437f0 | 315 | } |
mbed_official | 133:d4dda5c437f0 | 316 | |
mbed_official | 133:d4dda5c437f0 | 317 | /** |
mbed_official | 133:d4dda5c437f0 | 318 | * @brief Read data from NOR memory |
mbed_official | 242:7074e42da0b2 | 319 | * @param hnor: pointer to a NOR_HandleTypeDef structure that contains |
mbed_official | 242:7074e42da0b2 | 320 | * the configuration information for NOR module. |
mbed_official | 133:d4dda5c437f0 | 321 | * @param pAddress: pointer to Device address |
mbed_official | 133:d4dda5c437f0 | 322 | * @param pData : pointer to read data |
mbed_official | 133:d4dda5c437f0 | 323 | * @retval HAL status |
mbed_official | 133:d4dda5c437f0 | 324 | */ |
mbed_official | 133:d4dda5c437f0 | 325 | HAL_StatusTypeDef HAL_NOR_Read(NOR_HandleTypeDef *hnor, uint32_t *pAddress, uint16_t *pData) |
mbed_official | 133:d4dda5c437f0 | 326 | { |
mbed_official | 133:d4dda5c437f0 | 327 | /* Process Locked */ |
mbed_official | 133:d4dda5c437f0 | 328 | __HAL_LOCK(hnor); |
mbed_official | 133:d4dda5c437f0 | 329 | |
mbed_official | 133:d4dda5c437f0 | 330 | /* Check the NOR controller state */ |
mbed_official | 133:d4dda5c437f0 | 331 | if(hnor->State == HAL_NOR_STATE_BUSY) |
mbed_official | 133:d4dda5c437f0 | 332 | { |
mbed_official | 133:d4dda5c437f0 | 333 | return HAL_BUSY; |
mbed_official | 133:d4dda5c437f0 | 334 | } |
mbed_official | 133:d4dda5c437f0 | 335 | |
mbed_official | 133:d4dda5c437f0 | 336 | /* Update the NOR controller state */ |
mbed_official | 133:d4dda5c437f0 | 337 | hnor->State = HAL_NOR_STATE_BUSY; |
mbed_official | 133:d4dda5c437f0 | 338 | |
mbed_official | 133:d4dda5c437f0 | 339 | /* Send read data command */ |
mbed_official | 133:d4dda5c437f0 | 340 | __NOR_WRITE(__NOR_ADDR_SHIFT(0x00555), 0x00AA); |
mbed_official | 133:d4dda5c437f0 | 341 | __NOR_WRITE(__NOR_ADDR_SHIFT(0x002AA), 0x0055); |
mbed_official | 133:d4dda5c437f0 | 342 | __NOR_WRITE(*pAddress, 0x00F0); |
mbed_official | 133:d4dda5c437f0 | 343 | |
mbed_official | 133:d4dda5c437f0 | 344 | /* Read the data */ |
mbed_official | 133:d4dda5c437f0 | 345 | *pData = *(__IO uint32_t *)pAddress; |
mbed_official | 133:d4dda5c437f0 | 346 | |
mbed_official | 133:d4dda5c437f0 | 347 | /* Check the NOR controller state */ |
mbed_official | 133:d4dda5c437f0 | 348 | hnor->State = HAL_NOR_STATE_READY; |
mbed_official | 133:d4dda5c437f0 | 349 | |
mbed_official | 133:d4dda5c437f0 | 350 | /* Process unlocked */ |
mbed_official | 133:d4dda5c437f0 | 351 | __HAL_UNLOCK(hnor); |
mbed_official | 133:d4dda5c437f0 | 352 | |
mbed_official | 133:d4dda5c437f0 | 353 | return HAL_OK; |
mbed_official | 133:d4dda5c437f0 | 354 | } |
mbed_official | 133:d4dda5c437f0 | 355 | |
mbed_official | 133:d4dda5c437f0 | 356 | /** |
mbed_official | 133:d4dda5c437f0 | 357 | * @brief Program data to NOR memory |
mbed_official | 242:7074e42da0b2 | 358 | * @param hnor: pointer to a NOR_HandleTypeDef structure that contains |
mbed_official | 242:7074e42da0b2 | 359 | * the configuration information for NOR module. |
mbed_official | 133:d4dda5c437f0 | 360 | * @param pAddress: Device address |
mbed_official | 133:d4dda5c437f0 | 361 | * @param pData : pointer to the data to write |
mbed_official | 133:d4dda5c437f0 | 362 | * @retval HAL status |
mbed_official | 133:d4dda5c437f0 | 363 | */ |
mbed_official | 133:d4dda5c437f0 | 364 | HAL_StatusTypeDef HAL_NOR_Program(NOR_HandleTypeDef *hnor, uint32_t *pAddress, uint16_t *pData) |
mbed_official | 133:d4dda5c437f0 | 365 | { |
mbed_official | 133:d4dda5c437f0 | 366 | /* Process Locked */ |
mbed_official | 133:d4dda5c437f0 | 367 | __HAL_LOCK(hnor); |
mbed_official | 133:d4dda5c437f0 | 368 | |
mbed_official | 133:d4dda5c437f0 | 369 | /* Check the NOR controller state */ |
mbed_official | 133:d4dda5c437f0 | 370 | if(hnor->State == HAL_NOR_STATE_BUSY) |
mbed_official | 133:d4dda5c437f0 | 371 | { |
mbed_official | 133:d4dda5c437f0 | 372 | return HAL_BUSY; |
mbed_official | 133:d4dda5c437f0 | 373 | } |
mbed_official | 133:d4dda5c437f0 | 374 | |
mbed_official | 133:d4dda5c437f0 | 375 | /* Update the NOR controller state */ |
mbed_official | 133:d4dda5c437f0 | 376 | hnor->State = HAL_NOR_STATE_BUSY; |
mbed_official | 133:d4dda5c437f0 | 377 | |
mbed_official | 133:d4dda5c437f0 | 378 | /* Send program data command */ |
mbed_official | 133:d4dda5c437f0 | 379 | __NOR_WRITE(__NOR_ADDR_SHIFT(0x0555), 0x00AA); |
mbed_official | 133:d4dda5c437f0 | 380 | __NOR_WRITE(__NOR_ADDR_SHIFT(0x02AA), 0x0055); |
mbed_official | 133:d4dda5c437f0 | 381 | __NOR_WRITE(__NOR_ADDR_SHIFT(0x0555), 0x00A0); |
mbed_official | 133:d4dda5c437f0 | 382 | |
mbed_official | 133:d4dda5c437f0 | 383 | /* Write the data */ |
mbed_official | 133:d4dda5c437f0 | 384 | __NOR_WRITE(pAddress, *pData); |
mbed_official | 133:d4dda5c437f0 | 385 | |
mbed_official | 133:d4dda5c437f0 | 386 | /* Check the NOR controller state */ |
mbed_official | 133:d4dda5c437f0 | 387 | hnor->State = HAL_NOR_STATE_READY; |
mbed_official | 133:d4dda5c437f0 | 388 | |
mbed_official | 133:d4dda5c437f0 | 389 | /* Process unlocked */ |
mbed_official | 133:d4dda5c437f0 | 390 | __HAL_UNLOCK(hnor); |
mbed_official | 133:d4dda5c437f0 | 391 | |
mbed_official | 133:d4dda5c437f0 | 392 | return HAL_OK; |
mbed_official | 133:d4dda5c437f0 | 393 | } |
mbed_official | 133:d4dda5c437f0 | 394 | |
mbed_official | 133:d4dda5c437f0 | 395 | /** |
mbed_official | 133:d4dda5c437f0 | 396 | * @brief Reads a block of data from the FMC NOR memory. |
mbed_official | 242:7074e42da0b2 | 397 | * @param hnor: pointer to a NOR_HandleTypeDef structure that contains |
mbed_official | 242:7074e42da0b2 | 398 | * the configuration information for NOR module. |
mbed_official | 133:d4dda5c437f0 | 399 | * @param uwAddress: NOR memory internal address to read from. |
mbed_official | 133:d4dda5c437f0 | 400 | * @param pData: pointer to the buffer that receives the data read from the |
mbed_official | 133:d4dda5c437f0 | 401 | * NOR memory. |
mbed_official | 133:d4dda5c437f0 | 402 | * @param uwBufferSize : number of Half word to read. |
mbed_official | 133:d4dda5c437f0 | 403 | * @retval HAL status |
mbed_official | 133:d4dda5c437f0 | 404 | */ |
mbed_official | 133:d4dda5c437f0 | 405 | HAL_StatusTypeDef HAL_NOR_ReadBuffer(NOR_HandleTypeDef *hnor, uint32_t uwAddress, uint16_t *pData, uint32_t uwBufferSize) |
mbed_official | 133:d4dda5c437f0 | 406 | { |
mbed_official | 133:d4dda5c437f0 | 407 | /* Process Locked */ |
mbed_official | 133:d4dda5c437f0 | 408 | __HAL_LOCK(hnor); |
mbed_official | 133:d4dda5c437f0 | 409 | |
mbed_official | 133:d4dda5c437f0 | 410 | /* Check the NOR controller state */ |
mbed_official | 133:d4dda5c437f0 | 411 | if(hnor->State == HAL_NOR_STATE_BUSY) |
mbed_official | 133:d4dda5c437f0 | 412 | { |
mbed_official | 133:d4dda5c437f0 | 413 | return HAL_BUSY; |
mbed_official | 133:d4dda5c437f0 | 414 | } |
mbed_official | 133:d4dda5c437f0 | 415 | |
mbed_official | 133:d4dda5c437f0 | 416 | /* Update the NOR controller state */ |
mbed_official | 133:d4dda5c437f0 | 417 | hnor->State = HAL_NOR_STATE_BUSY; |
mbed_official | 133:d4dda5c437f0 | 418 | |
mbed_official | 133:d4dda5c437f0 | 419 | /* Send read data command */ |
mbed_official | 133:d4dda5c437f0 | 420 | __NOR_WRITE(__NOR_ADDR_SHIFT(0x00555), 0x00AA); |
mbed_official | 133:d4dda5c437f0 | 421 | __NOR_WRITE(__NOR_ADDR_SHIFT(0x002AA), 0x0055); |
mbed_official | 133:d4dda5c437f0 | 422 | __NOR_WRITE(uwAddress, 0x00F0); |
mbed_official | 133:d4dda5c437f0 | 423 | |
mbed_official | 133:d4dda5c437f0 | 424 | /* Read buffer */ |
mbed_official | 133:d4dda5c437f0 | 425 | while( uwBufferSize > 0) |
mbed_official | 133:d4dda5c437f0 | 426 | { |
mbed_official | 133:d4dda5c437f0 | 427 | *pData++ = *(__IO uint16_t *)uwAddress; |
mbed_official | 133:d4dda5c437f0 | 428 | uwAddress += 2; |
mbed_official | 133:d4dda5c437f0 | 429 | uwBufferSize--; |
mbed_official | 133:d4dda5c437f0 | 430 | } |
mbed_official | 133:d4dda5c437f0 | 431 | |
mbed_official | 133:d4dda5c437f0 | 432 | /* Check the NOR controller state */ |
mbed_official | 133:d4dda5c437f0 | 433 | hnor->State = HAL_NOR_STATE_READY; |
mbed_official | 133:d4dda5c437f0 | 434 | |
mbed_official | 133:d4dda5c437f0 | 435 | /* Process unlocked */ |
mbed_official | 133:d4dda5c437f0 | 436 | __HAL_UNLOCK(hnor); |
mbed_official | 133:d4dda5c437f0 | 437 | |
mbed_official | 133:d4dda5c437f0 | 438 | return HAL_OK; |
mbed_official | 133:d4dda5c437f0 | 439 | } |
mbed_official | 133:d4dda5c437f0 | 440 | |
mbed_official | 133:d4dda5c437f0 | 441 | /** |
mbed_official | 133:d4dda5c437f0 | 442 | * @brief Writes a half-word buffer to the FMC NOR memory. This function |
mbed_official | 133:d4dda5c437f0 | 443 | * must be used only with S29GL128P NOR memory. |
mbed_official | 242:7074e42da0b2 | 444 | * @param hnor: pointer to a NOR_HandleTypeDef structure that contains |
mbed_official | 242:7074e42da0b2 | 445 | * the configuration information for NOR module. |
mbed_official | 133:d4dda5c437f0 | 446 | * @param uwAddress: NOR memory internal address from which the data |
mbed_official | 133:d4dda5c437f0 | 447 | * @param pData: pointer to source data buffer. |
mbed_official | 133:d4dda5c437f0 | 448 | * @param uwBufferSize: number of Half words to write. The maximum allowed |
mbed_official | 133:d4dda5c437f0 | 449 | * @retval HAL status |
mbed_official | 133:d4dda5c437f0 | 450 | */ |
mbed_official | 133:d4dda5c437f0 | 451 | HAL_StatusTypeDef HAL_NOR_ProgramBuffer(NOR_HandleTypeDef *hnor, uint32_t uwAddress, uint16_t *pData, uint32_t uwBufferSize) |
mbed_official | 133:d4dda5c437f0 | 452 | { |
mbed_official | 133:d4dda5c437f0 | 453 | uint32_t lastloadedaddress = 0; |
mbed_official | 133:d4dda5c437f0 | 454 | uint32_t currentaddress = 0; |
mbed_official | 133:d4dda5c437f0 | 455 | uint32_t endaddress = 0; |
mbed_official | 133:d4dda5c437f0 | 456 | |
mbed_official | 133:d4dda5c437f0 | 457 | /* Process Locked */ |
mbed_official | 133:d4dda5c437f0 | 458 | __HAL_LOCK(hnor); |
mbed_official | 133:d4dda5c437f0 | 459 | |
mbed_official | 133:d4dda5c437f0 | 460 | /* Check the NOR controller state */ |
mbed_official | 133:d4dda5c437f0 | 461 | if(hnor->State == HAL_NOR_STATE_BUSY) |
mbed_official | 133:d4dda5c437f0 | 462 | { |
mbed_official | 133:d4dda5c437f0 | 463 | return HAL_BUSY; |
mbed_official | 133:d4dda5c437f0 | 464 | } |
mbed_official | 133:d4dda5c437f0 | 465 | |
mbed_official | 133:d4dda5c437f0 | 466 | /* Update the NOR controller state */ |
mbed_official | 133:d4dda5c437f0 | 467 | hnor->State = HAL_NOR_STATE_BUSY; |
mbed_official | 133:d4dda5c437f0 | 468 | |
mbed_official | 133:d4dda5c437f0 | 469 | /* Initialize variables */ |
mbed_official | 133:d4dda5c437f0 | 470 | currentaddress = uwAddress; |
mbed_official | 133:d4dda5c437f0 | 471 | endaddress = uwAddress + uwBufferSize - 1; |
mbed_official | 133:d4dda5c437f0 | 472 | lastloadedaddress = uwAddress; |
mbed_official | 133:d4dda5c437f0 | 473 | |
mbed_official | 133:d4dda5c437f0 | 474 | /* Issue unlock command sequence */ |
mbed_official | 133:d4dda5c437f0 | 475 | __NOR_WRITE(__NOR_ADDR_SHIFT(0x0555), 0x00AA); |
mbed_official | 133:d4dda5c437f0 | 476 | __NOR_WRITE(__NOR_ADDR_SHIFT(0x02AA), 0x0055); |
mbed_official | 133:d4dda5c437f0 | 477 | |
mbed_official | 133:d4dda5c437f0 | 478 | /* Write Buffer Load Command */ |
mbed_official | 133:d4dda5c437f0 | 479 | __NOR_WRITE(__NOR_ADDR_SHIFT(uwAddress), 0x25); |
mbed_official | 133:d4dda5c437f0 | 480 | __NOR_WRITE(__NOR_ADDR_SHIFT(uwAddress), (uwBufferSize - 1)); |
mbed_official | 133:d4dda5c437f0 | 481 | |
mbed_official | 133:d4dda5c437f0 | 482 | /* Load Data into NOR Buffer */ |
mbed_official | 133:d4dda5c437f0 | 483 | while(currentaddress <= endaddress) |
mbed_official | 133:d4dda5c437f0 | 484 | { |
mbed_official | 133:d4dda5c437f0 | 485 | /* Store last loaded address & data value (for polling) */ |
mbed_official | 133:d4dda5c437f0 | 486 | lastloadedaddress = currentaddress; |
mbed_official | 133:d4dda5c437f0 | 487 | |
mbed_official | 133:d4dda5c437f0 | 488 | __NOR_WRITE(__NOR_ADDR_SHIFT(currentaddress), *pData++); |
mbed_official | 133:d4dda5c437f0 | 489 | |
mbed_official | 133:d4dda5c437f0 | 490 | currentaddress += 1; |
mbed_official | 133:d4dda5c437f0 | 491 | } |
mbed_official | 133:d4dda5c437f0 | 492 | |
mbed_official | 133:d4dda5c437f0 | 493 | __NOR_WRITE(__NOR_ADDR_SHIFT(lastloadedaddress), 0x29); |
mbed_official | 133:d4dda5c437f0 | 494 | |
mbed_official | 133:d4dda5c437f0 | 495 | /* Check the NOR controller state */ |
mbed_official | 133:d4dda5c437f0 | 496 | hnor->State = HAL_NOR_STATE_READY; |
mbed_official | 133:d4dda5c437f0 | 497 | |
mbed_official | 133:d4dda5c437f0 | 498 | /* Process unlocked */ |
mbed_official | 133:d4dda5c437f0 | 499 | __HAL_UNLOCK(hnor); |
mbed_official | 133:d4dda5c437f0 | 500 | |
mbed_official | 133:d4dda5c437f0 | 501 | return HAL_OK; |
mbed_official | 133:d4dda5c437f0 | 502 | |
mbed_official | 133:d4dda5c437f0 | 503 | } |
mbed_official | 133:d4dda5c437f0 | 504 | |
mbed_official | 133:d4dda5c437f0 | 505 | /** |
mbed_official | 133:d4dda5c437f0 | 506 | * @brief Erase the specified block of the NOR memory |
mbed_official | 242:7074e42da0b2 | 507 | * @param hnor: pointer to a NOR_HandleTypeDef structure that contains |
mbed_official | 242:7074e42da0b2 | 508 | * the configuration information for NOR module. |
mbed_official | 133:d4dda5c437f0 | 509 | * @param BlockAddress : Block to erase address |
mbed_official | 133:d4dda5c437f0 | 510 | * @param Address: Device address |
mbed_official | 133:d4dda5c437f0 | 511 | * @retval HAL status |
mbed_official | 133:d4dda5c437f0 | 512 | */ |
mbed_official | 133:d4dda5c437f0 | 513 | HAL_StatusTypeDef HAL_NOR_Erase_Block(NOR_HandleTypeDef *hnor, uint32_t BlockAddress, uint32_t Address) |
mbed_official | 133:d4dda5c437f0 | 514 | { |
mbed_official | 133:d4dda5c437f0 | 515 | /* Process Locked */ |
mbed_official | 133:d4dda5c437f0 | 516 | __HAL_LOCK(hnor); |
mbed_official | 133:d4dda5c437f0 | 517 | |
mbed_official | 133:d4dda5c437f0 | 518 | /* Check the NOR controller state */ |
mbed_official | 133:d4dda5c437f0 | 519 | if(hnor->State == HAL_NOR_STATE_BUSY) |
mbed_official | 133:d4dda5c437f0 | 520 | { |
mbed_official | 133:d4dda5c437f0 | 521 | return HAL_BUSY; |
mbed_official | 133:d4dda5c437f0 | 522 | } |
mbed_official | 133:d4dda5c437f0 | 523 | |
mbed_official | 133:d4dda5c437f0 | 524 | /* Update the NOR controller state */ |
mbed_official | 133:d4dda5c437f0 | 525 | hnor->State = HAL_NOR_STATE_BUSY; |
mbed_official | 133:d4dda5c437f0 | 526 | |
mbed_official | 133:d4dda5c437f0 | 527 | /* Send block erase command sequence */ |
mbed_official | 133:d4dda5c437f0 | 528 | __NOR_WRITE(__NOR_ADDR_SHIFT(0x0555), 0x00AA); |
mbed_official | 133:d4dda5c437f0 | 529 | __NOR_WRITE(__NOR_ADDR_SHIFT(0x02AA), 0x0055); |
mbed_official | 133:d4dda5c437f0 | 530 | __NOR_WRITE(__NOR_ADDR_SHIFT(0x0555), 0x0080); |
mbed_official | 133:d4dda5c437f0 | 531 | __NOR_WRITE(__NOR_ADDR_SHIFT(0x0555), 0x00AA); |
mbed_official | 133:d4dda5c437f0 | 532 | __NOR_WRITE(__NOR_ADDR_SHIFT(0x02AA), 0x0055); |
mbed_official | 133:d4dda5c437f0 | 533 | __NOR_WRITE((uint32_t)(BlockAddress + Address), 0x30); |
mbed_official | 133:d4dda5c437f0 | 534 | |
mbed_official | 133:d4dda5c437f0 | 535 | /* Check the NOR memory status and update the controller state */ |
mbed_official | 133:d4dda5c437f0 | 536 | hnor->State = HAL_NOR_STATE_READY; |
mbed_official | 133:d4dda5c437f0 | 537 | |
mbed_official | 133:d4dda5c437f0 | 538 | /* Process unlocked */ |
mbed_official | 133:d4dda5c437f0 | 539 | __HAL_UNLOCK(hnor); |
mbed_official | 133:d4dda5c437f0 | 540 | |
mbed_official | 133:d4dda5c437f0 | 541 | return HAL_OK; |
mbed_official | 133:d4dda5c437f0 | 542 | |
mbed_official | 133:d4dda5c437f0 | 543 | } |
mbed_official | 133:d4dda5c437f0 | 544 | |
mbed_official | 133:d4dda5c437f0 | 545 | /** |
mbed_official | 133:d4dda5c437f0 | 546 | * @brief Erase the entire NOR chip. |
mbed_official | 242:7074e42da0b2 | 547 | * @param hnor: pointer to a NOR_HandleTypeDef structure that contains |
mbed_official | 242:7074e42da0b2 | 548 | * the configuration information for NOR module. |
mbed_official | 133:d4dda5c437f0 | 549 | * @param Address : Device address |
mbed_official | 133:d4dda5c437f0 | 550 | * @retval HAL status |
mbed_official | 133:d4dda5c437f0 | 551 | */ |
mbed_official | 133:d4dda5c437f0 | 552 | HAL_StatusTypeDef HAL_NOR_Erase_Chip(NOR_HandleTypeDef *hnor, uint32_t Address) |
mbed_official | 133:d4dda5c437f0 | 553 | { |
mbed_official | 133:d4dda5c437f0 | 554 | /* Process Locked */ |
mbed_official | 133:d4dda5c437f0 | 555 | __HAL_LOCK(hnor); |
mbed_official | 133:d4dda5c437f0 | 556 | |
mbed_official | 133:d4dda5c437f0 | 557 | /* Check the NOR controller state */ |
mbed_official | 133:d4dda5c437f0 | 558 | if(hnor->State == HAL_NOR_STATE_BUSY) |
mbed_official | 133:d4dda5c437f0 | 559 | { |
mbed_official | 133:d4dda5c437f0 | 560 | return HAL_BUSY; |
mbed_official | 133:d4dda5c437f0 | 561 | } |
mbed_official | 133:d4dda5c437f0 | 562 | |
mbed_official | 133:d4dda5c437f0 | 563 | /* Update the NOR controller state */ |
mbed_official | 133:d4dda5c437f0 | 564 | hnor->State = HAL_NOR_STATE_BUSY; |
mbed_official | 133:d4dda5c437f0 | 565 | |
mbed_official | 133:d4dda5c437f0 | 566 | /* Send NOR chip erase command sequence */ |
mbed_official | 133:d4dda5c437f0 | 567 | __NOR_WRITE(__NOR_ADDR_SHIFT(0x0555), 0x00AA); |
mbed_official | 133:d4dda5c437f0 | 568 | __NOR_WRITE(__NOR_ADDR_SHIFT(0x02AA), 0x0055); |
mbed_official | 133:d4dda5c437f0 | 569 | __NOR_WRITE(__NOR_ADDR_SHIFT(0x0555), 0x0080); |
mbed_official | 133:d4dda5c437f0 | 570 | __NOR_WRITE(__NOR_ADDR_SHIFT(0x0555), 0x00AA); |
mbed_official | 133:d4dda5c437f0 | 571 | __NOR_WRITE(__NOR_ADDR_SHIFT(0x02AA), 0x0055); |
mbed_official | 133:d4dda5c437f0 | 572 | __NOR_WRITE(__NOR_ADDR_SHIFT(0x0555), 0x0010); |
mbed_official | 133:d4dda5c437f0 | 573 | |
mbed_official | 133:d4dda5c437f0 | 574 | /* Check the NOR memory status and update the controller state */ |
mbed_official | 133:d4dda5c437f0 | 575 | hnor->State = HAL_NOR_STATE_READY; |
mbed_official | 133:d4dda5c437f0 | 576 | |
mbed_official | 133:d4dda5c437f0 | 577 | /* Process unlocked */ |
mbed_official | 133:d4dda5c437f0 | 578 | __HAL_UNLOCK(hnor); |
mbed_official | 133:d4dda5c437f0 | 579 | |
mbed_official | 133:d4dda5c437f0 | 580 | return HAL_OK; |
mbed_official | 133:d4dda5c437f0 | 581 | } |
mbed_official | 133:d4dda5c437f0 | 582 | |
mbed_official | 133:d4dda5c437f0 | 583 | /** |
mbed_official | 133:d4dda5c437f0 | 584 | * @brief Read NOR flash CFI IDs |
mbed_official | 242:7074e42da0b2 | 585 | * @param hnor: pointer to a NOR_HandleTypeDef structure that contains |
mbed_official | 242:7074e42da0b2 | 586 | * the configuration information for NOR module. |
mbed_official | 133:d4dda5c437f0 | 587 | * @param pNOR_CFI : pointer to NOR CFI IDs structure |
mbed_official | 133:d4dda5c437f0 | 588 | * @retval HAL status |
mbed_official | 133:d4dda5c437f0 | 589 | */ |
mbed_official | 133:d4dda5c437f0 | 590 | HAL_StatusTypeDef HAL_NOR_Read_CFI(NOR_HandleTypeDef *hnor, NOR_CFITypeDef *pNOR_CFI) |
mbed_official | 133:d4dda5c437f0 | 591 | { |
mbed_official | 133:d4dda5c437f0 | 592 | /* Process Locked */ |
mbed_official | 133:d4dda5c437f0 | 593 | __HAL_LOCK(hnor); |
mbed_official | 133:d4dda5c437f0 | 594 | |
mbed_official | 133:d4dda5c437f0 | 595 | /* Check the NOR controller state */ |
mbed_official | 133:d4dda5c437f0 | 596 | if(hnor->State == HAL_NOR_STATE_BUSY) |
mbed_official | 133:d4dda5c437f0 | 597 | { |
mbed_official | 133:d4dda5c437f0 | 598 | return HAL_BUSY; |
mbed_official | 133:d4dda5c437f0 | 599 | } |
mbed_official | 133:d4dda5c437f0 | 600 | |
mbed_official | 133:d4dda5c437f0 | 601 | /* Update the NOR controller state */ |
mbed_official | 133:d4dda5c437f0 | 602 | hnor->State = HAL_NOR_STATE_BUSY; |
mbed_official | 133:d4dda5c437f0 | 603 | |
mbed_official | 133:d4dda5c437f0 | 604 | /* Send read CFI query command */ |
mbed_official | 133:d4dda5c437f0 | 605 | __NOR_WRITE(__NOR_ADDR_SHIFT(0x0055), 0x0098); |
mbed_official | 133:d4dda5c437f0 | 606 | |
mbed_official | 133:d4dda5c437f0 | 607 | /* read the NOR CFI information */ |
mbed_official | 133:d4dda5c437f0 | 608 | pNOR_CFI->CFI_1 = *(__IO uint16_t *) __NOR_ADDR_SHIFT(CFI1_ADDRESS); |
mbed_official | 133:d4dda5c437f0 | 609 | pNOR_CFI->CFI_2 = *(__IO uint16_t *) __NOR_ADDR_SHIFT(CFI2_ADDRESS); |
mbed_official | 133:d4dda5c437f0 | 610 | pNOR_CFI->CFI_3 = *(__IO uint16_t *) __NOR_ADDR_SHIFT(CFI3_ADDRESS); |
mbed_official | 133:d4dda5c437f0 | 611 | pNOR_CFI->CFI_4 = *(__IO uint16_t *) __NOR_ADDR_SHIFT(CFI4_ADDRESS); |
mbed_official | 133:d4dda5c437f0 | 612 | |
mbed_official | 133:d4dda5c437f0 | 613 | /* Check the NOR controller state */ |
mbed_official | 133:d4dda5c437f0 | 614 | hnor->State = HAL_NOR_STATE_READY; |
mbed_official | 133:d4dda5c437f0 | 615 | |
mbed_official | 133:d4dda5c437f0 | 616 | /* Process unlocked */ |
mbed_official | 133:d4dda5c437f0 | 617 | __HAL_UNLOCK(hnor); |
mbed_official | 133:d4dda5c437f0 | 618 | |
mbed_official | 133:d4dda5c437f0 | 619 | return HAL_OK; |
mbed_official | 133:d4dda5c437f0 | 620 | } |
mbed_official | 133:d4dda5c437f0 | 621 | |
mbed_official | 133:d4dda5c437f0 | 622 | /** |
mbed_official | 133:d4dda5c437f0 | 623 | * @} |
mbed_official | 133:d4dda5c437f0 | 624 | */ |
mbed_official | 133:d4dda5c437f0 | 625 | |
mbed_official | 133:d4dda5c437f0 | 626 | /** @defgroup NOR_Group3 Control functions |
mbed_official | 133:d4dda5c437f0 | 627 | * @brief management functions |
mbed_official | 133:d4dda5c437f0 | 628 | * |
mbed_official | 133:d4dda5c437f0 | 629 | @verbatim |
mbed_official | 133:d4dda5c437f0 | 630 | ============================================================================== |
mbed_official | 133:d4dda5c437f0 | 631 | ##### NOR Control functions ##### |
mbed_official | 133:d4dda5c437f0 | 632 | ============================================================================== |
mbed_official | 133:d4dda5c437f0 | 633 | [..] |
mbed_official | 133:d4dda5c437f0 | 634 | This subsection provides a set of functions allowing to control dynamically |
mbed_official | 133:d4dda5c437f0 | 635 | the NOR interface. |
mbed_official | 133:d4dda5c437f0 | 636 | |
mbed_official | 133:d4dda5c437f0 | 637 | @endverbatim |
mbed_official | 133:d4dda5c437f0 | 638 | * @{ |
mbed_official | 133:d4dda5c437f0 | 639 | */ |
mbed_official | 133:d4dda5c437f0 | 640 | |
mbed_official | 133:d4dda5c437f0 | 641 | /** |
mbed_official | 133:d4dda5c437f0 | 642 | * @brief Enables dynamically NOR write operation. |
mbed_official | 242:7074e42da0b2 | 643 | * @param hnor: pointer to a NOR_HandleTypeDef structure that contains |
mbed_official | 242:7074e42da0b2 | 644 | * the configuration information for NOR module. |
mbed_official | 133:d4dda5c437f0 | 645 | * @retval HAL status |
mbed_official | 133:d4dda5c437f0 | 646 | */ |
mbed_official | 133:d4dda5c437f0 | 647 | HAL_StatusTypeDef HAL_NOR_WriteOperation_Enable(NOR_HandleTypeDef *hnor) |
mbed_official | 133:d4dda5c437f0 | 648 | { |
mbed_official | 133:d4dda5c437f0 | 649 | /* Process Locked */ |
mbed_official | 133:d4dda5c437f0 | 650 | __HAL_LOCK(hnor); |
mbed_official | 133:d4dda5c437f0 | 651 | |
mbed_official | 133:d4dda5c437f0 | 652 | /* Enable write operation */ |
mbed_official | 133:d4dda5c437f0 | 653 | FMC_NORSRAM_WriteOperation_Enable(hnor->Instance, hnor->Init.NSBank); |
mbed_official | 133:d4dda5c437f0 | 654 | |
mbed_official | 133:d4dda5c437f0 | 655 | /* Update the NOR controller state */ |
mbed_official | 133:d4dda5c437f0 | 656 | hnor->State = HAL_NOR_STATE_READY; |
mbed_official | 133:d4dda5c437f0 | 657 | |
mbed_official | 133:d4dda5c437f0 | 658 | /* Process unlocked */ |
mbed_official | 133:d4dda5c437f0 | 659 | __HAL_UNLOCK(hnor); |
mbed_official | 133:d4dda5c437f0 | 660 | |
mbed_official | 133:d4dda5c437f0 | 661 | return HAL_OK; |
mbed_official | 133:d4dda5c437f0 | 662 | } |
mbed_official | 133:d4dda5c437f0 | 663 | |
mbed_official | 133:d4dda5c437f0 | 664 | /** |
mbed_official | 133:d4dda5c437f0 | 665 | * @brief Disables dynamically NOR write operation. |
mbed_official | 242:7074e42da0b2 | 666 | * @param hnor: pointer to a NOR_HandleTypeDef structure that contains |
mbed_official | 242:7074e42da0b2 | 667 | * the configuration information for NOR module. |
mbed_official | 133:d4dda5c437f0 | 668 | * @retval HAL status |
mbed_official | 133:d4dda5c437f0 | 669 | */ |
mbed_official | 133:d4dda5c437f0 | 670 | HAL_StatusTypeDef HAL_NOR_WriteOperation_Disable(NOR_HandleTypeDef *hnor) |
mbed_official | 133:d4dda5c437f0 | 671 | { |
mbed_official | 133:d4dda5c437f0 | 672 | /* Process Locked */ |
mbed_official | 133:d4dda5c437f0 | 673 | __HAL_LOCK(hnor); |
mbed_official | 133:d4dda5c437f0 | 674 | |
mbed_official | 133:d4dda5c437f0 | 675 | /* Update the SRAM controller state */ |
mbed_official | 133:d4dda5c437f0 | 676 | hnor->State = HAL_NOR_STATE_BUSY; |
mbed_official | 133:d4dda5c437f0 | 677 | |
mbed_official | 133:d4dda5c437f0 | 678 | /* Disable write operation */ |
mbed_official | 133:d4dda5c437f0 | 679 | FMC_NORSRAM_WriteOperation_Disable(hnor->Instance, hnor->Init.NSBank); |
mbed_official | 133:d4dda5c437f0 | 680 | |
mbed_official | 133:d4dda5c437f0 | 681 | /* Update the NOR controller state */ |
mbed_official | 133:d4dda5c437f0 | 682 | hnor->State = HAL_NOR_STATE_PROTECTED; |
mbed_official | 133:d4dda5c437f0 | 683 | |
mbed_official | 133:d4dda5c437f0 | 684 | /* Process unlocked */ |
mbed_official | 133:d4dda5c437f0 | 685 | __HAL_UNLOCK(hnor); |
mbed_official | 133:d4dda5c437f0 | 686 | |
mbed_official | 133:d4dda5c437f0 | 687 | return HAL_OK; |
mbed_official | 133:d4dda5c437f0 | 688 | } |
mbed_official | 133:d4dda5c437f0 | 689 | |
mbed_official | 133:d4dda5c437f0 | 690 | /** |
mbed_official | 133:d4dda5c437f0 | 691 | * @} |
mbed_official | 133:d4dda5c437f0 | 692 | */ |
mbed_official | 133:d4dda5c437f0 | 693 | |
mbed_official | 133:d4dda5c437f0 | 694 | /** @defgroup NOR_Group4 State functions |
mbed_official | 133:d4dda5c437f0 | 695 | * @brief Peripheral State functions |
mbed_official | 133:d4dda5c437f0 | 696 | * |
mbed_official | 133:d4dda5c437f0 | 697 | @verbatim |
mbed_official | 133:d4dda5c437f0 | 698 | ============================================================================== |
mbed_official | 133:d4dda5c437f0 | 699 | ##### NOR State functions ##### |
mbed_official | 133:d4dda5c437f0 | 700 | ============================================================================== |
mbed_official | 133:d4dda5c437f0 | 701 | [..] |
mbed_official | 242:7074e42da0b2 | 702 | This subsection permits to get in run-time the status of the NOR controller |
mbed_official | 133:d4dda5c437f0 | 703 | and the data flow. |
mbed_official | 133:d4dda5c437f0 | 704 | |
mbed_official | 133:d4dda5c437f0 | 705 | @endverbatim |
mbed_official | 133:d4dda5c437f0 | 706 | * @{ |
mbed_official | 133:d4dda5c437f0 | 707 | */ |
mbed_official | 133:d4dda5c437f0 | 708 | |
mbed_official | 133:d4dda5c437f0 | 709 | /** |
mbed_official | 133:d4dda5c437f0 | 710 | * @brief return the NOR controller state |
mbed_official | 242:7074e42da0b2 | 711 | * @param hnor: pointer to a NOR_HandleTypeDef structure that contains |
mbed_official | 242:7074e42da0b2 | 712 | * the configuration information for NOR module. |
mbed_official | 133:d4dda5c437f0 | 713 | * @retval NOR controller state |
mbed_official | 133:d4dda5c437f0 | 714 | */ |
mbed_official | 133:d4dda5c437f0 | 715 | HAL_NOR_StateTypeDef HAL_NOR_GetState(NOR_HandleTypeDef *hnor) |
mbed_official | 133:d4dda5c437f0 | 716 | { |
mbed_official | 133:d4dda5c437f0 | 717 | return hnor->State; |
mbed_official | 133:d4dda5c437f0 | 718 | } |
mbed_official | 133:d4dda5c437f0 | 719 | |
mbed_official | 133:d4dda5c437f0 | 720 | /** |
mbed_official | 133:d4dda5c437f0 | 721 | * @brief Returns the NOR operation status. |
mbed_official | 242:7074e42da0b2 | 722 | * @param hnor: pointer to a NOR_HandleTypeDef structure that contains |
mbed_official | 242:7074e42da0b2 | 723 | * the configuration information for NOR module. |
mbed_official | 133:d4dda5c437f0 | 724 | * @param Address: Device address |
mbed_official | 133:d4dda5c437f0 | 725 | * @param Timeout: NOR progamming Timeout |
mbed_official | 133:d4dda5c437f0 | 726 | * @retval NOR_Status: The returned value can be: NOR_SUCCESS, NOR_ERROR |
mbed_official | 133:d4dda5c437f0 | 727 | * or NOR_TIMEOUT |
mbed_official | 133:d4dda5c437f0 | 728 | */ |
mbed_official | 133:d4dda5c437f0 | 729 | NOR_StatusTypedef HAL_NOR_GetStatus(NOR_HandleTypeDef *hnor, uint32_t Address, uint32_t Timeout) |
mbed_official | 133:d4dda5c437f0 | 730 | { |
mbed_official | 133:d4dda5c437f0 | 731 | NOR_StatusTypedef status = NOR_ONGOING; |
mbed_official | 133:d4dda5c437f0 | 732 | uint16_t tmpSR1 = 0, tmpSR2 = 0; |
mbed_official | 133:d4dda5c437f0 | 733 | uint32_t timeout = 0; |
mbed_official | 133:d4dda5c437f0 | 734 | |
mbed_official | 133:d4dda5c437f0 | 735 | /* Poll on NOR memory Ready/Busy signal ------------------------------------*/ |
mbed_official | 133:d4dda5c437f0 | 736 | HAL_NOR_MspWait(hnor, timeout); |
mbed_official | 133:d4dda5c437f0 | 737 | |
mbed_official | 133:d4dda5c437f0 | 738 | /* Get the NOR memory operation status -------------------------------------*/ |
mbed_official | 133:d4dda5c437f0 | 739 | while(status != NOR_SUCCESS) |
mbed_official | 133:d4dda5c437f0 | 740 | { |
mbed_official | 133:d4dda5c437f0 | 741 | /* Check for timeout value */ |
mbed_official | 133:d4dda5c437f0 | 742 | timeout = HAL_GetTick() + Timeout; |
mbed_official | 133:d4dda5c437f0 | 743 | |
mbed_official | 133:d4dda5c437f0 | 744 | if(HAL_GetTick() >= timeout) |
mbed_official | 133:d4dda5c437f0 | 745 | { |
mbed_official | 133:d4dda5c437f0 | 746 | status = NOR_TIMEOUT; |
mbed_official | 133:d4dda5c437f0 | 747 | } |
mbed_official | 133:d4dda5c437f0 | 748 | |
mbed_official | 133:d4dda5c437f0 | 749 | /* Read NOR status register (DQ6 and DQ5) */ |
mbed_official | 133:d4dda5c437f0 | 750 | tmpSR1 = *(__IO uint16_t *)Address; |
mbed_official | 133:d4dda5c437f0 | 751 | tmpSR2 = *(__IO uint16_t *)Address; |
mbed_official | 133:d4dda5c437f0 | 752 | |
mbed_official | 133:d4dda5c437f0 | 753 | /* If DQ6 did not toggle between the two reads then return NOR_Success */ |
mbed_official | 133:d4dda5c437f0 | 754 | if((tmpSR1 & 0x0040) == (tmpSR2 & 0x0040)) |
mbed_official | 133:d4dda5c437f0 | 755 | { |
mbed_official | 133:d4dda5c437f0 | 756 | return NOR_SUCCESS; |
mbed_official | 133:d4dda5c437f0 | 757 | } |
mbed_official | 133:d4dda5c437f0 | 758 | |
mbed_official | 133:d4dda5c437f0 | 759 | if((tmpSR1 & 0x0020) == 0x0020) |
mbed_official | 133:d4dda5c437f0 | 760 | { |
mbed_official | 133:d4dda5c437f0 | 761 | return NOR_ONGOING; |
mbed_official | 133:d4dda5c437f0 | 762 | } |
mbed_official | 133:d4dda5c437f0 | 763 | |
mbed_official | 133:d4dda5c437f0 | 764 | tmpSR1 = *(__IO uint16_t *)Address; |
mbed_official | 133:d4dda5c437f0 | 765 | tmpSR2 = *(__IO uint16_t *)Address; |
mbed_official | 133:d4dda5c437f0 | 766 | |
mbed_official | 133:d4dda5c437f0 | 767 | /* If DQ6 did not toggle between the two reads then return NOR_Success */ |
mbed_official | 133:d4dda5c437f0 | 768 | if((tmpSR1 & 0x0040) == (tmpSR2 & 0x0040)) |
mbed_official | 133:d4dda5c437f0 | 769 | { |
mbed_official | 133:d4dda5c437f0 | 770 | return NOR_SUCCESS; |
mbed_official | 133:d4dda5c437f0 | 771 | } |
mbed_official | 133:d4dda5c437f0 | 772 | |
mbed_official | 133:d4dda5c437f0 | 773 | if((tmpSR1 & 0x0020) == 0x0020) |
mbed_official | 133:d4dda5c437f0 | 774 | { |
mbed_official | 133:d4dda5c437f0 | 775 | return NOR_ERROR; |
mbed_official | 133:d4dda5c437f0 | 776 | } |
mbed_official | 133:d4dda5c437f0 | 777 | } |
mbed_official | 133:d4dda5c437f0 | 778 | |
mbed_official | 133:d4dda5c437f0 | 779 | /* Return the operation status */ |
mbed_official | 133:d4dda5c437f0 | 780 | return status; |
mbed_official | 133:d4dda5c437f0 | 781 | } |
mbed_official | 133:d4dda5c437f0 | 782 | |
mbed_official | 133:d4dda5c437f0 | 783 | /** |
mbed_official | 133:d4dda5c437f0 | 784 | * @} |
mbed_official | 133:d4dda5c437f0 | 785 | */ |
mbed_official | 133:d4dda5c437f0 | 786 | |
mbed_official | 133:d4dda5c437f0 | 787 | /** |
mbed_official | 133:d4dda5c437f0 | 788 | * @} |
mbed_official | 133:d4dda5c437f0 | 789 | */ |
mbed_official | 133:d4dda5c437f0 | 790 | #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ |
mbed_official | 133:d4dda5c437f0 | 791 | #endif /* HAL_NOR_MODULE_ENABLED */ |
mbed_official | 133:d4dda5c437f0 | 792 | /** |
mbed_official | 133:d4dda5c437f0 | 793 | * @} |
mbed_official | 133:d4dda5c437f0 | 794 | */ |
mbed_official | 133:d4dda5c437f0 | 795 | |
mbed_official | 133:d4dda5c437f0 | 796 | /** |
mbed_official | 133:d4dda5c437f0 | 797 | * @} |
mbed_official | 133:d4dda5c437f0 | 798 | */ |
mbed_official | 133:d4dda5c437f0 | 799 | |
mbed_official | 133:d4dda5c437f0 | 800 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |