STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
stm32f7xx_hal_flash_ex.c
Go to the documentation of this file.
1 
74 /* Includes ------------------------------------------------------------------*/
75 #include "stm32f7xx_hal.h"
76 
86 #ifdef HAL_FLASH_MODULE_ENABLED
87 
88 /* Private typedef -----------------------------------------------------------*/
89 /* Private define ------------------------------------------------------------*/
93 #define SECTOR_MASK ((uint32_t)0xFFFFFF07)
94 #define FLASH_TIMEOUT_VALUE ((uint32_t)50000)/* 50 s */
95 
99 /* Private macro -------------------------------------------------------------*/
100 /* Private variables ---------------------------------------------------------*/
104 extern FLASH_ProcessTypeDef pFlash;
109 /* Private function prototypes -----------------------------------------------*/
113 /* Option bytes control */
114 static HAL_StatusTypeDef FLASH_OB_EnableWRP(uint32_t WRPSector);
115 static HAL_StatusTypeDef FLASH_OB_DisableWRP(uint32_t WRPSector);
116 static HAL_StatusTypeDef FLASH_OB_RDP_LevelConfig(uint8_t Level);
117 static HAL_StatusTypeDef FLASH_OB_BOR_LevelConfig(uint8_t Level);
118 static HAL_StatusTypeDef FLASH_OB_BootAddressConfig(uint32_t BootOption, uint32_t Address);
119 static uint32_t FLASH_OB_GetUser(void);
120 static uint32_t FLASH_OB_GetWRP(void);
121 static uint8_t FLASH_OB_GetRDP(void);
122 static uint32_t FLASH_OB_GetBOR(void);
123 static uint32_t FLASH_OB_GetBootAddress(uint32_t BootOption);
124 
125 #if defined (FLASH_OPTCR_nDBANK)
126 static void FLASH_MassErase(uint8_t VoltageRange, uint32_t Banks);
127 static HAL_StatusTypeDef FLASH_OB_UserConfig(uint32_t Wwdg, uint32_t Iwdg, uint32_t Stop, uint32_t Stdby, uint32_t Iwdgstop, \
128  uint32_t Iwdgstdby, uint32_t NDBank, uint32_t NDBoot);
129 #else
130 static void FLASH_MassErase(uint8_t VoltageRange);
131 static HAL_StatusTypeDef FLASH_OB_UserConfig(uint32_t Wwdg, uint32_t Iwdg, uint32_t Stop, uint32_t Stdby, uint32_t Iwdgstop, uint32_t Iwdgstdby);
132 #endif /* FLASH_OPTCR_nDBANK */
133 
134 extern HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout);
139 /* Exported functions --------------------------------------------------------*/
169 HAL_StatusTypeDef HAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit, uint32_t *SectorError)
170 {
171  HAL_StatusTypeDef status = HAL_ERROR;
172  uint32_t index = 0;
173 
174  /* Process Locked */
175  __HAL_LOCK(&pFlash);
176 
177  /* Check the parameters */
179 
180  /* Wait for last operation to be completed */
181  status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE);
182 
183  if(status == HAL_OK)
184  {
185  /*Initialization of SectorError variable*/
186  *SectorError = 0xFFFFFFFFU;
187 
188  if(pEraseInit->TypeErase == FLASH_TYPEERASE_MASSERASE)
189  {
190  /*Mass erase to be done*/
191 #if defined (FLASH_OPTCR_nDBANK)
192  FLASH_MassErase((uint8_t) pEraseInit->VoltageRange, pEraseInit->Banks);
193 #else
194  FLASH_MassErase((uint8_t) pEraseInit->VoltageRange);
195 #endif /* FLASH_OPTCR_nDBANK */
196 
197  /* Wait for last operation to be completed */
198  status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE);
199 
200  /* if the erase operation is completed, disable the MER Bit */
201  FLASH->CR &= (~FLASH_MER_BIT);
202  }
203  else
204  {
205  /* Check the parameters */
206  assert_param(IS_FLASH_NBSECTORS(pEraseInit->NbSectors + pEraseInit->Sector));
207 
208  /* Erase by sector by sector to be done*/
209  for(index = pEraseInit->Sector; index < (pEraseInit->NbSectors + pEraseInit->Sector); index++)
210  {
211  FLASH_Erase_Sector(index, (uint8_t) pEraseInit->VoltageRange);
212 
213  /* Wait for last operation to be completed */
214  status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE);
215 
216  /* If the erase operation is completed, disable the SER Bit and SNB Bits */
218 
219  if(status != HAL_OK)
220  {
221  /* In case of error, stop erase procedure and return the faulty sector*/
222  *SectorError = index;
223  break;
224  }
225  }
226  }
227  }
228 
229  /* Process Unlocked */
230  __HAL_UNLOCK(&pFlash);
231 
232  return status;
233 }
234 
243 {
244  HAL_StatusTypeDef status = HAL_OK;
245 
246  /* Process Locked */
247  __HAL_LOCK(&pFlash);
248 
249  /* Check the parameters */
251 
252  /* Enable End of FLASH Operation interrupt */
254 
255  /* Enable Error source interrupt */
257 
258  /* Clear pending flags (if any) */
261 
262  if(pEraseInit->TypeErase == FLASH_TYPEERASE_MASSERASE)
263  {
264  /*Mass erase to be done*/
266 #if defined (FLASH_OPTCR_nDBANK)
267  FLASH_MassErase((uint8_t) pEraseInit->VoltageRange, pEraseInit->Banks);
268 #else
269  FLASH_MassErase((uint8_t) pEraseInit->VoltageRange);
270 #endif /* FLASH_OPTCR_nDBANK */
271  }
272  else
273  {
274  /* Erase by sector to be done*/
275 
276  /* Check the parameters */
277  assert_param(IS_FLASH_NBSECTORS(pEraseInit->NbSectors + pEraseInit->Sector));
278 
280  pFlash.NbSectorsToErase = pEraseInit->NbSectors;
281  pFlash.Sector = pEraseInit->Sector;
282  pFlash.VoltageForErase = (uint8_t)pEraseInit->VoltageRange;
283 
284  /*Erase 1st sector and wait for IT*/
285  FLASH_Erase_Sector(pEraseInit->Sector, pEraseInit->VoltageRange);
286  }
287 
288  return status;
289 }
290 
299 {
300  HAL_StatusTypeDef status = HAL_ERROR;
301 
302  /* Process Locked */
303  __HAL_LOCK(&pFlash);
304 
305  /* Check the parameters */
307 
308  /* Write protection configuration */
309  if((pOBInit->OptionType & OPTIONBYTE_WRP) == OPTIONBYTE_WRP)
310  {
311  assert_param(IS_WRPSTATE(pOBInit->WRPState));
312  if(pOBInit->WRPState == OB_WRPSTATE_ENABLE)
313  {
314  /*Enable of Write protection on the selected Sector*/
315  status = FLASH_OB_EnableWRP(pOBInit->WRPSector);
316  }
317  else
318  {
319  /*Disable of Write protection on the selected Sector*/
320  status = FLASH_OB_DisableWRP(pOBInit->WRPSector);
321  }
322  }
323 
324  /* Read protection configuration */
325  if((pOBInit->OptionType & OPTIONBYTE_RDP) == OPTIONBYTE_RDP)
326  {
327  status = FLASH_OB_RDP_LevelConfig(pOBInit->RDPLevel);
328  }
329 
330  /* USER configuration */
331  if((pOBInit->OptionType & OPTIONBYTE_USER) == OPTIONBYTE_USER)
332  {
333 #if defined (FLASH_OPTCR_nDBANK)
334  status = FLASH_OB_UserConfig(pOBInit->USERConfig & OB_WWDG_SW,
335  pOBInit->USERConfig & OB_IWDG_SW,
336  pOBInit->USERConfig & OB_STOP_NO_RST,
337  pOBInit->USERConfig & OB_STDBY_NO_RST,
338  pOBInit->USERConfig & OB_IWDG_STOP_ACTIVE,
339  pOBInit->USERConfig & OB_IWDG_STDBY_ACTIVE,
340  pOBInit->USERConfig & OB_NDBANK_SINGLE_BANK,
341  pOBInit->USERConfig & OB_DUAL_BOOT_DISABLE);
342 #else
343  status = FLASH_OB_UserConfig(pOBInit->USERConfig & OB_WWDG_SW,
344  pOBInit->USERConfig & OB_IWDG_SW,
345  pOBInit->USERConfig & OB_STOP_NO_RST,
346  pOBInit->USERConfig & OB_STDBY_NO_RST,
347  pOBInit->USERConfig & OB_IWDG_STOP_ACTIVE,
348  pOBInit->USERConfig & OB_IWDG_STDBY_ACTIVE);
349 #endif /* FLASH_OPTCR_nDBANK */
350  }
351 
352  /* BOR Level configuration */
353  if((pOBInit->OptionType & OPTIONBYTE_BOR) == OPTIONBYTE_BOR)
354  {
355  status = FLASH_OB_BOR_LevelConfig(pOBInit->BORLevel);
356  }
357 
358  /* Boot 0 Address configuration */
360  {
361  status = FLASH_OB_BootAddressConfig(OPTIONBYTE_BOOTADDR_0, pOBInit->BootAddr0);
362  }
363 
364  /* Boot 1 Address configuration */
366  {
367  status = FLASH_OB_BootAddressConfig(OPTIONBYTE_BOOTADDR_1, pOBInit->BootAddr1);
368  }
369 
370  /* Process Unlocked */
371  __HAL_UNLOCK(&pFlash);
372 
373  return status;
374 }
375 
384 {
386  OPTIONBYTE_BOR | OPTIONBYTE_BOOTADDR_0 | OPTIONBYTE_BOOTADDR_1;
387 
388  /*Get WRP*/
389  pOBInit->WRPSector = FLASH_OB_GetWRP();
390 
391  /*Get RDP Level*/
392  pOBInit->RDPLevel = FLASH_OB_GetRDP();
393 
394  /*Get USER*/
395  pOBInit->USERConfig = FLASH_OB_GetUser();
396 
397  /*Get BOR Level*/
398  pOBInit->BORLevel = FLASH_OB_GetBOR();
399 
400  /*Get Boot Address when Boot pin = 0 */
401  pOBInit->BootAddr0 = FLASH_OB_GetBootAddress(OPTIONBYTE_BOOTADDR_0);
402 
403  /*Get Boot Address when Boot pin = 1 */
404  pOBInit->BootAddr1 = FLASH_OB_GetBootAddress(OPTIONBYTE_BOOTADDR_1);
405 }
410 #if defined (FLASH_OPTCR_nDBANK)
411 
431 static void FLASH_MassErase(uint8_t VoltageRange, uint32_t Banks)
432 {
433  /* Check the parameters */
434  assert_param(IS_VOLTAGERANGE(VoltageRange));
435  assert_param(IS_FLASH_BANK(Banks));
436 
437  /* if the previous operation is completed, proceed to erase all sectors */
438  FLASH->CR &= CR_PSIZE_MASK;
439  if(Banks == FLASH_BANK_BOTH)
440  {
441  /* bank1 & bank2 will be erased*/
442  FLASH->CR |= FLASH_MER_BIT;
443  }
444  else if(Banks == FLASH_BANK_2)
445  {
446  /*Only bank2 will be erased*/
447  FLASH->CR |= FLASH_CR_MER2;
448  }
449  else
450  {
451  /*Only bank1 will be erased*/
452  FLASH->CR |= FLASH_CR_MER1;
453  }
454  FLASH->CR |= FLASH_CR_STRT | ((uint32_t)VoltageRange <<8);
455  /* Data synchronous Barrier (DSB) Just after the write operation
456  This will force the CPU to respect the sequence of instruction (no optimization).*/
457  __DSB();
458 }
459 
477 void FLASH_Erase_Sector(uint32_t Sector, uint8_t VoltageRange)
478 {
479  uint32_t tmp_psize = 0;
480 
481  /* Check the parameters */
482  assert_param(IS_FLASH_SECTOR(Sector));
483  assert_param(IS_VOLTAGERANGE(VoltageRange));
484 
485  if(VoltageRange == FLASH_VOLTAGE_RANGE_1)
486  {
487  tmp_psize = FLASH_PSIZE_BYTE;
488  }
489  else if(VoltageRange == FLASH_VOLTAGE_RANGE_2)
490  {
491  tmp_psize = FLASH_PSIZE_HALF_WORD;
492  }
493  else if(VoltageRange == FLASH_VOLTAGE_RANGE_3)
494  {
495  tmp_psize = FLASH_PSIZE_WORD;
496  }
497  else
498  {
499  tmp_psize = FLASH_PSIZE_DOUBLE_WORD;
500  }
501 
502  /* Need to add offset of 4 when sector higher than FLASH_SECTOR_11 */
503  if(Sector > FLASH_SECTOR_11)
504  {
505  Sector += 4;
506  }
507 
508  /* If the previous operation is completed, proceed to erase the sector */
509  FLASH->CR &= CR_PSIZE_MASK;
510  FLASH->CR |= tmp_psize;
512  FLASH->CR |= FLASH_CR_SER | (Sector << POSITION_VAL(FLASH_CR_SNB));
513  FLASH->CR |= FLASH_CR_STRT;
514 
515  /* Data synchronous Barrier (DSB) Just after the write operation
516  This will force the CPU to respect the sequence of instruction (no optimization).*/
517  __DSB();
518 }
519 
524 static uint32_t FLASH_OB_GetWRP(void)
525 {
526  /* Return the FLASH write protection Register value */
527  return ((uint32_t)(FLASH->OPTCR & 0x0FFF0000));
528 }
529 
567 static HAL_StatusTypeDef FLASH_OB_UserConfig(uint32_t Wwdg, uint32_t Iwdg, uint32_t Stop, uint32_t Stdby, uint32_t Iwdgstop, \
568  uint32_t Iwdgstdby, uint32_t NDBank, uint32_t NDBoot)
569 {
570  uint32_t useroptionmask = 0x00;
571  uint32_t useroptionvalue = 0x00;
572 
573  HAL_StatusTypeDef status = HAL_OK;
574 
575  /* Check the parameters */
582  assert_param(IS_OB_NDBANK(NDBank));
583  assert_param(IS_OB_NDBOOT(NDBoot));
584 
585  /* Wait for last operation to be completed */
586  status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE);
587 
588  if(status == HAL_OK)
589  {
591  FLASH_OPTCR_nRST_STDBY | FLASH_OPTCR_IWDG_STOP | FLASH_OPTCR_IWDG_STDBY | \
592  FLASH_OPTCR_nDBOOT | FLASH_OPTCR_nDBANK);
593 
594  useroptionvalue = (Iwdg | Wwdg | Stop | Stdby | Iwdgstop | Iwdgstdby | NDBoot | NDBank);
595 
596  /* Update User Option Byte */
597  MODIFY_REG(FLASH->OPTCR, useroptionmask, useroptionvalue);
598  }
599 
600  return status;
601 }
602 
608 static uint32_t FLASH_OB_GetUser(void)
609 {
610  /* Return the User Option Byte */
611  return ((uint32_t)(FLASH->OPTCR & 0xF00000F0U));
612 }
613 #else
614 
630 static void FLASH_MassErase(uint8_t VoltageRange)
631 {
632  /* Check the parameters */
633  assert_param(IS_VOLTAGERANGE(VoltageRange));
634 
635  /* if the previous operation is completed, proceed to erase all sectors */
636  FLASH->CR &= CR_PSIZE_MASK;
637  FLASH->CR |= FLASH_CR_MER;
638  FLASH->CR |= FLASH_CR_STRT | ((uint32_t)VoltageRange <<8);
639  /* Data synchronous Barrier (DSB) Just after the write operation
640  This will force the CPU to respect the sequence of instruction (no optimization).*/
641  __DSB();
642 }
643 
661 void FLASH_Erase_Sector(uint32_t Sector, uint8_t VoltageRange)
662 {
663  uint32_t tmp_psize = 0;
664 
665  /* Check the parameters */
666  assert_param(IS_FLASH_SECTOR(Sector));
667  assert_param(IS_VOLTAGERANGE(VoltageRange));
668 
669  if(VoltageRange == FLASH_VOLTAGE_RANGE_1)
670  {
671  tmp_psize = FLASH_PSIZE_BYTE;
672  }
673  else if(VoltageRange == FLASH_VOLTAGE_RANGE_2)
674  {
675  tmp_psize = FLASH_PSIZE_HALF_WORD;
676  }
677  else if(VoltageRange == FLASH_VOLTAGE_RANGE_3)
678  {
679  tmp_psize = FLASH_PSIZE_WORD;
680  }
681  else
682  {
683  tmp_psize = FLASH_PSIZE_DOUBLE_WORD;
684  }
685 
686  /* If the previous operation is completed, proceed to erase the sector */
687  FLASH->CR &= CR_PSIZE_MASK;
688  FLASH->CR |= tmp_psize;
689  FLASH->CR &= SECTOR_MASK;
690  FLASH->CR |= FLASH_CR_SER | (Sector << POSITION_VAL(FLASH_CR_SNB));
691  FLASH->CR |= FLASH_CR_STRT;
692 
693  /* Data synchronous Barrier (DSB) Just after the write operation
694  This will force the CPU to respect the sequence of instruction (no optimization).*/
695  __DSB();
696 }
697 
702 static uint32_t FLASH_OB_GetWRP(void)
703 {
704  /* Return the FLASH write protection Register value */
705  return ((uint32_t)(FLASH->OPTCR & 0x00FF0000));
706 }
707 
736 static HAL_StatusTypeDef FLASH_OB_UserConfig(uint32_t Wwdg, uint32_t Iwdg, uint32_t Stop, uint32_t Stdby, uint32_t Iwdgstop, uint32_t Iwdgstdby)
737 {
738  uint32_t useroptionmask = 0x00;
739  uint32_t useroptionvalue = 0x00;
740 
741  HAL_StatusTypeDef status = HAL_OK;
742 
743  /* Check the parameters */
750 
751  /* Wait for last operation to be completed */
752  status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE);
753 
754  if(status == HAL_OK)
755  {
757  FLASH_OPTCR_nRST_STDBY | FLASH_OPTCR_IWDG_STOP | FLASH_OPTCR_IWDG_STDBY);
758 
759  useroptionvalue = (Iwdg | Wwdg | Stop | Stdby | Iwdgstop | Iwdgstdby);
760 
761  /* Update User Option Byte */
762  MODIFY_REG(FLASH->OPTCR, useroptionmask, useroptionvalue);
763  }
764 
765  return status;
766 
767 }
768 
774 static uint32_t FLASH_OB_GetUser(void)
775 {
776  /* Return the User Option Byte */
777  return ((uint32_t)(FLASH->OPTCR & 0xC00000F0));
778 }
779 #endif /* FLASH_OPTCR_nDBANK */
780 
797 static HAL_StatusTypeDef FLASH_OB_EnableWRP(uint32_t WRPSector)
798 {
799  HAL_StatusTypeDef status = HAL_OK;
800 
801  /* Check the parameters */
802  assert_param(IS_OB_WRP_SECTOR(WRPSector));
803 
804  /* Wait for last operation to be completed */
805  status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE);
806 
807  if(status == HAL_OK)
808  {
809  /*Write protection enabled on sectors */
810  FLASH->OPTCR &= (~WRPSector);
811  }
812 
813  return status;
814 }
815 
833 static HAL_StatusTypeDef FLASH_OB_DisableWRP(uint32_t WRPSector)
834 {
835  HAL_StatusTypeDef status = HAL_OK;
836 
837  /* Check the parameters */
838  assert_param(IS_OB_WRP_SECTOR(WRPSector));
839 
840  /* Wait for last operation to be completed */
841  status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE);
842 
843  if(status == HAL_OK)
844  {
845  /* Write protection disabled on sectors */
846  FLASH->OPTCR |= (WRPSector);
847  }
848 
849  return status;
850 }
851 
864 static HAL_StatusTypeDef FLASH_OB_RDP_LevelConfig(uint8_t Level)
865 {
866  HAL_StatusTypeDef status = HAL_OK;
867 
868  /* Check the parameters */
870 
871  /* Wait for last operation to be completed */
872  status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE);
873 
874  if(status == HAL_OK)
875  {
876  *(__IO uint8_t*)OPTCR_BYTE1_ADDRESS = Level;
877  }
878 
879  return status;
880 }
881 
892 static HAL_StatusTypeDef FLASH_OB_BOR_LevelConfig(uint8_t Level)
893 {
894  /* Check the parameters */
896 
897  /* Set the BOR Level */
898  MODIFY_REG(FLASH->OPTCR, FLASH_OPTCR_BOR_LEV, Level);
899 
900  return HAL_OK;
901 
902 }
903 
923 static HAL_StatusTypeDef FLASH_OB_BootAddressConfig(uint32_t BootOption, uint32_t Address)
924 {
925  HAL_StatusTypeDef status = HAL_OK;
926 
927  /* Check the parameters */
929 
930  /* Wait for last operation to be completed */
931  status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE);
932 
933  if(status == HAL_OK)
934  {
935  if(BootOption == OPTIONBYTE_BOOTADDR_0)
936  {
937  MODIFY_REG(FLASH->OPTCR1, FLASH_OPTCR1_BOOT_ADD0, Address);
938  }
939  else
940  {
941  MODIFY_REG(FLASH->OPTCR1, FLASH_OPTCR1_BOOT_ADD1, (Address << 16));
942  }
943  }
944 
945  return status;
946 }
947 
956 static uint8_t FLASH_OB_GetRDP(void)
957 {
958  uint8_t readstatus = OB_RDP_LEVEL_0;
959 
960  if ((*(__IO uint8_t*)(OPTCR_BYTE1_ADDRESS)) == OB_RDP_LEVEL_0)
961  {
962  readstatus = OB_RDP_LEVEL_0;
963  }
964  else if ((*(__IO uint8_t*)(OPTCR_BYTE1_ADDRESS)) == OB_RDP_LEVEL_2)
965  {
966  readstatus = OB_RDP_LEVEL_2;
967  }
968  else
969  {
970  readstatus = OB_RDP_LEVEL_1;
971  }
972 
973  return readstatus;
974 }
975 
984 static uint32_t FLASH_OB_GetBOR(void)
985 {
986  /* Return the FLASH BOR level */
987  return ((uint32_t)(FLASH->OPTCR & 0x0C));
988 }
989 
1007 static uint32_t FLASH_OB_GetBootAddress(uint32_t BootOption)
1008 {
1009  uint32_t Address = 0;
1010 
1011  /* Return the Boot base Address */
1012  if(BootOption == OPTIONBYTE_BOOTADDR_0)
1013  {
1014  Address = FLASH->OPTCR1 & FLASH_OPTCR1_BOOT_ADD0;
1015  }
1016  else
1017  {
1018  Address = ((FLASH->OPTCR1 & FLASH_OPTCR1_BOOT_ADD1) >> 16);
1019  }
1020 
1021  return Address;
1022 }
1023 
1028 #endif /* HAL_FLASH_MODULE_ENABLED */
1029 
1038 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
#define CLEAR_BIT(REG, BIT)
Definition: stm32f7xx.h:180
#define MODIFY_REG(REG, CLEARMASK, SETMASK)
Definition: stm32f7xx.h:190
void FLASH_Erase_Sector(uint32_t Sector, uint8_t VoltageRange)
FLASH Erase structure definition.
#define OB_WWDG_SW
#define FLASH_FLAG_ERSERR
HAL_StatusTypeDef HAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit, uint32_t *SectorError)
#define OPTCR_BYTE1_ADDRESS
OPTCR register byte 1 (Bits[15:8]) base address.
#define IS_OB_BOR_LEVEL(LEVEL)
#define FLASH_CR_MER
Definition: stm32f745xx.h:3876
#define assert_param(expr)
Include module&#39;s header file.
#define FLASH_CR_SNB
Definition: stm32f745xx.h:3877
#define IS_OB_STDBY_SOURCE(SOURCE)
#define FLASH_CR_MER2
Definition: stm32f765xx.h:4196
#define FLASH_OPTCR_IWDG_SW
Definition: stm32f745xx.h:3897
#define FLASH_CR_STRT
Definition: stm32f745xx.h:3885
#define FLASH_CR_SER
Definition: stm32f745xx.h:3875
#define CR_PSIZE_MASK
#define IS_OB_IWDG_STDBY_FREEZE(FREEZE)
#define __HAL_UNLOCK(__HANDLE__)
#define IS_VOLTAGERANGE(RANGE)
HAL_StatusTypeDef HAL_FLASHEx_Erase_IT(FLASH_EraseInitTypeDef *pEraseInit)
#define FLASH_OPTCR1_BOOT_ADD1
Definition: stm32f745xx.h:3923
#define IS_OB_BOOT_ADDRESS(ADDRESS)
#define OPTIONBYTE_USER
#define FLASH_FLAG_PGAERR
#define IS_OB_RDP_LEVEL(LEVEL)
#define OB_RDP_LEVEL_1
#define FLASH_PSIZE_HALF_WORD
#define FLASH
Definition: stm32f745xx.h:1326
#define OPTIONBYTE_WRP
#define FLASH_FLAG_OPERR
#define OPTIONBYTE_BOR
__IO FLASH_ProcedureTypeDef ProcedureOnGoing
#define POSITION_VAL(VAL)
Definition: stm32f7xx.h:192
#define FLASH_FLAG_WRPERR
#define IS_OB_WWDG_SOURCE(SOURCE)
#define FLASH_PSIZE_BYTE
FLASH handle Structure definition.
#define IS_FLASH_NBSECTORS(NBSECTORS)
#define FLASH_TYPEERASE_MASSERASE
#define __HAL_LOCK(__HANDLE__)
#define FLASH_OPTCR_BOR_LEV
Definition: stm32f745xx.h:3893
#define OB_RDP_LEVEL_0
#define OB_IWDG_STOP_ACTIVE
#define __DSB()
Data Synchronization Barrier.
Definition: cmsis_armcc.h:355
void HAL_FLASHEx_OBGetConfig(FLASH_OBProgramInitTypeDef *pOBInit)
#define FLASH_OPTCR_IWDG_STDBY
Definition: stm32f745xx.h:3918
#define OB_STDBY_NO_RST
__IO uint32_t NbSectorsToErase
#define FLASH_FLAG_EOP
#define OB_IWDG_SW
#define IS_WRPSTATE(VALUE)
#define FLASH_OPTCR1_BOOT_ADD0
Definition: stm32f745xx.h:3922
#define __IO
Definition: core_cm0.h:213
#define FLASH_VOLTAGE_RANGE_3
HAL_StatusTypeDef HAL_FLASHEx_OBProgram(FLASH_OBProgramInitTypeDef *pOBInit)
#define IS_OB_STOP_SOURCE(SOURCE)
This file contains all the functions prototypes for the HAL module driver.
#define OPTIONBYTE_BOOTADDR_1
#define OPTIONBYTE_RDP
#define FLASH_VOLTAGE_RANGE_1
HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout)
#define OB_STOP_NO_RST
#define FLASH_OPTCR_WWDG_SW
Definition: stm32f745xx.h:3896
#define OPTIONBYTE_BOOTADDR_0
#define __HAL_FLASH_CLEAR_FLAG(__FLAG__)
Clear the specified FLASH flag.
#define FLASH_IT_ERR
#define FLASH_MER_BIT
#define FLASH_CR_MER1
Definition: stm32f765xx.h:4186
#define OB_IWDG_STDBY_ACTIVE
#define FLASH_OPTCR_nRST_STOP
Definition: stm32f745xx.h:3898
#define IS_OPTIONBYTE(VALUE)
#define OB_WRPSTATE_ENABLE
#define FLASH_FLAG_PGPERR
#define IS_FLASH_TYPEERASE(VALUE)
#define FLASH_IT_EOP
#define IS_OB_IWDG_STOP_FREEZE(FREEZE)
FLASH Option Bytes Program structure definition.
#define FLASH_OPTCR_IWDG_STOP
Definition: stm32f745xx.h:3919
#define FLASH_PSIZE_WORD
HAL_StatusTypeDef
HAL Status structures definition.
#define OB_RDP_LEVEL_2
#define __HAL_FLASH_ENABLE_IT(__INTERRUPT__)
Enable the specified FLASH interrupt.
#define FLASH_OPTCR_nDBANK
Definition: stm32f765xx.h:4235
#define FLASH_VOLTAGE_RANGE_2
#define IS_OB_IWDG_SOURCE(SOURCE)
#define FLASH_PSIZE_DOUBLE_WORD