stm32h7xx_hal_flash_ex.c
Go to the documentation of this file.
1 
76 /* Includes ------------------------------------------------------------------*/
77 #include "stm32h7xx_hal.h"
78 
88 #ifdef HAL_FLASH_MODULE_ENABLED
89 
90 /* Private typedef -----------------------------------------------------------*/
91 /* Private define ------------------------------------------------------------*/
95 #define FLASH_TIMEOUT_VALUE 50000U /* 50 s */
96 
100 /* Private macro -------------------------------------------------------------*/
101 /* Private variables ---------------------------------------------------------*/
102 /* Private function prototypes -----------------------------------------------*/
106 static void FLASH_MassErase(uint32_t VoltageRange, uint32_t Banks);
107 static void FLASH_OB_EnableWRP(uint32_t WRPSector, uint32_t Banks);
108 static void FLASH_OB_DisableWRP(uint32_t WRPSector, uint32_t Bank);
109 static void FLASH_OB_GetWRP(uint32_t *WRPState, uint32_t *WRPSector, uint32_t Bank);
110 static void FLASH_OB_RDPConfig(uint32_t RDPLevel);
111 static uint32_t FLASH_OB_GetRDP(void);
112 static void FLASH_OB_PCROPConfig(uint32_t PCROConfigRDP, uint32_t PCROPStartAddr, uint32_t PCROPEndAddr, uint32_t Banks);
113 static void FLASH_OB_GetPCROP(uint32_t *PCROPConfig, uint32_t *PCROPStartAddr,uint32_t *PCROPEndAddr, uint32_t Bank);
114 static void FLASH_OB_BOR_LevelConfig(uint32_t Level);
115 static uint32_t FLASH_OB_GetBOR(void);
116 static void FLASH_OB_UserConfig(uint32_t UserType, uint32_t UserConfig);
117 static uint32_t FLASH_OB_GetUser(void);
118 static void FLASH_OB_BootAddConfig(uint32_t BootOption, uint32_t BootAddress0, uint32_t BootAddress1);
119 static void FLASH_OB_GetBootAdd(uint32_t *BootAddress0, uint32_t *BootAddress1);
120 static void FLASH_OB_SecureAreaConfig(uint32_t SecureAreaConfig, uint32_t SecureAreaStartAddr, uint32_t SecureAreaEndAddr, uint32_t Banks);
121 static void FLASH_OB_GetSecureArea(uint32_t *SecureAreaConfig, uint32_t *SecureAreaStartAddr, uint32_t *SecureAreaEndAddr, uint32_t Bank);
122 static void FLASH_CRC_AddSector(uint32_t Sector, uint32_t Bank);
123 static void FLASH_CRC_SelectAddress(uint32_t CRCStartAddr, uint32_t CRCEndAddr, uint32_t Bank);
124 
125 #if defined (DUAL_CORE)
126 static void FLASH_OB_CM4BootAddConfig(uint32_t BootOption, uint32_t BootAddress0, uint32_t BootAddress1);
127 static void FLASH_OB_GetCM4BootAdd(uint32_t *BootAddress0, uint32_t *BootAddress1);
128 #endif /*DUAL_CORE*/
129 
130 #if defined (FLASH_OTPBL_LOCKBL)
131 static void FLASH_OB_OTP_LockConfig(uint32_t OTP_Block);
132 static uint32_t FLASH_OB_OTP_GetLock(void);
133 #endif /* FLASH_OTPBL_LOCKBL */
134 
135 #if defined (FLASH_OPTSR2_TCM_AXI_SHARED)
136 static void FLASH_OB_SharedRAM_Config(uint32_t SharedRamConfig);
137 static uint32_t FLASH_OB_SharedRAM_GetConfig(void);
138 #endif /* FLASH_OPTSR2_TCM_AXI_SHARED */
139 
140 #if defined (FLASH_OPTSR2_CPUFREQ_BOOST)
141 static void FLASH_OB_CPUFreq_BoostConfig(uint32_t FreqBoost);
142 static uint32_t FLASH_OB_CPUFreq_GetBoost(void);
143 #endif /* FLASH_OPTSR2_CPUFREQ_BOOST */
144 
148 /* Exported functions ---------------------------------------------------------*/
178 HAL_StatusTypeDef HAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit, uint32_t *SectorError)
179 {
180  HAL_StatusTypeDef status = HAL_OK;
181  uint32_t sector_index;
182 
183  /* Check the parameters */
185  assert_param(IS_FLASH_BANK(pEraseInit->Banks));
186 
187  /* Process Locked */
188  __HAL_LOCK(&pFlash);
189 
190  /* Reset error code */
192 
193  /* Wait for last operation to be completed on Bank1 */
194  if((pEraseInit->Banks & FLASH_BANK_1) == FLASH_BANK_1)
195  {
196  if(FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE, FLASH_BANK_1) != HAL_OK)
197  {
198  status = HAL_ERROR;
199  }
200  }
201 
202 #if defined (DUAL_BANK)
203  /* Wait for last operation to be completed on Bank2 */
204  if((pEraseInit->Banks & FLASH_BANK_2) == FLASH_BANK_2)
205  {
206  if(FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE, FLASH_BANK_2) != HAL_OK)
207  {
208  status = HAL_ERROR;
209  }
210  }
211 #endif /* DUAL_BANK */
212 
213  if(status == HAL_OK)
214  {
215  if(pEraseInit->TypeErase == FLASH_TYPEERASE_MASSERASE)
216  {
217  /* Mass erase to be done */
218  FLASH_MassErase(pEraseInit->VoltageRange, pEraseInit->Banks);
219 
220  /* Wait for last operation to be completed on Bank 1 */
221  if((pEraseInit->Banks & FLASH_BANK_1) == FLASH_BANK_1)
222  {
223  if(FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE, FLASH_BANK_1) != HAL_OK)
224  {
225  status = HAL_ERROR;
226  }
227  /* if the erase operation is completed, disable the Bank1 BER Bit */
228  FLASH->CR1 &= (~FLASH_CR_BER);
229  }
230 #if defined (DUAL_BANK)
231  /* Wait for last operation to be completed on Bank 2 */
232  if((pEraseInit->Banks & FLASH_BANK_2) == FLASH_BANK_2)
233  {
234  if(FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE, FLASH_BANK_2) != HAL_OK)
235  {
236  status = HAL_ERROR;
237  }
238  /* if the erase operation is completed, disable the Bank2 BER Bit */
239  FLASH->CR2 &= (~FLASH_CR_BER);
240  }
241 #endif /* DUAL_BANK */
242  }
243  else
244  {
245  /*Initialization of SectorError variable*/
246  *SectorError = 0xFFFFFFFFU;
247 
248  /* Erase by sector by sector to be done*/
249  for(sector_index = pEraseInit->Sector; sector_index < (pEraseInit->NbSectors + pEraseInit->Sector); sector_index++)
250  {
251  FLASH_Erase_Sector(sector_index, pEraseInit->Banks, pEraseInit->VoltageRange);
252 
253  if((pEraseInit->Banks & FLASH_BANK_1) == FLASH_BANK_1)
254  {
255  /* Wait for last operation to be completed */
256  status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE, FLASH_BANK_1);
257 
258  /* If the erase operation is completed, disable the SER Bit */
259  FLASH->CR1 &= (~(FLASH_CR_SER | FLASH_CR_SNB));
260  }
261 #if defined (DUAL_BANK)
262  if((pEraseInit->Banks & FLASH_BANK_2) == FLASH_BANK_2)
263  {
264  /* Wait for last operation to be completed */
265  status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE, FLASH_BANK_2);
266 
267  /* If the erase operation is completed, disable the SER Bit */
268  FLASH->CR2 &= (~(FLASH_CR_SER | FLASH_CR_SNB));
269  }
270 #endif /* DUAL_BANK */
271 
272  if(status != HAL_OK)
273  {
274  /* In case of error, stop erase procedure and return the faulty sector */
275  *SectorError = sector_index;
276  break;
277  }
278  }
279  }
280  }
281 
282  /* Process Unlocked */
284 
285  return status;
286 }
287 
296 {
297  HAL_StatusTypeDef status = HAL_OK;
298 
299  /* Check the parameters */
301  assert_param(IS_FLASH_BANK(pEraseInit->Banks));
302 
303  /* Process Locked */
304  __HAL_LOCK(&pFlash);
305 
306  /* Reset error code */
308 
309  /* Wait for last operation to be completed on Bank 1 */
310  if((pEraseInit->Banks & FLASH_BANK_1) == FLASH_BANK_1)
311  {
312  if(FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE, FLASH_BANK_1) != HAL_OK)
313  {
314  status = HAL_ERROR;
315  }
316  }
317 
318 #if defined (DUAL_BANK)
319  /* Wait for last operation to be completed on Bank 2 */
320  if((pEraseInit->Banks & FLASH_BANK_2) == FLASH_BANK_2)
321  {
322  if(FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE, FLASH_BANK_2) != HAL_OK)
323  {
324  status = HAL_ERROR;
325  }
326  }
327 #endif /* DUAL_BANK */
328 
329  if (status != HAL_OK)
330  {
331  /* Process Unlocked */
333  }
334  else
335  {
336  if((pEraseInit->Banks & FLASH_BANK_1) == FLASH_BANK_1)
337  {
338  /* Enable End of Operation and Error interrupts for Bank 1 */
339 #if defined (FLASH_CR_OPERRIE)
341  FLASH_IT_STRBERR_BANK1 | FLASH_IT_INCERR_BANK1 | FLASH_IT_OPERR_BANK1);
342 #else
345 #endif /* FLASH_CR_OPERRIE */
346  }
347 #if defined (DUAL_BANK)
348  if((pEraseInit->Banks & FLASH_BANK_2) == FLASH_BANK_2)
349  {
350  /* Enable End of Operation and Error interrupts for Bank 2 */
351 #if defined (FLASH_CR_OPERRIE)
353  FLASH_IT_STRBERR_BANK2 | FLASH_IT_INCERR_BANK2 | FLASH_IT_OPERR_BANK2);
354 #else
357 #endif /* FLASH_CR_OPERRIE */
358  }
359 #endif /* DUAL_BANK */
360 
361  if(pEraseInit->TypeErase == FLASH_TYPEERASE_MASSERASE)
362  {
363  /*Mass erase to be done*/
364  if(pEraseInit->Banks == FLASH_BANK_1)
365  {
367  }
368 #if defined (DUAL_BANK)
369  else if(pEraseInit->Banks == FLASH_BANK_2)
370  {
372  }
373 #endif /* DUAL_BANK */
374  else
375  {
377  }
378 
379  FLASH_MassErase(pEraseInit->VoltageRange, pEraseInit->Banks);
380  }
381  else
382  {
383  /* Erase by sector to be done */
384 #if defined (DUAL_BANK)
385  if(pEraseInit->Banks == FLASH_BANK_1)
386  {
388  }
389  else
390  {
392  }
393 #else
395 #endif /* DUAL_BANK */
396 
397  pFlash.NbSectorsToErase = pEraseInit->NbSectors;
398  pFlash.Sector = pEraseInit->Sector;
399  pFlash.VoltageForErase = pEraseInit->VoltageRange;
400 
401  /* Erase first sector and wait for IT */
402  FLASH_Erase_Sector(pEraseInit->Sector, pEraseInit->Banks, pEraseInit->VoltageRange);
403  }
404  }
405 
406  return status;
407 }
408 
417 {
418  HAL_StatusTypeDef status;
419 
420  /* Check the parameters */
422 
423  /* Process Locked */
424  __HAL_LOCK(&pFlash);
425 
426  /* Reset Error Code */
428 
429  /* Wait for last operation to be completed */
430  if(FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE, FLASH_BANK_1) != HAL_OK)
431  {
432  status = HAL_ERROR;
433  }
434 #if defined (DUAL_BANK)
435  else if(FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE, FLASH_BANK_2) != HAL_OK)
436  {
437  status = HAL_ERROR;
438  }
439 #endif /* DUAL_BANK */
440  else
441  {
442  status = HAL_OK;
443  }
444 
445  if(status == HAL_OK)
446  {
447  /*Write protection configuration*/
448  if((pOBInit->OptionType & OPTIONBYTE_WRP) == OPTIONBYTE_WRP)
449  {
450  assert_param(IS_WRPSTATE(pOBInit->WRPState));
451 
452  if(pOBInit->WRPState == OB_WRPSTATE_ENABLE)
453  {
454  /*Enable of Write protection on the selected Sector*/
455  FLASH_OB_EnableWRP(pOBInit->WRPSector,pOBInit->Banks);
456  }
457  else
458  {
459  /*Disable of Write protection on the selected Sector*/
460  FLASH_OB_DisableWRP(pOBInit->WRPSector, pOBInit->Banks);
461  }
462  }
463 
464  /* Read protection configuration */
465  if((pOBInit->OptionType & OPTIONBYTE_RDP) != 0U)
466  {
467  /* Configure the Read protection level */
468  FLASH_OB_RDPConfig(pOBInit->RDPLevel);
469  }
470 
471  /* User Configuration */
472  if((pOBInit->OptionType & OPTIONBYTE_USER) != 0U)
473  {
474  /* Configure the user option bytes */
475  FLASH_OB_UserConfig(pOBInit->USERType, pOBInit->USERConfig);
476  }
477 
478  /* PCROP Configuration */
479  if((pOBInit->OptionType & OPTIONBYTE_PCROP) != 0U)
480  {
481  assert_param(IS_FLASH_BANK(pOBInit->Banks));
482 
483  /*Configure the Proprietary code readout protection */
484  FLASH_OB_PCROPConfig(pOBInit->PCROPConfig, pOBInit->PCROPStartAddr, pOBInit->PCROPEndAddr, pOBInit->Banks);
485  }
486 
487  /* BOR Level configuration */
488  if((pOBInit->OptionType & OPTIONBYTE_BOR) == OPTIONBYTE_BOR)
489  {
490  FLASH_OB_BOR_LevelConfig(pOBInit->BORLevel);
491  }
492 
493 #if defined(DUAL_CORE)
494  /* CM7 Boot Address configuration */
495  if((pOBInit->OptionType & OPTIONBYTE_CM7_BOOTADD) == OPTIONBYTE_CM7_BOOTADD)
496  {
497  FLASH_OB_BootAddConfig(pOBInit->BootConfig, pOBInit->BootAddr0, pOBInit->BootAddr1);
498  }
499 
500  /* CM4 Boot Address configuration */
501  if((pOBInit->OptionType & OPTIONBYTE_CM4_BOOTADD) == OPTIONBYTE_CM4_BOOTADD)
502  {
503  FLASH_OB_CM4BootAddConfig(pOBInit->CM4BootConfig, pOBInit->CM4BootAddr0, pOBInit->CM4BootAddr1);
504  }
505 #else /* Single Core*/
506  /* Boot Address configuration */
508  {
509  FLASH_OB_BootAddConfig(pOBInit->BootConfig, pOBInit->BootAddr0, pOBInit->BootAddr1);
510  }
511 #endif /*DUAL_CORE*/
512 
513  /* Secure area configuration */
515  {
516  FLASH_OB_SecureAreaConfig(pOBInit->SecureAreaConfig, pOBInit->SecureAreaStartAddr, pOBInit->SecureAreaEndAddr,pOBInit->Banks);
517  }
518 
519 #if defined(FLASH_OTPBL_LOCKBL)
520  /* OTP Block Lock configuration */
521  if((pOBInit->OptionType & OPTIONBYTE_OTP_LOCK) == OPTIONBYTE_OTP_LOCK)
522  {
523  FLASH_OB_OTP_LockConfig(pOBInit->OTPBlockLock);
524  }
525 #endif /* FLASH_OTPBL_LOCKBL */
526 
527 #if defined(FLASH_OPTSR2_TCM_AXI_SHARED)
528  /* TCM / AXI Shared RAM configuration */
529  if((pOBInit->OptionType & OPTIONBYTE_SHARED_RAM) == OPTIONBYTE_SHARED_RAM)
530  {
531  FLASH_OB_SharedRAM_Config(pOBInit->SharedRamConfig);
532  }
533 #endif /* FLASH_OPTSR2_TCM_AXI_SHARED */
534 
535 #if defined(FLASH_OPTSR2_CPUFREQ_BOOST)
536  /* CPU Frequency Boost configuration */
537  if((pOBInit->OptionType & OPTIONBYTE_FREQ_BOOST) == OPTIONBYTE_FREQ_BOOST)
538  {
539  FLASH_OB_CPUFreq_BoostConfig(pOBInit->FreqBoostState);
540  }
541 #endif /* FLASH_OPTSR2_CPUFREQ_BOOST */
542  }
543 
544  /* Process Unlocked */
546 
547  return status;
548 }
549 
560 {
562 
563  /* Get Read protection level */
564  pOBInit->RDPLevel = FLASH_OB_GetRDP();
565 
566  /* Get the user option bytes */
567  pOBInit->USERConfig = FLASH_OB_GetUser();
568 
569  /*Get BOR Level*/
570  pOBInit->BORLevel = FLASH_OB_GetBOR();
571 
572 #if defined (DUAL_BANK)
573  if ((pOBInit->Banks == FLASH_BANK_1) || (pOBInit->Banks == FLASH_BANK_2))
574 #else
575  if (pOBInit->Banks == FLASH_BANK_1)
576 #endif /* DUAL_BANK */
577  {
579 
580  /* Get write protection on the selected area */
581  FLASH_OB_GetWRP(&(pOBInit->WRPState), &(pOBInit->WRPSector), pOBInit->Banks);
582 
583  /* Get the Proprietary code readout protection */
584  FLASH_OB_GetPCROP(&(pOBInit->PCROPConfig), &(pOBInit->PCROPStartAddr), &(pOBInit->PCROPEndAddr), pOBInit->Banks);
585 
586  /*Get Bank Secure area*/
587  FLASH_OB_GetSecureArea(&(pOBInit->SecureAreaConfig), &(pOBInit->SecureAreaStartAddr), &(pOBInit->SecureAreaEndAddr), pOBInit->Banks);
588  }
589 
590  /*Get Boot Address*/
591  FLASH_OB_GetBootAdd(&(pOBInit->BootAddr0), &(pOBInit->BootAddr1));
592 #if defined(DUAL_CORE)
593  pOBInit->OptionType |= OPTIONBYTE_CM7_BOOTADD | OPTIONBYTE_CM4_BOOTADD;
594 
595  /*Get CM4 Boot Address*/
596  FLASH_OB_GetCM4BootAdd(&(pOBInit->CM4BootAddr0), &(pOBInit->CM4BootAddr1));
597 #else
598  pOBInit->OptionType |= OPTIONBYTE_BOOTADD;
599 #endif /*DUAL_CORE*/
600 
601 #if defined (FLASH_OTPBL_LOCKBL)
602  pOBInit->OptionType |= OPTIONBYTE_OTP_LOCK;
603 
604  /* Get OTP Block Lock */
605  pOBInit->OTPBlockLock = FLASH_OB_OTP_GetLock();
606 #endif /* FLASH_OTPBL_LOCKBL */
607 
608 #if defined (FLASH_OPTSR2_TCM_AXI_SHARED)
609  pOBInit->OptionType |= OPTIONBYTE_SHARED_RAM;
610 
611  /* Get TCM / AXI Shared RAM */
612  pOBInit->SharedRamConfig = FLASH_OB_SharedRAM_GetConfig();
613 #endif /* FLASH_OPTSR2_TCM_AXI_SHARED */
614 
615 #if defined (FLASH_OPTSR2_CPUFREQ_BOOST)
616  pOBInit->OptionType |= OPTIONBYTE_FREQ_BOOST;
617 
618  /* Get CPU Frequency Boost */
619  pOBInit->FreqBoostState = FLASH_OB_CPUFreq_GetBoost();
620 #endif /* FLASH_OPTSR2_CPUFREQ_BOOST */
621 }
622 
628 {
629  if(READ_BIT(FLASH->CR1, FLASH_CR_LOCK) != 0U)
630  {
631  /* Authorize the FLASH Bank1 Registers access */
632  WRITE_REG(FLASH->KEYR1, FLASH_KEY1);
633  WRITE_REG(FLASH->KEYR1, FLASH_KEY2);
634 
635  /* Verify Flash Bank1 is unlocked */
636  if (READ_BIT(FLASH->CR1, FLASH_CR_LOCK) != 0U)
637  {
638  return HAL_ERROR;
639  }
640  }
641 
642  return HAL_OK;
643 }
644 
650 {
651  /* Set the LOCK Bit to lock the FLASH Bank1 Registers access */
652  SET_BIT(FLASH->CR1, FLASH_CR_LOCK);
653  return HAL_OK;
654 }
655 
656 #if defined (DUAL_BANK)
657 
661 HAL_StatusTypeDef HAL_FLASHEx_Unlock_Bank2(void)
662 {
663  if(READ_BIT(FLASH->CR2, FLASH_CR_LOCK) != 0U)
664  {
665  /* Authorize the FLASH Bank2 Registers access */
666  WRITE_REG(FLASH->KEYR2, FLASH_KEY1);
667  WRITE_REG(FLASH->KEYR2, FLASH_KEY2);
668 
669  /* Verify Flash Bank1 is unlocked */
670  if (READ_BIT(FLASH->CR2, FLASH_CR_LOCK) != 0U)
671  {
672  return HAL_ERROR;
673  }
674  }
675 
676  return HAL_OK;
677 }
678 
683 HAL_StatusTypeDef HAL_FLASHEx_Lock_Bank2(void)
684 {
685  /* Set the LOCK Bit to lock the FLASH Bank2 Registers access */
686  SET_BIT(FLASH->CR2, FLASH_CR_LOCK);
687  return HAL_OK;
688 }
689 #endif /* DUAL_BANK */
690 
691 /*
692  * @brief Perform a CRC computation on the specified FLASH memory area
693  * @param pCRCInit pointer to an FLASH_CRCInitTypeDef structure that
694  * contains the configuration information for the CRC computation.
695  * @note CRC computation uses CRC-32 (Ethernet) polynomial 0x4C11DB7
696  * @note The application should avoid running a CRC on PCROP or secure-only
697  * user Flash memory area since it may alter the expected CRC value.
698  * A special error flag (CRC read error: CRCRDERR) can be used to
699  * detect such a case.
700  * @retval HAL Status
701 */
702 HAL_StatusTypeDef HAL_FLASHEx_ComputeCRC(FLASH_CRCInitTypeDef *pCRCInit, uint32_t *CRC_Result)
703 {
704  HAL_StatusTypeDef status;
705  uint32_t sector_index;
706 
707  /* Check the parameters */
710 
711  /* Wait for OB change operation to be completed */
712  status = FLASH_OB_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE);
713 
714  if (status == HAL_OK)
715  {
716  if (pCRCInit->Bank == FLASH_BANK_1)
717  {
718  /* Enable CRC feature */
719  FLASH->CR1 |= FLASH_CR_CRC_EN;
720 
721  /* Clear CRC flags in Status Register: CRC end of calculation and CRC read error */
723 
724  /* Clear current CRC result, program burst size and define memory area on which CRC has to be computed */
725  FLASH->CRCCR1 |= FLASH_CRCCR_CLEAN_CRC | pCRCInit->BurstSize | pCRCInit->TypeCRC;
726 
727  if (pCRCInit->TypeCRC == FLASH_CRC_SECTORS)
728  {
729  /* Clear sectors list */
730  FLASH->CRCCR1 |= FLASH_CRCCR_CLEAN_SECT;
731 
732  /* Select CRC sectors */
733  for(sector_index = pCRCInit->Sector; sector_index < (pCRCInit->NbSectors + pCRCInit->Sector); sector_index++)
734  {
735  FLASH_CRC_AddSector(sector_index, FLASH_BANK_1);
736  }
737  }
738  else if (pCRCInit->TypeCRC == FLASH_CRC_BANK)
739  {
740  /* Enable Bank 1 CRC select bit */
741  FLASH->CRCCR1 |= FLASH_CRCCR_ALL_BANK;
742  }
743  else
744  {
745  /* Select CRC start and end addresses */
746  FLASH_CRC_SelectAddress(pCRCInit->CRCStartAddr, pCRCInit->CRCEndAddr, FLASH_BANK_1);
747  }
748 
749  /* Start the CRC calculation */
750  FLASH->CRCCR1 |= FLASH_CRCCR_START_CRC;
751 
752  /* Wait on CRC busy flag */
753  status = FLASH_CRC_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE, FLASH_BANK_1);
754 
755  /* Return CRC result */
756  (*CRC_Result) = FLASH->CRCDATA;
757 
758  /* Disable CRC feature */
759  FLASH->CR1 &= (~FLASH_CR_CRC_EN);
760 
761  /* Clear CRC flags */
763  }
764 #if defined (DUAL_BANK)
765  else
766  {
767  /* Enable CRC feature */
768  FLASH->CR2 |= FLASH_CR_CRC_EN;
769 
770  /* Clear CRC flags in Status Register: CRC end of calculation and CRC read error */
772 
773  /* Clear current CRC result, program burst size and define memory area on which CRC has to be computed */
774  FLASH->CRCCR2 |= FLASH_CRCCR_CLEAN_CRC | pCRCInit->BurstSize | pCRCInit->TypeCRC;
775 
776  if (pCRCInit->TypeCRC == FLASH_CRC_SECTORS)
777  {
778  /* Clear sectors list */
779  FLASH->CRCCR2 |= FLASH_CRCCR_CLEAN_SECT;
780 
781  /* Add CRC sectors */
782  for(sector_index = pCRCInit->Sector; sector_index < (pCRCInit->NbSectors + pCRCInit->Sector); sector_index++)
783  {
784  FLASH_CRC_AddSector(sector_index, FLASH_BANK_2);
785  }
786  }
787  else if (pCRCInit->TypeCRC == FLASH_CRC_BANK)
788  {
789  /* Enable Bank 2 CRC select bit */
790  FLASH->CRCCR2 |= FLASH_CRCCR_ALL_BANK;
791  }
792  else
793  {
794  /* Select CRC start and end addresses */
795  FLASH_CRC_SelectAddress(pCRCInit->CRCStartAddr, pCRCInit->CRCEndAddr, FLASH_BANK_2);
796  }
797 
798  /* Start the CRC calculation */
799  FLASH->CRCCR2 |= FLASH_CRCCR_START_CRC;
800 
801  /* Wait on CRC busy flag */
802  status = FLASH_CRC_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE, FLASH_BANK_2);
803 
804  /* Return CRC result */
805  (*CRC_Result) = FLASH->CRCDATA;
806 
807  /* Disable CRC feature */
808  FLASH->CR2 &= (~FLASH_CR_CRC_EN);
809 
810  /* Clear CRC flags */
812  }
813 #endif /* DUAL_BANK */
814  }
815 
816  return status;
817 }
818 
827 /* Private functions ---------------------------------------------------------*/
828 
850 static void FLASH_MassErase(uint32_t VoltageRange, uint32_t Banks)
851 {
852  /* Check the parameters */
853 #if defined (FLASH_CR_PSIZE)
854  assert_param(IS_VOLTAGERANGE(VoltageRange));
855 #else
856  UNUSED(VoltageRange);
857 #endif /* FLASH_CR_PSIZE */
858  assert_param(IS_FLASH_BANK(Banks));
859 
860 #if defined (DUAL_BANK)
861  /* Flash Mass Erase */
862  if((Banks & FLASH_BANK_BOTH) == FLASH_BANK_BOTH)
863  {
864 #if defined (FLASH_CR_PSIZE)
865  /* Reset Program/erase VoltageRange for Bank1 and Bank2 */
866  FLASH->CR1 &= (~FLASH_CR_PSIZE);
867  FLASH->CR2 &= (~FLASH_CR_PSIZE);
868 
869  /* Set voltage range */
870  FLASH->CR1 |= VoltageRange;
871  FLASH->CR2 |= VoltageRange;
872 #endif /* FLASH_CR_PSIZE */
873 
874  /* Set Mass Erase Bit */
875  FLASH->OPTCR |= FLASH_OPTCR_MER;
876  }
877  else
878 #endif /* DUAL_BANK */
879  {
880  /* Proceed to erase Flash Bank */
881  if((Banks & FLASH_BANK_1) == FLASH_BANK_1)
882  {
883 #if defined (FLASH_CR_PSIZE)
884  /* Set Program/erase VoltageRange for Bank1 */
885  FLASH->CR1 &= (~FLASH_CR_PSIZE);
886  FLASH->CR1 |= VoltageRange;
887 #endif /* FLASH_CR_PSIZE */
888 
889  /* Erase Bank1 */
890  FLASH->CR1 |= (FLASH_CR_BER | FLASH_CR_START);
891  }
892 
893 #if defined (DUAL_BANK)
894  if((Banks & FLASH_BANK_2) == FLASH_BANK_2)
895  {
896 #if defined (FLASH_CR_PSIZE)
897  /* Set Program/erase VoltageRange for Bank2 */
898  FLASH->CR2 &= (~FLASH_CR_PSIZE);
899  FLASH->CR2 |= VoltageRange;
900 #endif /* FLASH_CR_PSIZE */
901 
902  /* Erase Bank2 */
903  FLASH->CR2 |= (FLASH_CR_BER | FLASH_CR_START);
904  }
905 #endif /* DUAL_BANK */
906  }
907 }
908 
927 void FLASH_Erase_Sector(uint32_t Sector, uint32_t Banks, uint32_t VoltageRange)
928 {
929  assert_param(IS_FLASH_SECTOR(Sector));
931 #if defined (FLASH_CR_PSIZE)
932  assert_param(IS_VOLTAGERANGE(VoltageRange));
933 #else
934  UNUSED(VoltageRange);
935 #endif /* FLASH_CR_PSIZE */
936 
937  if((Banks & FLASH_BANK_1) == FLASH_BANK_1)
938  {
939 #if defined (FLASH_CR_PSIZE)
940  /* Reset Program/erase VoltageRange and Sector Number for Bank1 */
941  FLASH->CR1 &= ~(FLASH_CR_PSIZE | FLASH_CR_SNB);
942 
943  FLASH->CR1 |= (FLASH_CR_SER | VoltageRange | (Sector << FLASH_CR_SNB_Pos) | FLASH_CR_START);
944 #else
945  /* Reset Sector Number for Bank1 */
946  FLASH->CR1 &= ~(FLASH_CR_SNB);
947 
948  FLASH->CR1 |= (FLASH_CR_SER | (Sector << FLASH_CR_SNB_Pos) | FLASH_CR_START);
949 #endif /* FLASH_CR_PSIZE */
950  }
951 
952 #if defined (DUAL_BANK)
953  if((Banks & FLASH_BANK_2) == FLASH_BANK_2)
954  {
955 #if defined (FLASH_CR_PSIZE)
956  /* Reset Program/erase VoltageRange and Sector Number for Bank2 */
957  FLASH->CR2 &= ~(FLASH_CR_PSIZE | FLASH_CR_SNB);
958 
959  FLASH->CR2 |= (FLASH_CR_SER | VoltageRange | (Sector << FLASH_CR_SNB_Pos) | FLASH_CR_START);
960 #else
961  /* Reset Sector Number for Bank2 */
962  FLASH->CR2 &= ~(FLASH_CR_SNB);
963 
964  FLASH->CR2 |= (FLASH_CR_SER | (Sector << FLASH_CR_SNB_Pos) | FLASH_CR_START);
965 #endif /* FLASH_CR_PSIZE */
966  }
967 #endif /* DUAL_BANK */
968 }
969 
984 static void FLASH_OB_EnableWRP(uint32_t WRPSector, uint32_t Banks)
985 {
986  /* Check the parameters */
987  assert_param(IS_OB_WRP_SECTOR(WRPSector));
988  assert_param(IS_FLASH_BANK(Banks));
989 
990  if((Banks & FLASH_BANK_1) == FLASH_BANK_1)
991  {
992  /* Enable Write Protection for bank 1 */
993  FLASH->WPSN_PRG1 &= (~(WRPSector & FLASH_WPSN_WRPSN));
994  }
995 
996 #if defined (DUAL_BANK)
997  if((Banks & FLASH_BANK_2) == FLASH_BANK_2)
998  {
999  /* Enable Write Protection for bank 2 */
1000  FLASH->WPSN_PRG2 &= (~(WRPSector & FLASH_WPSN_WRPSN));
1001  }
1002 #endif /* DUAL_BANK */
1003 }
1004 
1019 static void FLASH_OB_DisableWRP(uint32_t WRPSector, uint32_t Banks)
1020 {
1021  /* Check the parameters */
1022  assert_param(IS_OB_WRP_SECTOR(WRPSector));
1023  assert_param(IS_FLASH_BANK(Banks));
1024 
1025  if((Banks & FLASH_BANK_1) == FLASH_BANK_1)
1026  {
1027  /* Disable Write Protection for bank 1 */
1028  FLASH->WPSN_PRG1 |= (WRPSector & FLASH_WPSN_WRPSN);
1029  }
1030 
1031 #if defined (DUAL_BANK)
1032  if((Banks & FLASH_BANK_2) == FLASH_BANK_2)
1033  {
1034  /* Disable Write Protection for bank 2 */
1035  FLASH->WPSN_PRG2 |= (WRPSector & FLASH_WPSN_WRPSN);
1036  }
1037 #endif /* DUAL_BANK */
1038 }
1039 
1058 static void FLASH_OB_GetWRP(uint32_t *WRPState, uint32_t *WRPSector, uint32_t Bank)
1059 {
1060  uint32_t regvalue = 0U;
1061 
1062  if(Bank == FLASH_BANK_1)
1063  {
1064  regvalue = FLASH->WPSN_CUR1;
1065  }
1066 
1067 #if defined (DUAL_BANK)
1068  if(Bank == FLASH_BANK_2)
1069  {
1070  regvalue = FLASH->WPSN_CUR2;
1071  }
1072 #endif /* DUAL_BANK */
1073 
1074  (*WRPSector) = (~regvalue) & FLASH_WPSN_WRPSN;
1075 
1076  if(*WRPSector == 0U)
1077  {
1078  (*WRPState) = OB_WRPSTATE_DISABLE;
1079  }
1080  else
1081  {
1082  (*WRPState) = OB_WRPSTATE_ENABLE;
1083  }
1084 }
1085 
1104 static void FLASH_OB_RDPConfig(uint32_t RDPLevel)
1105 {
1106  /* Check the parameters */
1107  assert_param(IS_OB_RDP_LEVEL(RDPLevel));
1108 
1109  /* Configure the RDP level in the option bytes register */
1110  MODIFY_REG(FLASH->OPTSR_PRG, FLASH_OPTSR_RDP, RDPLevel);
1111 }
1112 
1121 static uint32_t FLASH_OB_GetRDP(void)
1122 {
1123  uint32_t rdp_level = READ_BIT(FLASH->OPTSR_CUR, FLASH_OPTSR_RDP);
1124 
1125  if ((rdp_level != OB_RDP_LEVEL_0) && (rdp_level != OB_RDP_LEVEL_2))
1126  {
1127  return (OB_RDP_LEVEL_1);
1128  }
1129  else
1130  {
1131  return rdp_level;
1132  }
1133 }
1134 
1135 #if defined(DUAL_CORE)
1136 
1156 #else
1157 
1176 #endif /*DUAL_CORE*/
1177 static void FLASH_OB_UserConfig(uint32_t UserType, uint32_t UserConfig)
1178 {
1179  uint32_t optr_reg_val = 0;
1180  uint32_t optr_reg_mask = 0;
1181 
1182  /* Check the parameters */
1183  assert_param(IS_OB_USER_TYPE(UserType));
1184 
1185  if((UserType & OB_USER_IWDG1_SW) != 0U)
1186  {
1187  /* IWDG_HW option byte should be modified */
1189 
1190  /* Set value and mask for IWDG_HW option byte */
1191  optr_reg_val |= (UserConfig & FLASH_OPTSR_IWDG1_SW);
1192  optr_reg_mask |= FLASH_OPTSR_IWDG1_SW;
1193  }
1194 #if defined(DUAL_CORE)
1195  if((UserType & OB_USER_IWDG2_SW) != 0U)
1196  {
1197  /* IWDG2_SW option byte should be modified */
1198  assert_param(IS_OB_IWDG2_SOURCE(UserConfig & FLASH_OPTSR_IWDG2_SW));
1199 
1200  /* Set value and mask for IWDG2_SW option byte */
1201  optr_reg_val |= (UserConfig & FLASH_OPTSR_IWDG2_SW);
1202  optr_reg_mask |= FLASH_OPTSR_IWDG2_SW;
1203  }
1204 #endif /*DUAL_CORE*/
1205  if((UserType & OB_USER_NRST_STOP_D1) != 0U)
1206  {
1207  /* NRST_STOP option byte should be modified */
1209 
1210  /* Set value and mask for NRST_STOP option byte */
1211  optr_reg_val |= (UserConfig & FLASH_OPTSR_NRST_STOP_D1);
1212  optr_reg_mask |= FLASH_OPTSR_NRST_STOP_D1;
1213  }
1214 
1215  if((UserType & OB_USER_NRST_STDBY_D1) != 0U)
1216  {
1217  /* NRST_STDBY option byte should be modified */
1219 
1220  /* Set value and mask for NRST_STDBY option byte */
1221  optr_reg_val |= (UserConfig & FLASH_OPTSR_NRST_STBY_D1);
1222  optr_reg_mask |= FLASH_OPTSR_NRST_STBY_D1;
1223  }
1224 
1225  if((UserType & OB_USER_IWDG_STOP) != 0U)
1226  {
1227  /* IWDG_STOP option byte should be modified */
1229 
1230  /* Set value and mask for IWDG_STOP option byte */
1231  optr_reg_val |= (UserConfig & FLASH_OPTSR_FZ_IWDG_STOP);
1232  optr_reg_mask |= FLASH_OPTSR_FZ_IWDG_STOP;
1233  }
1234 
1235  if((UserType & OB_USER_IWDG_STDBY) != 0U)
1236  {
1237  /* IWDG_STDBY option byte should be modified */
1239 
1240  /* Set value and mask for IWDG_STDBY option byte */
1241  optr_reg_val |= (UserConfig & FLASH_OPTSR_FZ_IWDG_SDBY);
1242  optr_reg_mask |= FLASH_OPTSR_FZ_IWDG_SDBY;
1243  }
1244 
1245  if((UserType & OB_USER_ST_RAM_SIZE) != 0U)
1246  {
1247  /* ST_RAM_SIZE option byte should be modified */
1249 
1250  /* Set value and mask for ST_RAM_SIZE option byte */
1251  optr_reg_val |= (UserConfig & FLASH_OPTSR_ST_RAM_SIZE);
1252  optr_reg_mask |= FLASH_OPTSR_ST_RAM_SIZE;
1253  }
1254 
1255  if((UserType & OB_USER_SECURITY) != 0U)
1256  {
1257  /* SECURITY option byte should be modified */
1259 
1260  /* Set value and mask for SECURITY option byte */
1261  optr_reg_val |= (UserConfig & FLASH_OPTSR_SECURITY);
1262  optr_reg_mask |= FLASH_OPTSR_SECURITY;
1263  }
1264 
1265 #if defined(DUAL_CORE)
1266  if((UserType & OB_USER_BCM4) != 0U)
1267  {
1268  /* BCM4 option byte should be modified */
1269  assert_param(IS_OB_USER_BCM4(UserConfig & FLASH_OPTSR_BCM4));
1270 
1271  /* Set value and mask for BCM4 option byte */
1272  optr_reg_val |= (UserConfig & FLASH_OPTSR_BCM4);
1273  optr_reg_mask |= FLASH_OPTSR_BCM4;
1274  }
1275 
1276  if((UserType & OB_USER_BCM7) != 0U)
1277  {
1278  /* BCM7 option byte should be modified */
1279  assert_param(IS_OB_USER_BCM7(UserConfig & FLASH_OPTSR_BCM7));
1280 
1281  /* Set value and mask for BCM7 option byte */
1282  optr_reg_val |= (UserConfig & FLASH_OPTSR_BCM7);
1283  optr_reg_mask |= FLASH_OPTSR_BCM7;
1284  }
1285 #endif /* DUAL_CORE */
1286 
1287 #if defined (FLASH_OPTSR_NRST_STOP_D2)
1288  if((UserType & OB_USER_NRST_STOP_D2) != 0U)
1289  {
1290  /* NRST_STOP option byte should be modified */
1291  assert_param(IS_OB_STOP_D2_RESET(UserConfig & FLASH_OPTSR_NRST_STOP_D2));
1292 
1293  /* Set value and mask for NRST_STOP option byte */
1294  optr_reg_val |= (UserConfig & FLASH_OPTSR_NRST_STOP_D2);
1295  optr_reg_mask |= FLASH_OPTSR_NRST_STOP_D2;
1296  }
1297 
1298  if((UserType & OB_USER_NRST_STDBY_D2) != 0U)
1299  {
1300  /* NRST_STDBY option byte should be modified */
1301  assert_param(IS_OB_STDBY_D2_RESET(UserConfig & FLASH_OPTSR_NRST_STBY_D2));
1302 
1303  /* Set value and mask for NRST_STDBY option byte */
1304  optr_reg_val |= (UserConfig & FLASH_OPTSR_NRST_STBY_D2);
1305  optr_reg_mask |= FLASH_OPTSR_NRST_STBY_D2;
1306  }
1307 #endif /* FLASH_OPTSR_NRST_STOP_D2 */
1308 
1309 #if defined (DUAL_BANK)
1310  if((UserType & OB_USER_SWAP_BANK) != 0U)
1311  {
1312  /* SWAP_BANK_OPT option byte should be modified */
1314 
1315  /* Set value and mask for SWAP_BANK_OPT option byte */
1316  optr_reg_val |= (UserConfig & FLASH_OPTSR_SWAP_BANK_OPT);
1317  optr_reg_mask |= FLASH_OPTSR_SWAP_BANK_OPT;
1318  }
1319 #endif /* DUAL_BANK */
1320 
1321  if((UserType & OB_USER_IOHSLV) != 0U)
1322  {
1323  /* IOHSLV_OPT option byte should be modified */
1325 
1326  /* Set value and mask for IOHSLV_OPT option byte */
1327  optr_reg_val |= (UserConfig & FLASH_OPTSR_IO_HSLV);
1328  optr_reg_mask |= FLASH_OPTSR_IO_HSLV;
1329  }
1330 
1331 #if defined (FLASH_OPTSR_VDDMMC_HSLV)
1332  if((UserType & OB_USER_VDDMMC_HSLV) != 0U)
1333  {
1334  /* VDDMMC_HSLV option byte should be modified */
1335  assert_param(IS_OB_USER_VDDMMC_HSLV(UserConfig & FLASH_OPTSR_VDDMMC_HSLV));
1336 
1337  /* Set value and mask for VDDMMC_HSLV option byte */
1338  optr_reg_val |= (UserConfig & FLASH_OPTSR_VDDMMC_HSLV);
1339  optr_reg_mask |= FLASH_OPTSR_VDDMMC_HSLV;
1340  }
1341 #endif /* FLASH_OPTSR_VDDMMC_HSLV */
1342 
1343  /* Configure the option bytes register */
1344  MODIFY_REG(FLASH->OPTSR_PRG, optr_reg_mask, optr_reg_val);
1345 }
1346 
1347 #if defined(DUAL_CORE)
1348 
1356 #else
1357 
1364 #endif /*DUAL_CORE*/
1365 static uint32_t FLASH_OB_GetUser(void)
1366 {
1367  uint32_t userConfig = READ_REG(FLASH->OPTSR_CUR);
1368  userConfig &= (~(FLASH_OPTSR_BOR_LEV | FLASH_OPTSR_RDP));
1369 
1370  return userConfig;
1371 }
1372 
1399 static void FLASH_OB_PCROPConfig(uint32_t PCROPConfig, uint32_t PCROPStartAddr, uint32_t PCROPEndAddr, uint32_t Banks)
1400 {
1401  /* Check the parameters */
1402  assert_param(IS_FLASH_BANK(Banks));
1403  assert_param(IS_OB_PCROP_RDP(PCROPConfig));
1404 
1405  if((Banks & FLASH_BANK_1) == FLASH_BANK_1)
1406  {
1409 
1410  /* Configure the Proprietary code readout protection */
1411  FLASH->PRAR_PRG1 = ((PCROPStartAddr - FLASH_BANK1_BASE) >> 8) | \
1412  (((PCROPEndAddr - FLASH_BANK1_BASE) >> 8) << FLASH_PRAR_PROT_AREA_END_Pos) | \
1413  PCROPConfig;
1414  }
1415 
1416 #if defined (DUAL_BANK)
1417  if((Banks & FLASH_BANK_2) == FLASH_BANK_2)
1418  {
1419  assert_param(IS_FLASH_PROGRAM_ADDRESS_BANK2(PCROPStartAddr));
1420  assert_param(IS_FLASH_PROGRAM_ADDRESS_BANK2(PCROPEndAddr));
1421 
1422  /* Configure the Proprietary code readout protection */
1423  FLASH->PRAR_PRG2 = ((PCROPStartAddr - FLASH_BANK2_BASE) >> 8) | \
1424  (((PCROPEndAddr - FLASH_BANK2_BASE) >> 8) << FLASH_PRAR_PROT_AREA_END_Pos) | \
1425  PCROPConfig;
1426  }
1427 #endif /* DUAL_BANK */
1428 }
1429 
1448 static void FLASH_OB_GetPCROP(uint32_t *PCROPConfig, uint32_t *PCROPStartAddr, uint32_t *PCROPEndAddr, uint32_t Bank)
1449 {
1450  uint32_t regvalue = 0;
1451  uint32_t bankBase = 0;
1452 
1453  if(Bank == FLASH_BANK_1)
1454  {
1455  regvalue = FLASH->PRAR_CUR1;
1456  bankBase = FLASH_BANK1_BASE;
1457  }
1458 
1459 #if defined (DUAL_BANK)
1460  if(Bank == FLASH_BANK_2)
1461  {
1462  regvalue = FLASH->PRAR_CUR2;
1463  bankBase = FLASH_BANK2_BASE;
1464  }
1465 #endif /* DUAL_BANK */
1466 
1467  (*PCROPConfig) = (regvalue & FLASH_PRAR_DMEP);
1468 
1469  (*PCROPStartAddr) = ((regvalue & FLASH_PRAR_PROT_AREA_START) << 8) + bankBase;
1470  (*PCROPEndAddr) = (regvalue & FLASH_PRAR_PROT_AREA_END) >> FLASH_PRAR_PROT_AREA_END_Pos;
1471  (*PCROPEndAddr) = ((*PCROPEndAddr) << 8) + bankBase;
1472 }
1473 
1484 static void FLASH_OB_BOR_LevelConfig(uint32_t Level)
1485 {
1487 
1488  /* Configure BOR_LEV option byte */
1489  MODIFY_REG(FLASH->OPTSR_PRG, FLASH_OPTSR_BOR_LEV, Level);
1490 }
1491 
1501 static uint32_t FLASH_OB_GetBOR(void)
1502 {
1503  return (FLASH->OPTSR_CUR & FLASH_OPTSR_BOR_LEV);
1504 }
1505 
1516 static void FLASH_OB_BootAddConfig(uint32_t BootOption, uint32_t BootAddress0, uint32_t BootAddress1)
1517 {
1518  /* Check the parameters */
1519  assert_param(IS_OB_BOOT_ADD_OPTION(BootOption));
1520 
1521  if((BootOption & OB_BOOT_ADD0) == OB_BOOT_ADD0)
1522  {
1523  /* Check the parameters */
1524  assert_param(IS_BOOT_ADDRESS(BootAddress0));
1525 
1526  /* Configure CM7 BOOT ADD0 */
1527 #if defined(DUAL_CORE)
1528  MODIFY_REG(FLASH->BOOT7_PRG, FLASH_BOOT7_BCM7_ADD0, (BootAddress0 >> 16));
1529 #else /* Single Core*/
1530  MODIFY_REG(FLASH->BOOT_PRG, FLASH_BOOT_ADD0, (BootAddress0 >> 16));
1531 #endif /* DUAL_CORE */
1532  }
1533 
1534  if((BootOption & OB_BOOT_ADD1) == OB_BOOT_ADD1)
1535  {
1536  /* Check the parameters */
1537  assert_param(IS_BOOT_ADDRESS(BootAddress1));
1538 
1539  /* Configure CM7 BOOT ADD1 */
1540 #if defined(DUAL_CORE)
1541  MODIFY_REG(FLASH->BOOT7_PRG, FLASH_BOOT7_BCM7_ADD1, BootAddress1);
1542 #else /* Single Core*/
1543  MODIFY_REG(FLASH->BOOT_PRG, FLASH_BOOT_ADD1, BootAddress1);
1544 #endif /* DUAL_CORE */
1545  }
1546 }
1547 
1554 static void FLASH_OB_GetBootAdd(uint32_t *BootAddress0, uint32_t *BootAddress1)
1555 {
1556  uint32_t regvalue;
1557 
1558 #if defined(DUAL_CORE)
1559  regvalue = FLASH->BOOT7_CUR;
1560 
1561  (*BootAddress0) = (regvalue & FLASH_BOOT7_BCM7_ADD0) << 16;
1562  (*BootAddress1) = (regvalue & FLASH_BOOT7_BCM7_ADD1);
1563 #else /* Single Core */
1564  regvalue = FLASH->BOOT_CUR;
1565 
1566  (*BootAddress0) = (regvalue & FLASH_BOOT_ADD0) << 16;
1567  (*BootAddress1) = (regvalue & FLASH_BOOT_ADD1);
1568 #endif /* DUAL_CORE */
1569 }
1570 
1571 #if defined(DUAL_CORE)
1572 
1582 static void FLASH_OB_CM4BootAddConfig(uint32_t BootOption, uint32_t BootAddress0, uint32_t BootAddress1)
1583 {
1584  /* Check the parameters */
1585  assert_param(IS_OB_BOOT_ADD_OPTION(BootOption));
1586 
1587  if((BootOption & OB_BOOT_ADD0) == OB_BOOT_ADD0)
1588  {
1589  /* Check the parameters */
1590  assert_param(IS_BOOT_ADDRESS(BootAddress0));
1591 
1592  /* Configure CM4 BOOT ADD0 */
1593  MODIFY_REG(FLASH->BOOT4_PRG, FLASH_BOOT4_BCM4_ADD0, (BootAddress0 >> 16));
1594 
1595  }
1596 
1597  if((BootOption & OB_BOOT_ADD1) == OB_BOOT_ADD1)
1598  {
1599  /* Check the parameters */
1600  assert_param(IS_BOOT_ADDRESS(BootAddress1));
1601 
1602  /* Configure CM4 BOOT ADD1 */
1603  MODIFY_REG(FLASH->BOOT4_PRG, FLASH_BOOT4_BCM4_ADD1, BootAddress1);
1604  }
1605 }
1606 
1613 static void FLASH_OB_GetCM4BootAdd(uint32_t *BootAddress0, uint32_t *BootAddress1)
1614 {
1615  uint32_t regvalue;
1616 
1617  regvalue = FLASH->BOOT4_CUR;
1618 
1619  (*BootAddress0) = (regvalue & FLASH_BOOT4_BCM4_ADD0) << 16;
1620  (*BootAddress1) = (regvalue & FLASH_BOOT4_BCM4_ADD1);
1621 }
1622 #endif /*DUAL_CORE*/
1623 
1638 static void FLASH_OB_SecureAreaConfig(uint32_t SecureAreaConfig, uint32_t SecureAreaStartAddr, uint32_t SecureAreaEndAddr, uint32_t Banks)
1639 {
1640  /* Check the parameters */
1641  assert_param(IS_FLASH_BANK(Banks));
1642  assert_param(IS_OB_SECURE_RDP(SecureAreaConfig));
1643 
1644  if((Banks & FLASH_BANK_1) == FLASH_BANK_1)
1645  {
1646  /* Check the parameters */
1647  assert_param(IS_FLASH_PROGRAM_ADDRESS_BANK1(SecureAreaStartAddr));
1648  assert_param(IS_FLASH_PROGRAM_ADDRESS_BANK1(SecureAreaEndAddr));
1649 
1650  /* Configure the secure area */
1651  FLASH->SCAR_PRG1 = ((SecureAreaStartAddr - FLASH_BANK1_BASE) >> 8) | \
1652  (((SecureAreaEndAddr - FLASH_BANK1_BASE) >> 8) << FLASH_SCAR_SEC_AREA_END_Pos) | \
1653  (SecureAreaConfig & FLASH_SCAR_DMES);
1654  }
1655 
1656 #if defined (DUAL_BANK)
1657  if((Banks & FLASH_BANK_2) == FLASH_BANK_2)
1658  {
1659  /* Check the parameters */
1660  assert_param(IS_FLASH_PROGRAM_ADDRESS_BANK2(SecureAreaStartAddr));
1661  assert_param(IS_FLASH_PROGRAM_ADDRESS_BANK2(SecureAreaEndAddr));
1662 
1663  /* Configure the secure area */
1664  FLASH->SCAR_PRG2 = ((SecureAreaStartAddr - FLASH_BANK2_BASE) >> 8) | \
1665  (((SecureAreaEndAddr - FLASH_BANK2_BASE) >> 8) << FLASH_SCAR_SEC_AREA_END_Pos) | \
1666  (SecureAreaConfig & FLASH_SCAR_DMES);
1667  }
1668 #endif /* DUAL_BANK */
1669 }
1670 
1680 static void FLASH_OB_GetSecureArea(uint32_t *SecureAreaConfig, uint32_t *SecureAreaStartAddr, uint32_t *SecureAreaEndAddr, uint32_t Bank)
1681 {
1682  uint32_t regvalue = 0;
1683  uint32_t bankBase = 0;
1684 
1685  /* Check Bank parameter value */
1686  if(Bank == FLASH_BANK_1)
1687  {
1688  regvalue = FLASH->SCAR_CUR1;
1689  bankBase = FLASH_BANK1_BASE;
1690  }
1691 
1692 #if defined (DUAL_BANK)
1693  if(Bank == FLASH_BANK_2)
1694  {
1695  regvalue = FLASH->SCAR_CUR2;
1696  bankBase = FLASH_BANK2_BASE;
1697  }
1698 #endif /* DUAL_BANK */
1699 
1700  /* Get the secure area settings */
1701  (*SecureAreaConfig) = (regvalue & FLASH_SCAR_DMES);
1702  (*SecureAreaStartAddr) = ((regvalue & FLASH_SCAR_SEC_AREA_START) << 8) + bankBase;
1703  (*SecureAreaEndAddr) = (regvalue & FLASH_SCAR_SEC_AREA_END) >> FLASH_SCAR_SEC_AREA_END_Pos;
1704  (*SecureAreaEndAddr) = ((*SecureAreaEndAddr) << 8) + bankBase;
1705 }
1706 
1713 static void FLASH_CRC_AddSector(uint32_t Sector, uint32_t Bank)
1714 {
1715  /* Check the parameters */
1716  assert_param(IS_FLASH_SECTOR(Sector));
1717 
1718  if (Bank == FLASH_BANK_1)
1719  {
1720  /* Clear CRC sector */
1721  FLASH->CRCCR1 &= (~FLASH_CRCCR_CRC_SECT);
1722 
1723  /* Select CRC Sector and activate ADD_SECT bit */
1724  FLASH->CRCCR1 |= Sector | FLASH_CRCCR_ADD_SECT;
1725  }
1726 #if defined (DUAL_BANK)
1727  else
1728  {
1729  /* Clear CRC sector */
1730  FLASH->CRCCR2 &= (~FLASH_CRCCR_CRC_SECT);
1731 
1732  /* Select CRC Sector and activate ADD_SECT bit */
1733  FLASH->CRCCR2 |= Sector | FLASH_CRCCR_ADD_SECT;
1734  }
1735 #endif /* DUAL_BANK */
1736 }
1737 
1745 static void FLASH_CRC_SelectAddress(uint32_t CRCStartAddr, uint32_t CRCEndAddr, uint32_t Bank)
1746 {
1747  if (Bank == FLASH_BANK_1)
1748  {
1751 
1752  /* Write CRC Start and End addresses */
1753  FLASH->CRCSADD1 = CRCStartAddr;
1754  FLASH->CRCEADD1 = CRCEndAddr;
1755  }
1756 #if defined (DUAL_BANK)
1757  else
1758  {
1759  assert_param(IS_FLASH_PROGRAM_ADDRESS_BANK2(CRCStartAddr));
1760  assert_param(IS_FLASH_PROGRAM_ADDRESS_BANK2(CRCEndAddr));
1761 
1762  /* Write CRC Start and End addresses */
1763  FLASH->CRCSADD2 = CRCStartAddr;
1764  FLASH->CRCEADD2 = CRCEndAddr;
1765  }
1766 #endif /* DUAL_BANK */
1767 }
1772 #if defined (FLASH_OTPBL_LOCKBL)
1773 
1779 static void FLASH_OB_OTP_LockConfig(uint32_t OTP_Block)
1780 {
1781  /* Check the parameters */
1782  assert_param(IS_OTP_BLOCK(OTP_Block));
1783 
1784  /* Configure the OTP Block lock in the option bytes register */
1785  FLASH->OTPBL_PRG |= (OTP_Block & FLASH_OTPBL_LOCKBL);
1786 }
1787 
1793 static uint32_t FLASH_OB_OTP_GetLock(void)
1794 {
1795  return (FLASH->OTPBL_CUR);
1796 }
1797 #endif /* FLASH_OTPBL_LOCKBL */
1798 
1799 #if defined (FLASH_OPTSR2_TCM_AXI_SHARED)
1800 
1806 static void FLASH_OB_SharedRAM_Config(uint32_t SharedRamConfig)
1807 {
1808  /* Check the parameters */
1809  assert_param(IS_OB_USER_TCM_AXI_SHARED(SharedRamConfig));
1810 
1811  /* Configure the TCM / AXI Shared RAM in the option bytes register */
1812  MODIFY_REG(FLASH->OPTSR2_PRG, FLASH_OPTSR2_TCM_AXI_SHARED, SharedRamConfig);
1813 }
1814 
1820 static uint32_t FLASH_OB_SharedRAM_GetConfig(void)
1821 {
1822  return (FLASH->OPTSR2_CUR & FLASH_OPTSR2_TCM_AXI_SHARED);;
1823 }
1824 #endif /* FLASH_OPTSR2_TCM_AXI_SHARED */
1825 
1826 #if defined (FLASH_OPTSR2_CPUFREQ_BOOST)
1827 
1833 static void FLASH_OB_CPUFreq_BoostConfig(uint32_t FreqBoost)
1834 {
1835  /* Check the parameters */
1836  assert_param(IS_OB_USER_CPUFREQ_BOOST(FreqBoost));
1837 
1838  /* Configure the CPU Frequency Boost in the option bytes register */
1839  MODIFY_REG(FLASH->OPTSR2_PRG, FLASH_OPTSR2_CPUFREQ_BOOST, FreqBoost);
1840 }
1841 
1847 static uint32_t FLASH_OB_CPUFreq_GetBoost(void)
1848 {
1849  return (FLASH->OPTSR2_CUR & FLASH_OPTSR2_CPUFREQ_BOOST);;
1850 }
1851 #endif /* FLASH_OPTSR2_CPUFREQ_BOOST */
1852 
1853 #endif /* HAL_FLASH_MODULE_ENABLED */
1854 
1863 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
assert_param
#define assert_param(expr)
Include module's header file.
Definition: stm32f407/stm32f407g-disc1/Inc/stm32f4xx_hal_conf.h:353
FLASH_EraseInitTypeDef::VoltageRange
uint32_t VoltageRange
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h:61
FLASH_OPTSR2_CPUFREQ_BOOST
#define FLASH_OPTSR2_CPUFREQ_BOOST
Definition: stm32h735xx.h:11399
FLASH_OPTSR_NRST_STOP_D2
#define FLASH_OPTSR_NRST_STOP_D2
Definition: stm32h735xx.h:11291
FLASH_IT_EOP_BANK1
#define FLASH_IT_EOP_BANK1
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:257
FLASH_OBProgramInitTypeDef::SecureAreaConfig
uint32_t SecureAreaConfig
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:126
FLASH_BANK2_BASE
#define FLASH_BANK2_BASE
Definition: stm32h747xx.h:2142
IS_OB_USER_TYPE
#define IS_OB_USER_TYPE(TYPE)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:966
IS_OB_PCROP_RDP
#define IS_OB_PCROP_RDP(CONFIG)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:912
HAL_StatusTypeDef
HAL_StatusTypeDef
HAL Status structures definition
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:40
FLASH_FLAG_CRCEND_BANK2
#define FLASH_FLAG_CRCEND_BANK2
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:228
IS_FLASH_TYPECRC
#define IS_FLASH_TYPECRC(VALUE)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:973
FLASH_OPTSR_IO_HSLV
#define FLASH_OPTSR_IO_HSLV
Definition: stm32h735xx.h:11297
OB_WRPSTATE_DISABLE
#define OB_WRPSTATE_DISABLE
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h:166
FLASH_CR_SER
#define FLASH_CR_SER
Definition: stm32f407xx.h:6739
FLASH_OPTSR_SECURITY
#define FLASH_OPTSR_SECURITY
Definition: stm32h735xx.h:11288
IS_VOLTAGERANGE
#define IS_VOLTAGERANGE(RANGE)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h:816
FLASH_CR_PSIZE
#define FLASH_CR_PSIZE
Definition: stm32f407xx.h:6753
OB_USER_NRST_STOP_D1
#define OB_USER_NRST_STOP_D1
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:608
FLASH_EraseInitTypeDef::Banks
uint32_t Banks
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h:52
FLASH_OPTSR_RDP
#define FLASH_OPTSR_RDP
Definition: stm32h735xx.h:11274
IS_OB_IWDG1_SOURCE
#define IS_OB_IWDG1_SOURCE(SOURCE)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:928
FLASH_OBProgramInitTypeDef::SecureAreaEndAddr
uint32_t SecureAreaEndAddr
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:133
FLASH_BANK_1
#define FLASH_BANK_1
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:377
FLASH_IT_PGSERR_BANK1
#define FLASH_IT_PGSERR_BANK1
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:259
FLASH_CR_SNB
#define FLASH_CR_SNB
Definition: stm32f407xx.h:6745
OB_BOOT_ADD0
#define OB_BOOT_ADD0
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:672
FLASH_CRCInitTypeDef::BurstSize
uint32_t BurstSize
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:161
FLASH_OPTSR_SWAP_BANK_OPT
#define FLASH_OPTSR_SWAP_BANK_OPT
Definition: stm32h747xx.h:14082
FLASH_OBProgramInitTypeDef::BootConfig
uint32_t BootConfig
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:106
FLASH_CRC_BANK
#define FLASH_CRC_BANK
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:695
IS_OB_USER_SECURITY
#define IS_OB_USER_SECURITY(VALUE)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:943
FLASH_Erase_Sector
void FLASH_Erase_Sector(uint32_t Sector, uint8_t VoltageRange)
OPTIONBYTE_WRP
#define OPTIONBYTE_WRP
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h:175
IS_OB_STOP_D1_RESET
#define IS_OB_STOP_D1_RESET(VALUE)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:932
FLASH_PRAR_PROT_AREA_END_Pos
#define FLASH_PRAR_PROT_AREA_END_Pos
Definition: stm32h735xx.h:11311
OPTIONBYTE_USER
#define OPTIONBYTE_USER
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h:177
FLASH_OBProgramInitTypeDef::OptionType
uint32_t OptionType
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h:71
IS_OB_BOOT_ADD_OPTION
#define IS_OB_BOOT_ADD_OPTION(VALUE)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:969
FLASH_OPTSR_IWDG2_SW
#define FLASH_OPTSR_IWDG2_SW
Definition: stm32h747xx.h:14038
FLASH_CR_START
#define FLASH_CR_START
Definition: stm32h735xx.h:11108
FLASH_PROC_MASSERASE_BANK1
@ FLASH_PROC_MASSERASE_BANK1
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:51
FLASH_SCAR_DMES
#define FLASH_SCAR_DMES
Definition: stm32h735xx.h:11327
FLASH_CRCInitTypeDef
FLASH Erase structure definition.
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:156
FLASH_PROC_SECTERASE_BANK2
@ FLASH_PROC_SECTERASE_BANK2
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:53
FLASH_OBProgramInitTypeDef::RDPLevel
uint32_t RDPLevel
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h:83
FLASH_IT_WRPERR_BANK1
#define FLASH_IT_WRPERR_BANK1
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:258
HAL_ERROR
@ HAL_ERROR
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:43
FLASH_CRCInitTypeDef::Sector
uint32_t Sector
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:167
OB_WRPSTATE_ENABLE
#define OB_WRPSTATE_ENABLE
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h:167
FLASH_OBProgramInitTypeDef
FLASH Option Bytes Program structure definition.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h:69
FLASH_ProcessTypeDef::VoltageForErase
__IO uint8_t VoltageForErase
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h:64
OB_USER_IWDG_STOP
#define OB_USER_IWDG_STOP
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:610
FLASH_OBProgramInitTypeDef::USERConfig
uint8_t USERConfig
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h:89
FLASH_OBProgramInitTypeDef::SecureAreaStartAddr
uint32_t SecureAreaStartAddr
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:130
FLASH_ProcessTypeDef::Sector
__IO uint32_t Sector
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h:66
OPTIONBYTE_BOR
#define OPTIONBYTE_BOR
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h:178
HAL_FLASHEx_Lock_Bank1
HAL_StatusTypeDef HAL_FLASHEx_Lock_Bank1(void)
FLASH_EraseInitTypeDef::Sector
uint32_t Sector
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h:55
__HAL_FLASH_CLEAR_FLAG_BANK2
#define __HAL_FLASH_CLEAR_FLAG_BANK2(__FLAG__)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:695
FLASH_CRCInitTypeDef::CRCEndAddr
uint32_t CRCEndAddr
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:176
FLASH_OBProgramInitTypeDef::BORLevel
uint32_t BORLevel
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h:86
FLASH_FLAG_CRCEND_BANK1
#define FLASH_FLAG_CRCEND_BANK1
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:190
FLASH_OPTSR2_TCM_AXI_SHARED
#define FLASH_OPTSR2_TCM_AXI_SHARED
Definition: stm32h735xx.h:11394
FLASH_OPTSR_BOR_LEV
#define FLASH_OPTSR_BOR_LEV
Definition: stm32h735xx.h:11260
pFlash
FLASH_ProcessTypeDef pFlash
HAL_OK
@ HAL_OK
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:42
IS_OB_BOR_LEVEL
#define IS_OB_BOR_LEVEL(LEVEL)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h:836
OPTIONBYTE_SECURE_AREA
#define OPTIONBYTE_SECURE_AREA
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:229
IS_FLASH_BANK_EXCLUSIVE
#define IS_FLASH_BANK_EXCLUSIVE(BANK)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:833
HAL_FLASHEx_Unlock_Bank1
HAL_StatusTypeDef HAL_FLASHEx_Unlock_Bank1(void)
HAL_FLASHEx_Erase
HAL_StatusTypeDef HAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit, uint32_t *SectorError)
FLASH_CRCCR_ALL_BANK
#define FLASH_CRCCR_ALL_BANK
Definition: stm32h735xx.h:11369
FLASH_SCAR_SEC_AREA_START
#define FLASH_SCAR_SEC_AREA_START
Definition: stm32h735xx.h:11321
FLASH_KEY2
#define FLASH_KEY2
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h:157
FLASH_ProcessTypeDef::ProcedureOnGoing
__IO FLASH_ProcedureTypeDef ProcedureOnGoing
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h:60
FLASH_CCR_CLR_CRCEND
#define FLASH_CCR_CLR_CRCEND
Definition: stm32h735xx.h:11238
UNUSED
#define UNUSED(x)
Definition: porcupine/demo/c/dr_libs/old/dr.h:92
HAL_FLASHEx_OBProgram
HAL_StatusTypeDef HAL_FLASHEx_OBProgram(FLASH_OBProgramInitTypeDef *pOBInit)
FLASH_CR_LOCK
#define FLASH_CR_LOCK
Definition: stm32f407xx.h:6764
OPTIONBYTE_PCROP
#define OPTIONBYTE_PCROP
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:227
HAL_FLASHEx_ComputeCRC
HAL_StatusTypeDef HAL_FLASHEx_ComputeCRC(FLASH_CRCInitTypeDef *pCRCInit, uint32_t *CRC_Result)
IS_OB_USER_ST_RAM_SIZE
#define IS_OB_USER_ST_RAM_SIZE(VALUE)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:940
FLASH_FLAG_CRCRDERR_BANK2
#define FLASH_FLAG_CRCRDERR_BANK2
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:229
FLASH_OBProgramInitTypeDef::WRPSector
uint32_t WRPSector
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h:77
IS_OB_RDP_LEVEL
#define IS_OB_RDP_LEVEL(LEVEL)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h:826
FLASH_BOOT4_BCM4_ADD1
#define FLASH_BOOT4_BCM4_ADD1
Definition: stm32h747xx.h:14130
__HAL_LOCK
#define __HAL_LOCK(__HANDLE__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:93
FLASH_CR_CRC_EN
#define FLASH_CR_CRC_EN
Definition: stm32h735xx.h:11117
IS_OB_USER_IWDG_STDBY
#define IS_OB_USER_IWDG_STDBY(VALUE)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:938
FLASH_WPSN_WRPSN
#define FLASH_WPSN_WRPSN
Definition: stm32h735xx.h:11332
FLASH_OBProgramInitTypeDef::BootAddr1
uint32_t BootAddr1
Definition: stm32f7xx_hal_flash_ex.h:95
FLASH_PROC_SECTERASE_BANK1
@ FLASH_PROC_SECTERASE_BANK1
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:50
MODIFY_REG
#define MODIFY_REG(REG, CLEARMASK, SETMASK)
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:224
FLASH_CRCInitTypeDef::NbSectors
uint32_t NbSectors
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:170
__HAL_FLASH_CLEAR_FLAG_BANK1
#define __HAL_FLASH_CLEAR_FLAG_BANK1(__FLAG__)
Clear the specified FLASH flag.
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:693
FLASH_PROC_MASSERASE_BANK2
@ FLASH_PROC_MASSERASE_BANK2
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:54
FLASH_CRCCR_CLEAN_CRC
#define FLASH_CRCCR_CLEAN_CRC
Definition: stm32h735xx.h:11361
IS_OB_WRP_SECTOR
#define IS_OB_WRP_SECTOR(SECTOR)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:909
FLASH_OBProgramInitTypeDef::PCROPConfig
uint32_t PCROPConfig
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:96
FLASH_OBProgramInitTypeDef::USERType
uint32_t USERType
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:87
FLASH_SCAR_SEC_AREA_END_Pos
#define FLASH_SCAR_SEC_AREA_END_Pos
Definition: stm32h735xx.h:11322
FLASH_KEY1
#define FLASH_KEY1
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h:156
OB_USER_IWDG_STDBY
#define OB_USER_IWDG_STDBY
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:611
IS_FLASH_BANK
#define IS_FLASH_BANK(BANK)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:832
FLASH_IT_INCERR_BANK1
#define FLASH_IT_INCERR_BANK1
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:261
FLASH_CRCCR_START_CRC
#define FLASH_CRCCR_START_CRC
Definition: stm32h735xx.h:11358
__HAL_UNLOCK
#define __HAL_UNLOCK(__HANDLE__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:105
OB_USER_ST_RAM_SIZE
#define OB_USER_ST_RAM_SIZE
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:612
READ_BIT
#define READ_BIT(REG, BIT)
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:216
HAL_FLASHEx_OBGetConfig
void HAL_FLASHEx_OBGetConfig(FLASH_OBProgramInitTypeDef *pOBInit)
FLASH_FLAG_CRCRDERR_BANK1
#define FLASH_FLAG_CRCRDERR_BANK1
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:191
FLASH_OPTCR_MER
#define FLASH_OPTCR_MER
Definition: stm32h747xx.h:14016
IS_OB_USER_IWDG_STOP
#define IS_OB_USER_IWDG_STOP(VALUE)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:936
FLASH_WaitForLastOperation
HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout)
FLASH_BOOT7_BCM7_ADD0
#define FLASH_BOOT7_BCM7_ADD0
Definition: stm32h747xx.h:14119
__HAL_FLASH_ENABLE_IT_BANK1
#define __HAL_FLASH_ENABLE_IT_BANK1(__INTERRUPT__)
Enable the specified FLASH interrupt.
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:543
FLASH_OPTSR_FZ_IWDG_SDBY
#define FLASH_OPTSR_FZ_IWDG_SDBY
Definition: stm32h735xx.h:11280
Level
Level
FLASH_OPTSR_FZ_IWDG_STOP
#define FLASH_OPTSR_FZ_IWDG_STOP
Definition: stm32h735xx.h:11277
FLASH_CRC_WaitForLastOperation
HAL_StatusTypeDef FLASH_CRC_WaitForLastOperation(uint32_t Timeout, uint32_t Bank)
FLASH_CRCCR_CLEAN_SECT
#define FLASH_CRCCR_CLEAN_SECT
Definition: stm32h735xx.h:11355
FLASH_PRAR_PROT_AREA_END
#define FLASH_PRAR_PROT_AREA_END
Definition: stm32h735xx.h:11313
FLASH_OBProgramInitTypeDef::Banks
uint32_t Banks
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h:80
FLASH_CRC_SECTORS
#define FLASH_CRC_SECTORS
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:694
OPTIONBYTE_RDP
#define OPTIONBYTE_RDP
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h:176
FLASH_TYPEERASE_MASSERASE
#define FLASH_TYPEERASE_MASSERASE
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h:147
FLASH_IT_INCERR_BANK2
#define FLASH_IT_INCERR_BANK2
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:292
FLASH_CR_SNB_Pos
#define FLASH_CR_SNB_Pos
Definition: stm32f407xx.h:6743
OPTIONBYTE_BOOTADD
#define OPTIONBYTE_BOOTADD
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:235
FLASH_IT_STRBERR_BANK2
#define FLASH_IT_STRBERR_BANK2
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:291
FLASH_BOOT_ADD0
#define FLASH_BOOT_ADD0
Definition: stm32h735xx.h:11337
OB_USER_SECURITY
#define OB_USER_SECURITY
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:613
IS_OB_USER_SWAP_BANK
#define IS_OB_USER_SWAP_BANK(VALUE)
Definition: stm32h747/stm32h747i-disco/CM7/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:915
IS_OB_SECURE_RDP
#define IS_OB_SECURE_RDP(CONFIG)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:915
FLASH_BOOT_ADD1
#define FLASH_BOOT_ADD1
Definition: stm32h735xx.h:11340
FLASH_BANK1_BASE
#define FLASH_BANK1_BASE
Definition: stm32h735xx.h:2182
IS_BOOT_ADDRESS
#define IS_BOOT_ADDRESS(ADDRESS)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:823
FLASH_OPTSR_IWDG1_SW
#define FLASH_OPTSR_IWDG1_SW
Definition: stm32h735xx.h:11265
FLASH_CRCCR_CRC_SECT
#define FLASH_CRCCR_CRC_SECT
Definition: stm32h735xx.h:11346
FLASH_PRAR_PROT_AREA_START
#define FLASH_PRAR_PROT_AREA_START
Definition: stm32h735xx.h:11310
FLASH_CRCInitTypeDef::CRCStartAddr
uint32_t CRCStartAddr
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:173
OB_USER_IWDG1_SW
#define OB_USER_IWDG1_SW
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:607
FLASH_OBProgramInitTypeDef::WRPState
uint32_t WRPState
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h:74
FLASH_OPTSR_ST_RAM_SIZE
#define FLASH_OPTSR_ST_RAM_SIZE
Definition: stm32h735xx.h:11283
__HAL_FLASH_ENABLE_IT_BANK2
#define __HAL_FLASH_ENABLE_IT_BANK2(__INTERRUPT__)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:545
IS_FLASH_TYPEERASE
#define IS_FLASH_TYPEERASE(VALUE)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h:813
OB_RDP_LEVEL_1
#define OB_RDP_LEVEL_1
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h:187
FLASH
#define FLASH
Definition: stm32f407xx.h:1114
HAL_FLASH_ERROR_NONE
#define HAL_FLASH_ERROR_NONE
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h:90
FLASH_IT_WRPERR_BANK2
#define FLASH_IT_WRPERR_BANK2
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:289
FLASH_PRAR_DMEP
#define FLASH_PRAR_DMEP
Definition: stm32h735xx.h:11316
FLASH_OPTSR_NRST_STOP_D1
#define FLASH_OPTSR_NRST_STOP_D1
Definition: stm32h735xx.h:11268
HAL_FLASHEx_Erase_IT
HAL_StatusTypeDef HAL_FLASHEx_Erase_IT(FLASH_EraseInitTypeDef *pEraseInit)
FLASH_IT_STRBERR_BANK1
#define FLASH_IT_STRBERR_BANK1
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:260
FLASH_BOOT7_BCM7_ADD1
#define FLASH_BOOT7_BCM7_ADD1
Definition: stm32h747xx.h:14122
FLASH_SCAR_SEC_AREA_END
#define FLASH_SCAR_SEC_AREA_END
Definition: stm32h735xx.h:11324
IS_OB_STDBY_D1_RESET
#define IS_OB_STDBY_D1_RESET(VALUE)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:934
WRITE_REG
#define WRITE_REG(REG, VAL)
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:220
FLASH_EraseInitTypeDef::NbSectors
uint32_t NbSectors
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h:58
FLASH_BOOT4_BCM4_ADD0
#define FLASH_BOOT4_BCM4_ADD0
Definition: stm32h747xx.h:14127
FLASH_CR_BER
#define FLASH_CR_BER
Definition: stm32h735xx.h:11097
READ_REG
#define READ_REG(REG)
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:222
FLASH_OBProgramInitTypeDef::PCROPStartAddr
uint32_t PCROPStartAddr
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:100
FLASH_OPTSR_BCM7
#define FLASH_OPTSR_BCM7
Definition: stm32h747xx.h:14067
SET_BIT
#define SET_BIT(REG, BIT)
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:212
FLASH_CRCInitTypeDef::TypeCRC
uint32_t TypeCRC
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:158
IS_FLASH_PROGRAM_ADDRESS_BANK1
#define IS_FLASH_PROGRAM_ADDRESS_BANK1(ADDRESS)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:800
FLASH_IT_PGSERR_BANK2
#define FLASH_IT_PGSERR_BANK2
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:290
OB_RDP_LEVEL_0
#define OB_RDP_LEVEL_0
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h:186
FLASH_OBProgramInitTypeDef::BootAddr0
uint32_t BootAddr0
Definition: stm32f7xx_hal_flash_ex.h:92
FLASH_IT_EOP_BANK2
#define FLASH_IT_EOP_BANK2
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:288
FLASH_ProcessTypeDef::ErrorCode
__IO uint32_t ErrorCode
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h:74
IS_OB_USER_IOHSLV
#define IS_OB_USER_IOHSLV(VALUE)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:922
FLASH_OPTSR_BCM4
#define FLASH_OPTSR_BCM4
Definition: stm32h747xx.h:14064
OB_USER_IOHSLV
#define OB_USER_IOHSLV
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:614
FLASH_OBProgramInitTypeDef::PCROPEndAddr
uint32_t PCROPEndAddr
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:103
FLASH_CRCInitTypeDef::Bank
uint32_t Bank
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:164
FLASH_PROC_ALLBANK_MASSERASE
@ FLASH_PROC_ALLBANK_MASSERASE
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:56
OB_RDP_LEVEL_2
#define OB_RDP_LEVEL_2
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h:188
FLASH_CRCCR_ADD_SECT
#define FLASH_CRCCR_ADD_SECT
Definition: stm32h735xx.h:11352
IS_FLASH_SECTOR
#define IS_FLASH_SECTOR(SECTOR)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:904
FLASH_OB_WaitForLastOperation
HAL_StatusTypeDef FLASH_OB_WaitForLastOperation(uint32_t Timeout)
FLASH_OPTSR_NRST_STBY_D1
#define FLASH_OPTSR_NRST_STBY_D1
Definition: stm32h735xx.h:11271
FLASH_ProcessTypeDef::NbSectorsToErase
__IO uint32_t NbSectorsToErase
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h:62
OB_USER_NRST_STDBY_D1
#define OB_USER_NRST_STDBY_D1
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:609
FLASH_OPTSR_NRST_STBY_D2
#define FLASH_OPTSR_NRST_STBY_D2
Definition: stm32h735xx.h:11294
FLASH_EraseInitTypeDef
FLASH Erase structure definition.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h:47
FLASH_CCR_CLR_CRCRDERR
#define FLASH_CCR_CLR_CRCRDERR
Definition: stm32h735xx.h:11241
IS_OPTIONBYTE
#define IS_OPTIONBYTE(VALUE)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h:824
IS_WRPSTATE
#define IS_WRPSTATE(VALUE)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h:821
FLASH_EraseInitTypeDef::TypeErase
uint32_t TypeErase
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h:49
OB_BOOT_ADD1
#define OB_BOOT_ADD1
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash_ex.h:673


picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:14:54