stm32h7xx_hal_flash.c
Go to the documentation of this file.
1 
88 /* Includes ------------------------------------------------------------------*/
89 #include "stm32h7xx_hal.h"
90 
100 #ifdef HAL_FLASH_MODULE_ENABLED
101 
102 /* Private typedef -----------------------------------------------------------*/
103 /* Private define ------------------------------------------------------------*/
107 #define FLASH_TIMEOUT_VALUE 50000U /* 50 s */
108 
111 /* Private macro -------------------------------------------------------------*/
112 /* Private variables ---------------------------------------------------------*/
114 /* Private function prototypes -----------------------------------------------*/
115 /* Exported functions ---------------------------------------------------------*/
116 
150 HAL_StatusTypeDef HAL_FLASH_Program(uint32_t TypeProgram, uint32_t FlashAddress, uint32_t DataAddress)
151 {
152  HAL_StatusTypeDef status;
153  __IO uint32_t *dest_addr = (__IO uint32_t *)FlashAddress;
154  __IO uint32_t *src_addr = (__IO uint32_t*)DataAddress;
155  uint32_t bank;
156  uint8_t row_index = FLASH_NB_32BITWORD_IN_FLASHWORD;
157 
158  /* Check the parameters */
159  assert_param(IS_FLASH_TYPEPROGRAM(TypeProgram));
160  assert_param(IS_FLASH_PROGRAM_ADDRESS(FlashAddress));
161 
162  /* Process Locked */
163  __HAL_LOCK(&pFlash);
164 
165 #if defined (FLASH_OPTCR_PG_OTP)
166  if((IS_FLASH_PROGRAM_ADDRESS_BANK1(FlashAddress)) || (IS_FLASH_PROGRAM_ADDRESS_OTP(FlashAddress)))
167 #else
168  if(IS_FLASH_PROGRAM_ADDRESS_BANK1(FlashAddress))
169 #endif /* FLASH_OPTCR_PG_OTP */
170  {
171  bank = FLASH_BANK_1;
172  }
173 #if defined (DUAL_BANK)
174  else if(IS_FLASH_PROGRAM_ADDRESS_BANK2(FlashAddress))
175  {
176  bank = FLASH_BANK_2;
177  }
178 #endif /* DUAL_BANK */
179  else
180  {
181  return HAL_ERROR;
182  }
183 
184  /* Reset error code */
186 
187  /* Wait for last operation to be completed */
188  status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE, bank);
189 
190  if(status == HAL_OK)
191  {
192 #if defined (DUAL_BANK)
193  if(bank == FLASH_BANK_1)
194  {
195 #if defined (FLASH_OPTCR_PG_OTP)
196  if (TypeProgram == FLASH_TYPEPROGRAM_OTPWORD)
197  {
198  /* Set OTP_PG bit */
199  SET_BIT(FLASH->OPTCR, FLASH_OPTCR_PG_OTP);
200  }
201  else
202 #endif /* FLASH_OPTCR_PG_OTP */
203  {
204  /* Set PG bit */
205  SET_BIT(FLASH->CR1, FLASH_CR_PG);
206  }
207  }
208  else
209  {
210  /* Set PG bit */
211  SET_BIT(FLASH->CR2, FLASH_CR_PG);
212  }
213 #else /* Single Bank */
214 #if defined (FLASH_OPTCR_PG_OTP)
215  if (TypeProgram == FLASH_TYPEPROGRAM_OTPWORD)
216  {
217  /* Set OTP_PG bit */
218  SET_BIT(FLASH->OPTCR, FLASH_OPTCR_PG_OTP);
219  }
220  else
221 #endif /* FLASH_OPTCR_PG_OTP */
222  {
223  /* Set PG bit */
224  SET_BIT(FLASH->CR1, FLASH_CR_PG);
225  }
226 #endif /* DUAL_BANK */
227 
228  __ISB();
229  __DSB();
230 
231 #if defined (FLASH_OPTCR_PG_OTP)
232  if (TypeProgram == FLASH_TYPEPROGRAM_OTPWORD)
233  {
234  /* Program an OTP word (16 bits) */
235  *(__IO uint16_t *)FlashAddress = *(__IO uint16_t*)DataAddress;
236  }
237  else
238 #endif /* FLASH_OPTCR_PG_OTP */
239  {
240  /* Program the flash word */
241  do
242  {
243  *dest_addr = *src_addr;
244  dest_addr++;
245  src_addr++;
246  row_index--;
247  } while (row_index != 0U);
248  }
249 
250  __ISB();
251  __DSB();
252 
253  /* Wait for last operation to be completed */
254  status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE, bank);
255 
256 #if defined (DUAL_BANK)
257 #if defined (FLASH_OPTCR_PG_OTP)
258  if (TypeProgram == FLASH_TYPEPROGRAM_OTPWORD)
259  {
260  /* If the program operation is completed, disable the OTP_PG */
261  CLEAR_BIT(FLASH->OPTCR, FLASH_OPTCR_PG_OTP);
262  }
263  else
264 #endif /* FLASH_OPTCR_PG_OTP */
265  {
266  if(bank == FLASH_BANK_1)
267  {
268  /* If the program operation is completed, disable the PG */
269  CLEAR_BIT(FLASH->CR1, FLASH_CR_PG);
270  }
271  else
272  {
273  /* If the program operation is completed, disable the PG */
274  CLEAR_BIT(FLASH->CR2, FLASH_CR_PG);
275  }
276  }
277 #else /* Single Bank */
278 #if defined (FLASH_OPTCR_PG_OTP)
279  if (TypeProgram == FLASH_TYPEPROGRAM_OTPWORD)
280  {
281  /* If the program operation is completed, disable the OTP_PG */
282  CLEAR_BIT(FLASH->OPTCR, FLASH_OPTCR_PG_OTP);
283  }
284  else
285 #endif /* FLASH_OPTCR_PG_OTP */
286  {
287  /* If the program operation is completed, disable the PG */
288  CLEAR_BIT(FLASH->CR1, FLASH_CR_PG);
289  }
290 #endif /* DUAL_BANK */
291  }
292 
293  /* Process Unlocked */
295 
296  return status;
297 }
298 
313 HAL_StatusTypeDef HAL_FLASH_Program_IT(uint32_t TypeProgram, uint32_t FlashAddress, uint32_t DataAddress)
314 {
315  HAL_StatusTypeDef status;
316  __IO uint32_t *dest_addr = (__IO uint32_t*)FlashAddress;
317  __IO uint32_t *src_addr = (__IO uint32_t*)DataAddress;
318  uint32_t bank;
319  uint8_t row_index = FLASH_NB_32BITWORD_IN_FLASHWORD;
320 
321  /* Check the parameters */
322  assert_param(IS_FLASH_TYPEPROGRAM(TypeProgram));
323  assert_param(IS_FLASH_PROGRAM_ADDRESS(FlashAddress));
324 
325  /* Process Locked */
326  __HAL_LOCK(&pFlash);
327 
328  /* Reset error code */
330 
331 #if defined (FLASH_OPTCR_PG_OTP)
332  if((IS_FLASH_PROGRAM_ADDRESS_BANK1(FlashAddress)) || (IS_FLASH_PROGRAM_ADDRESS_OTP(FlashAddress)))
333 #else
334  if(IS_FLASH_PROGRAM_ADDRESS_BANK1(FlashAddress))
335 #endif /* FLASH_OPTCR_PG_OTP */
336  {
337  bank = FLASH_BANK_1;
338  }
339 #if defined (DUAL_BANK)
340  else if(IS_FLASH_PROGRAM_ADDRESS_BANK2(FlashAddress))
341  {
342  bank = FLASH_BANK_2;
343  }
344 #endif /* DUAL_BANK */
345  else
346  {
347  return HAL_ERROR;
348  }
349 
350  /* Wait for last operation to be completed */
351  status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE, bank);
352 
353  if (status != HAL_OK)
354  {
355  /* Process Unlocked */
357  }
358  else
359  {
360  pFlash.Address = FlashAddress;
361 
362 #if defined (DUAL_BANK)
363  if(bank == FLASH_BANK_1)
364  {
365  /* Set internal variables used by the IRQ handler */
367 
368 #if defined (FLASH_OPTCR_PG_OTP)
369  if (TypeProgram == FLASH_TYPEPROGRAM_OTPWORD)
370  {
371  /* Set OTP_PG bit */
372  SET_BIT(FLASH->OPTCR, FLASH_OPTCR_PG_OTP);
373  }
374  else
375 #endif /* FLASH_OPTCR_PG_OTP */
376  {
377  /* Set PG bit */
378  SET_BIT(FLASH->CR1, FLASH_CR_PG);
379  }
380 
381  /* Enable End of Operation and Error interrupts for Bank 1 */
382 #if defined (FLASH_CR_OPERRIE)
384  FLASH_IT_STRBERR_BANK1 | FLASH_IT_INCERR_BANK1 | FLASH_IT_OPERR_BANK1);
385 #else
388 #endif /* FLASH_CR_OPERRIE */
389  }
390  else
391  {
392  /* Set internal variables used by the IRQ handler */
394 
395  /* Set PG bit */
396  SET_BIT(FLASH->CR2, FLASH_CR_PG);
397 
398  /* Enable End of Operation and Error interrupts for Bank2 */
399 #if defined (FLASH_CR_OPERRIE)
401  FLASH_IT_STRBERR_BANK2 | FLASH_IT_INCERR_BANK2 | FLASH_IT_OPERR_BANK2);
402 #else
405 #endif /* FLASH_CR_OPERRIE */
406  }
407 #else /* Single Bank */
408  /* Set internal variables used by the IRQ handler */
410 
411 #if defined (FLASH_OPTCR_PG_OTP)
412  if (TypeProgram == FLASH_TYPEPROGRAM_OTPWORD)
413  {
414  /* Set OTP_PG bit */
415  SET_BIT(FLASH->OPTCR, FLASH_OPTCR_PG_OTP);
416  }
417  else
418 #endif /* FLASH_OPTCR_PG_OTP */
419  {
420  /* Set PG bit */
421  SET_BIT(FLASH->CR1, FLASH_CR_PG);
422  }
423 
424  /* Enable End of Operation and Error interrupts for Bank 1 */
425 #if defined (FLASH_CR_OPERRIE)
427  FLASH_IT_STRBERR_BANK1 | FLASH_IT_INCERR_BANK1 | FLASH_IT_OPERR_BANK1);
428 #else
431 #endif /* FLASH_CR_OPERRIE */
432 #endif /* DUAL_BANK */
433 
434  __ISB();
435  __DSB();
436 
437 #if defined (FLASH_OPTCR_PG_OTP)
438  if (TypeProgram == FLASH_TYPEPROGRAM_OTPWORD)
439  {
440  /* Program an OTP word (16 bits) */
441  *(__IO uint16_t *)FlashAddress = *(__IO uint16_t*)DataAddress;
442  }
443  else
444 #endif /* FLASH_OPTCR_PG_OTP */
445  {
446  /* Program the flash word */
447  do
448  {
449  *dest_addr = *src_addr;
450  dest_addr++;
451  src_addr++;
452  row_index--;
453  } while (row_index != 0U);
454  }
455 
456  __ISB();
457  __DSB();
458  }
459 
460  return status;
461 }
462 
467 void HAL_FLASH_IRQHandler(void)
468 {
469  uint32_t temp;
470  uint32_t errorflag;
471  FLASH_ProcedureTypeDef procedure;
472 
473  /* Check FLASH Bank1 End of Operation flag */
475  {
477  {
478  /* Nb of sector to erased can be decreased */
480 
481  /* Check if there are still sectors to erase */
482  if(pFlash.NbSectorsToErase != 0U)
483  {
484  /* Indicate user which sector has been erased */
486 
487  /* Clear bank 1 End of Operation pending bit */
489 
490  /* Increment sector number */
491  pFlash.Sector++;
492  temp = pFlash.Sector;
494  }
495  else
496  {
497  /* No more sectors to Erase, user callback can be called */
498  /* Reset Sector and stop Erase sectors procedure */
499  pFlash.Sector = 0xFFFFFFFFU;
501 
502  /* FLASH EOP interrupt user callback */
504 
505  /* Clear FLASH End of Operation pending bit */
507  }
508  }
509  else
510  {
511  procedure = pFlash.ProcedureOnGoing;
512 
513  if((procedure == FLASH_PROC_MASSERASE_BANK1) || (procedure == FLASH_PROC_ALLBANK_MASSERASE))
514  {
515  /* MassErase ended. Return the selected bank */
516  /* FLASH EOP interrupt user callback */
518  }
519  else if(procedure == FLASH_PROC_PROGRAM_BANK1)
520  {
521  /* Program ended. Return the selected address */
522  /* FLASH EOP interrupt user callback */
524  }
525  else
526  {
527  /* Nothing to do */
528  }
529 
530  if((procedure != FLASH_PROC_SECTERASE_BANK2) && \
531  (procedure != FLASH_PROC_MASSERASE_BANK2) && \
532  (procedure != FLASH_PROC_PROGRAM_BANK2))
533  {
535  /* Clear FLASH End of Operation pending bit */
537  }
538  }
539  }
540 
541 #if defined (DUAL_BANK)
542  /* Check FLASH Bank2 End of Operation flag */
544  {
546  {
547  /*Nb of sector to erased can be decreased*/
549 
550  /* Check if there are still sectors to erase*/
551  if(pFlash.NbSectorsToErase != 0U)
552  {
553  /*Indicate user which sector has been erased*/
555 
556  /* Clear bank 2 End of Operation pending bit */
558 
559  /*Increment sector number*/
560  pFlash.Sector++;
561  temp = pFlash.Sector;
562  FLASH_Erase_Sector(temp, FLASH_BANK_2, pFlash.VoltageForErase);
563  }
564  else
565  {
566  /* No more sectors to Erase, user callback can be called */
567  /* Reset Sector and stop Erase sectors procedure */
568  pFlash.Sector = 0xFFFFFFFFU;
570 
571  /* FLASH EOP interrupt user callback */
573 
574  /* Clear FLASH End of Operation pending bit */
576  }
577  }
578  else
579  {
580  procedure = pFlash.ProcedureOnGoing;
581 
582  if((procedure == FLASH_PROC_MASSERASE_BANK2) || (procedure == FLASH_PROC_ALLBANK_MASSERASE))
583  {
584  /*MassErase ended. Return the selected bank*/
585  /* FLASH EOP interrupt user callback */
586  HAL_FLASH_EndOfOperationCallback(FLASH_BANK_2);
587  }
588  else if(procedure == FLASH_PROC_PROGRAM_BANK2)
589  {
590  /* Program ended. Return the selected address */
591  /* FLASH EOP interrupt user callback */
593  }
594  else
595  {
596  /* Nothing to do */
597  }
598 
599  if((procedure != FLASH_PROC_SECTERASE_BANK1) && \
600  (procedure != FLASH_PROC_MASSERASE_BANK1) && \
601  (procedure != FLASH_PROC_PROGRAM_BANK1))
602  {
604  /* Clear FLASH End of Operation pending bit */
606  }
607  }
608  }
609 #endif /* DUAL_BANK */
610 
611  /* Check FLASH Bank1 operation error flags */
612 #if defined (FLASH_SR_OPERR)
614  FLASH_FLAG_INCERR_BANK1 | FLASH_FLAG_OPERR_BANK1);
615 #else
617  FLASH_FLAG_INCERR_BANK1);
618 #endif /* FLASH_SR_OPERR */
619 
620  if(errorflag != 0U)
621  {
622  /* Save the error code */
623  pFlash.ErrorCode |= errorflag;
624 
625  /* Clear error programming flags */
626  __HAL_FLASH_CLEAR_FLAG_BANK1(errorflag);
627 
628  procedure = pFlash.ProcedureOnGoing;
629 
630  if(procedure == FLASH_PROC_SECTERASE_BANK1)
631  {
632  /* Return the faulty sector */
633  temp = pFlash.Sector;
634  pFlash.Sector = 0xFFFFFFFFU;
635  }
636  else if((procedure == FLASH_PROC_MASSERASE_BANK1) || (procedure == FLASH_PROC_ALLBANK_MASSERASE))
637  {
638  /* Return the faulty bank */
639  temp = FLASH_BANK_1;
640  }
641  else
642  {
643  /* Return the faulty address */
644  temp = pFlash.Address;
645  }
646 
647  /* Stop the procedure ongoing*/
649 
650  /* FLASH error interrupt user callback */
652  }
653 
654 #if defined (DUAL_BANK)
655  /* Check FLASH Bank2 operation error flags */
656 #if defined (FLASH_SR_OPERR)
658  FLASH_FLAG_INCERR_BANK2 | FLASH_FLAG_OPERR_BANK2) & 0x7FFFFFFFU);
659 #else
661  FLASH_FLAG_INCERR_BANK2) & 0x7FFFFFFFU);
662 #endif /* FLASH_SR_OPERR */
663 
664  if(errorflag != 0U)
665  {
666  /* Save the error code */
667  pFlash.ErrorCode |= (errorflag | 0x80000000U);
668 
669  /* Clear error programming flags */
670  __HAL_FLASH_CLEAR_FLAG_BANK2(errorflag);
671 
672  procedure = pFlash.ProcedureOnGoing;
673 
674  if(procedure== FLASH_PROC_SECTERASE_BANK2)
675  {
676  /*return the faulty sector*/
677  temp = pFlash.Sector;
678  pFlash.Sector = 0xFFFFFFFFU;
679  }
680  else if((procedure == FLASH_PROC_MASSERASE_BANK2) || (procedure == FLASH_PROC_ALLBANK_MASSERASE))
681  {
682  /*return the faulty bank*/
683  temp = FLASH_BANK_2;
684  }
685  else
686  {
687  /*return the faulty address*/
688  temp = pFlash.Address;
689  }
690 
691  /*Stop the procedure ongoing*/
693 
694  /* FLASH error interrupt user callback */
696  }
697 #endif /* DUAL_BANK */
698 
700  {
701 #if defined (FLASH_CR_OPERRIE)
702  /* Disable Bank1 Operation and Error source interrupt */
704  FLASH_IT_STRBERR_BANK1 | FLASH_IT_INCERR_BANK1 | FLASH_IT_OPERR_BANK1);
705 
706 #if defined (DUAL_BANK)
707  /* Disable Bank2 Operation and Error source interrupt */
709  FLASH_IT_STRBERR_BANK2 | FLASH_IT_INCERR_BANK2 | FLASH_IT_OPERR_BANK2);
710 #endif /* DUAL_BANK */
711 #else
712  /* Disable Bank1 Operation and Error source interrupt */
715 
716 #if defined (DUAL_BANK)
717  /* Disable Bank2 Operation and Error source interrupt */
720 #endif /* DUAL_BANK */
721 #endif /* FLASH_CR_OPERRIE */
722 
723  /* Process Unlocked */
725  }
726 }
727 
737 __weak void HAL_FLASH_EndOfOperationCallback(uint32_t ReturnValue)
738 {
739  /* Prevent unused argument(s) compilation warning */
740  UNUSED(ReturnValue);
741 
742  /* NOTE : This function Should not be modified, when the callback is needed,
743  the HAL_FLASH_EndOfOperationCallback could be implemented in the user file
744  */
745 }
746 
755 __weak void HAL_FLASH_OperationErrorCallback(uint32_t ReturnValue)
756 {
757  /* Prevent unused argument(s) compilation warning */
758  UNUSED(ReturnValue);
759 
760  /* NOTE : This function Should not be modified, when the callback is needed,
761  the HAL_FLASH_OperationErrorCallback could be implemented in the user file
762  */
763 }
764 
789 {
790  if(READ_BIT(FLASH->CR1, FLASH_CR_LOCK) != 0U)
791  {
792  /* Authorize the FLASH Bank1 Registers access */
793  WRITE_REG(FLASH->KEYR1, FLASH_KEY1);
794  WRITE_REG(FLASH->KEYR1, FLASH_KEY2);
795 
796  /* Verify Flash Bank1 is unlocked */
797  if (READ_BIT(FLASH->CR1, FLASH_CR_LOCK) != 0U)
798  {
799  return HAL_ERROR;
800  }
801  }
802 
803 #if defined (DUAL_BANK)
804  if(READ_BIT(FLASH->CR2, FLASH_CR_LOCK) != 0U)
805  {
806  /* Authorize the FLASH Bank2 Registers access */
807  WRITE_REG(FLASH->KEYR2, FLASH_KEY1);
808  WRITE_REG(FLASH->KEYR2, FLASH_KEY2);
809 
810  /* Verify Flash Bank2 is unlocked */
811  if (READ_BIT(FLASH->CR2, FLASH_CR_LOCK) != 0U)
812  {
813  return HAL_ERROR;
814  }
815  }
816 #endif /* DUAL_BANK */
817 
818  return HAL_OK;
819 }
820 
826 {
827  /* Set the LOCK Bit to lock the FLASH Bank1 Control Register access */
828  SET_BIT(FLASH->CR1, FLASH_CR_LOCK);
829 
830  /* Verify Flash Bank1 is locked */
831  if (READ_BIT(FLASH->CR1, FLASH_CR_LOCK) == 0U)
832  {
833  return HAL_ERROR;
834  }
835 
836 #if defined (DUAL_BANK)
837  /* Set the LOCK Bit to lock the FLASH Bank2 Control Register access */
838  SET_BIT(FLASH->CR2, FLASH_CR_LOCK);
839 
840  /* Verify Flash Bank2 is locked */
841  if (READ_BIT(FLASH->CR2, FLASH_CR_LOCK) == 0U)
842  {
843  return HAL_ERROR;
844  }
845 #endif /* DUAL_BANK */
846 
847  return HAL_OK;
848 }
849 
855 {
856  if(READ_BIT(FLASH->OPTCR, FLASH_OPTCR_OPTLOCK) != 0U)
857  {
858  /* Authorizes the Option Byte registers programming */
859  WRITE_REG(FLASH->OPTKEYR, FLASH_OPT_KEY1);
860  WRITE_REG(FLASH->OPTKEYR, FLASH_OPT_KEY2);
861 
862  /* Verify that the Option Bytes are unlocked */
863  if (READ_BIT(FLASH->OPTCR, FLASH_OPTCR_OPTLOCK) != 0U)
864  {
865  return HAL_ERROR;
866  }
867  }
868 
869  return HAL_OK;
870 }
871 
877 {
878  /* Set the OPTLOCK Bit to lock the FLASH Option Byte Registers access */
880 
881  /* Verify that the Option Bytes are locked */
882  if (READ_BIT(FLASH->OPTCR, FLASH_OPTCR_OPTLOCK) == 0U)
883  {
884  return HAL_ERROR;
885  }
886 
887  return HAL_OK;
888 }
889 
895 {
896  HAL_StatusTypeDef status;
897 
898  /* Wait for CRC computation to be completed */
899  if (FLASH_CRC_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE, FLASH_BANK_1) != HAL_OK)
900  {
901  status = HAL_ERROR;
902  }
903 #if defined (DUAL_BANK)
904  else if (FLASH_CRC_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE, FLASH_BANK_2) != HAL_OK)
905  {
906  status = HAL_ERROR;
907  }
908 #endif /* DUAL_BANK */
909  else
910  {
911  status = HAL_OK;
912  }
913 
914  if (status == HAL_OK)
915  {
916  /* Set OPTSTRT Bit */
918 
919  /* Wait for OB change operation to be completed */
920  status = FLASH_OB_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE);
921  }
922 
923  return status;
924 }
925 
972 uint32_t HAL_FLASH_GetError(void)
973 {
974  return pFlash.ErrorCode;
975 }
976 
985 /* Private functions ---------------------------------------------------------*/
986 
997 HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout, uint32_t Bank)
998 {
999  /* Wait for the FLASH operation to complete by polling on QW flag to be reset.
1000  Even if the FLASH operation fails, the QW flag will be reset and an error
1001  flag will be set */
1002 
1003  uint32_t bsyflag = FLASH_FLAG_QW_BANK1;
1004  uint32_t errorflag = FLASH->SR1 & FLASH_FLAG_ALL_ERRORS_BANK1;
1005  uint32_t tickstart = HAL_GetTick();
1006 
1008 
1009 #if defined (DUAL_BANK)
1010 
1011  if (Bank == FLASH_BANK_2)
1012  {
1013  /* Get Error Flags */
1014  errorflag = (FLASH->SR2 & FLASH_FLAG_ALL_ERRORS_BANK2) | 0x80000000U;
1015  /* Select bsyflag depending on Bank */
1016  bsyflag = FLASH_FLAG_QW_BANK2;
1017  }
1018 #endif /* DUAL_BANK */
1019 
1020  while(__HAL_FLASH_GET_FLAG(bsyflag))
1021  {
1022  if(Timeout != HAL_MAX_DELAY)
1023  {
1024  if(((HAL_GetTick() - tickstart) > Timeout) || (Timeout == 0U))
1025  {
1026  return HAL_TIMEOUT;
1027  }
1028  }
1029  }
1030 
1031  /* In case of error reported in Flash SR1 or SR2 register */
1032  if((errorflag & 0x7FFFFFFFU) != 0U)
1033  {
1034  /*Save the error code*/
1035  pFlash.ErrorCode |= errorflag;
1036 
1037  /* Clear error programming flags */
1038  __HAL_FLASH_CLEAR_FLAG(errorflag);
1039 
1040  return HAL_ERROR;
1041  }
1042 
1043  /* Check FLASH End of Operation flag */
1044  if(Bank == FLASH_BANK_1)
1045  {
1047  {
1048  /* Clear FLASH End of Operation pending bit */
1050  }
1051  }
1052 #if defined (DUAL_BANK)
1053  else
1054  {
1056  {
1057  /* Clear FLASH End of Operation pending bit */
1059  }
1060  }
1061 #endif /* DUAL_BANK */
1062 
1063  return HAL_OK;
1064 }
1065 
1072 {
1073  /* Get timeout */
1074  uint32_t tickstart = HAL_GetTick();
1075 
1076  /* Wait for the FLASH Option Bytes change operation to complete by polling on OPT_BUSY flag to be reset */
1077  while(READ_BIT(FLASH->OPTSR_CUR, FLASH_OPTSR_OPT_BUSY) != 0U)
1078  {
1079  if(Timeout != HAL_MAX_DELAY)
1080  {
1081  if(((HAL_GetTick() - tickstart) > Timeout) || (Timeout == 0U))
1082  {
1083  return HAL_TIMEOUT;
1084  }
1085  }
1086  }
1087 
1088  /* Check option byte change error */
1089  if(READ_BIT(FLASH->OPTSR_CUR, FLASH_OPTSR_OPTCHANGEERR) != 0U)
1090  {
1091  /* Save the error code */
1093 
1094  /* Clear the OB error flag */
1096 
1097  return HAL_ERROR;
1098  }
1099 
1100  /* If there is no error flag set */
1101  return HAL_OK;
1102 }
1103 
1110 HAL_StatusTypeDef FLASH_CRC_WaitForLastOperation(uint32_t Timeout, uint32_t Bank)
1111 {
1112  uint32_t bsyflag;
1113  uint32_t tickstart = HAL_GetTick();
1114 
1116 
1117  /* Select bsyflag depending on Bank */
1118  if(Bank == FLASH_BANK_1)
1119  {
1120  bsyflag = FLASH_FLAG_CRC_BUSY_BANK1;
1121  }
1122  else
1123  {
1124  bsyflag = FLASH_FLAG_CRC_BUSY_BANK2;
1125  }
1126 
1127  /* Wait for the FLASH CRC computation to complete by polling on CRC_BUSY flag to be reset */
1128  while(__HAL_FLASH_GET_FLAG(bsyflag))
1129  {
1130  if(Timeout != HAL_MAX_DELAY)
1131  {
1132  if(((HAL_GetTick() - tickstart) > Timeout) || (Timeout == 0U))
1133  {
1134  return HAL_TIMEOUT;
1135  }
1136  }
1137  }
1138 
1139  /* Check FLASH CRC read error flag */
1140  if(Bank == FLASH_BANK_1)
1141  {
1143  {
1144  /* Save the error code */
1146 
1147  /* Clear FLASH CRC read error pending bit */
1149 
1150  return HAL_ERROR;
1151  }
1152  }
1153 #if defined (DUAL_BANK)
1154  else
1155  {
1157  {
1158  /* Save the error code */
1160 
1161  /* Clear FLASH CRC read error pending bit */
1163 
1164  return HAL_ERROR;
1165  }
1166  }
1167 #endif /* DUAL_BANK */
1168 
1169  /* If there is no error flag set */
1170  return HAL_OK;
1171 }
1172 
1177 #endif /* HAL_FLASH_MODULE_ENABLED */
1178 
1187 /************************ (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_FLAG_EOP_BANK2
#define FLASH_FLAG_EOP_BANK2
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:216
HAL_FLASH_Lock
HAL_StatusTypeDef HAL_FLASH_Lock(void)
FLASH_IT_EOP_BANK1
#define FLASH_IT_EOP_BANK1
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:257
HAL_FLASH_Program
HAL_StatusTypeDef HAL_FLASH_Program(uint32_t TypeProgram, uint32_t Address, uint64_t Data)
FLASH_FLAG_WRPERR_BANK2
#define FLASH_FLAG_WRPERR_BANK2
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:217
__IO
#define __IO
Definition: imxrt1050/imxrt1050-evkb/CMSIS/core_cm7.h:237
HAL_StatusTypeDef
HAL_StatusTypeDef
HAL Status structures definition
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:40
HAL_FLASH_OB_Unlock
HAL_StatusTypeDef HAL_FLASH_OB_Unlock(void)
HAL_FLASH_OB_Launch
HAL_StatusTypeDef HAL_FLASH_OB_Launch(void)
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_FLAG_PGSERR_BANK2
#define FLASH_FLAG_PGSERR_BANK2
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:218
FLASH_PROC_PROGRAM_BANK1
@ FLASH_PROC_PROGRAM_BANK1
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:52
__DSB
__STATIC_FORCEINLINE void __DSB(void)
Data Synchronization Barrier.
Definition: imxrt1050/imxrt1050-evkb/CMSIS/cmsis_gcc.h:944
FLASH_Erase_Sector
void FLASH_Erase_Sector(uint32_t Sector, uint8_t VoltageRange)
__ISB
__STATIC_FORCEINLINE void __ISB(void)
Instruction Synchronization Barrier.
Definition: imxrt1050/imxrt1050-evkb/CMSIS/cmsis_gcc.h:933
HAL_FLASH_IRQHandler
void HAL_FLASH_IRQHandler(void)
FLASH_OPTSR_OPT_BUSY
#define FLASH_OPTSR_OPT_BUSY
Definition: stm32h735xx.h:11257
FLASH_FLAG_QW_BANK2
#define FLASH_FLAG_QW_BANK2
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:214
FLASH_FLAG_ALL_ERRORS_BANK1
#define FLASH_FLAG_ALL_ERRORS_BANK1
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:200
FLASH_PROC_MASSERASE_BANK1
@ FLASH_PROC_MASSERASE_BANK1
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:51
FLASH_PROC_SECTERASE_BANK2
@ FLASH_PROC_SECTERASE_BANK2
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:53
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
CLEAR_BIT
#define CLEAR_BIT(REG, BIT)
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:214
HAL_GetTick
uint32_t HAL_GetTick(void)
Provides a tick value in millisecond.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c:323
FLASH_ProcessTypeDef::VoltageForErase
__IO uint8_t VoltageForErase
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h:64
HAL_FLASH_ERROR_CRCRD_BANK2
#define HAL_FLASH_ERROR_CRCRD_BANK2
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:133
FLASH_ProcessTypeDef::Sector
__IO uint32_t Sector
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h:66
HAL_FLASH_GetError
uint32_t HAL_FLASH_GetError(void)
FLASH_FLAG_STRBERR_BANK2
#define FLASH_FLAG_STRBERR_BANK2
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:219
__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_OPTCR_OPTSTART
#define FLASH_OPTCR_OPTSTART
Definition: stm32h735xx.h:11249
__HAL_FLASH_CLEAR_FLAG
#define __HAL_FLASH_CLEAR_FLAG(__FLAG__)
Clear the specified FLASH flags.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h:291
FLASH_OPT_KEY2
#define FLASH_OPT_KEY2
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h:159
pFlash
FLASH_ProcessTypeDef pFlash
HAL_OK
@ HAL_OK
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:42
IS_FLASH_BANK_EXCLUSIVE
#define IS_FLASH_BANK_EXCLUSIVE(BANK)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:833
FLASH_KEY2
#define FLASH_KEY2
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h:157
IS_FLASH_TYPEPROGRAM
#define IS_FLASH_TYPEPROGRAM(VALUE)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h:393
FLASH_ProcessTypeDef::ProcedureOnGoing
__IO FLASH_ProcedureTypeDef ProcedureOnGoing
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h:60
UNUSED
#define UNUSED(x)
Definition: porcupine/demo/c/dr_libs/old/dr.h:92
FLASH_FLAG_CRC_BUSY_BANK1
#define FLASH_FLAG_CRC_BUSY_BANK1
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:177
FLASH_CR_LOCK
#define FLASH_CR_LOCK
Definition: stm32f407xx.h:6764
FLASH_ProcedureTypeDef
FLASH_ProcedureTypeDef
FLASH Procedure structure definition.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h:47
FLASH_FLAG_ALL_ERRORS_BANK2
#define FLASH_FLAG_ALL_ERRORS_BANK2
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:238
FLASH_FLAG_CRCRDERR_BANK2
#define FLASH_FLAG_CRCRDERR_BANK2
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:229
__HAL_FLASH_GET_FLAG_BANK1
#define __HAL_FLASH_GET_FLAG_BANK1(__FLAG__)
Checks whether the specified FLASH flag is set or not.
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:644
__HAL_FLASH_DISABLE_IT_BANK1
#define __HAL_FLASH_DISABLE_IT_BANK1(__INTERRUPT__)
Disable the specified FLASH interrupt.
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:591
HAL_FLASH_OperationErrorCallback
void HAL_FLASH_OperationErrorCallback(uint32_t ReturnValue)
__HAL_LOCK
#define __HAL_LOCK(__HANDLE__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:93
FLASH_OPTCR_OPTLOCK
#define FLASH_OPTCR_OPTLOCK
Definition: stm32f407xx.h:6769
FLASH_PROC_SECTERASE_BANK1
@ FLASH_PROC_SECTERASE_BANK1
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:50
FLASH_OPTSR_OPTCHANGEERR
#define FLASH_OPTSR_OPTCHANGEERR
Definition: stm32h735xx.h:11300
FLASH_FLAG_CRC_BUSY_BANK2
#define FLASH_FLAG_CRC_BUSY_BANK2
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:215
__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
RESET
@ RESET
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:187
FLASH_KEY1
#define FLASH_KEY1
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h:156
FLASH_IT_INCERR_BANK1
#define FLASH_IT_INCERR_BANK1
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:261
FLASH_PROC_NONE
@ FLASH_PROC_NONE
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h:49
__HAL_UNLOCK
#define __HAL_UNLOCK(__HANDLE__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:105
READ_BIT
#define READ_BIT(REG, BIT)
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:216
FLASH_FLAG_CRCRDERR_BANK1
#define FLASH_FLAG_CRCRDERR_BANK1
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:191
HAL_MAX_DELAY
#define HAL_MAX_DELAY
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:61
FLASH_WaitForLastOperation
HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout)
__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_CRC_WaitForLastOperation
HAL_StatusTypeDef FLASH_CRC_WaitForLastOperation(uint32_t Timeout, uint32_t Bank)
__HAL_FLASH_GET_FLAG
#define __HAL_FLASH_GET_FLAG(__FLAG__)
Get the specified FLASH flag status.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h:275
FLASH_IT_INCERR_BANK2
#define FLASH_IT_INCERR_BANK2
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:292
FLASH_SR_EOP
#define FLASH_SR_EOP
Definition: stm32f407xx.h:6713
FLASH_OPTCCR_CLR_OPTCHANGEERR
#define FLASH_OPTCCR_CLR_OPTCHANGEERR
Definition: stm32h735xx.h:11305
FLASH_IT_STRBERR_BANK2
#define FLASH_IT_STRBERR_BANK2
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:291
HAL_TIMEOUT
@ HAL_TIMEOUT
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:45
FLASH_FLAG_QW_BANK1
#define FLASH_FLAG_QW_BANK1
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:176
FLASH_ProcessTypeDef
FLASH handle Structure definition
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h:58
FLASH_PROC_PROGRAM_BANK2
@ FLASH_PROC_PROGRAM_BANK2
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:55
__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_PROGRAM_ADDRESS
#define IS_FLASH_PROGRAM_ADDRESS(ADDRESS)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:819
FLASH_FLAG_EOP_BANK1
#define FLASH_FLAG_EOP_BANK1
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:178
FLASH
#define FLASH
Definition: stm32f407xx.h:1114
__HAL_FLASH_DISABLE_IT_BANK2
#define __HAL_FLASH_DISABLE_IT_BANK2(__INTERRUPT__)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:593
HAL_FLASH_EndOfOperationCallback
void HAL_FLASH_EndOfOperationCallback(uint32_t ReturnValue)
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_FLAG_WRPERR_BANK1
#define FLASH_FLAG_WRPERR_BANK1
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:179
FLASH_IT_STRBERR_BANK1
#define FLASH_IT_STRBERR_BANK1
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:260
WRITE_REG
#define WRITE_REG(REG, VAL)
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:220
HAL_FLASH_OB_Lock
HAL_StatusTypeDef HAL_FLASH_OB_Lock(void)
SET_BIT
#define SET_BIT(REG, BIT)
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:212
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_CR_PG
#define FLASH_CR_PG
Definition: stm32f407xx.h:6736
FLASH_IT_PGSERR_BANK2
#define FLASH_IT_PGSERR_BANK2
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:290
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
FLASH_ProcessTypeDef::Address
__IO uint32_t Address
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h:70
FLASH_NB_32BITWORD_IN_FLASHWORD
#define FLASH_NB_32BITWORD_IN_FLASHWORD
Definition: stm32h735xx.h:11057
FLASH_PROC_ALLBANK_MASSERASE
@ FLASH_PROC_ALLBANK_MASSERASE
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:56
FLASH_OB_WaitForLastOperation
HAL_StatusTypeDef FLASH_OB_WaitForLastOperation(uint32_t Timeout)
FLASH_ProcessTypeDef::NbSectorsToErase
__IO uint32_t NbSectorsToErase
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h:62
__HAL_FLASH_GET_FLAG_BANK2
#define __HAL_FLASH_GET_FLAG_BANK2(__FLAG__)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:646
FLASH_FLAG_PGSERR_BANK1
#define FLASH_FLAG_PGSERR_BANK1
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:180
FLASH_FLAG_STRBERR_BANK1
#define FLASH_FLAG_STRBERR_BANK1
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:181
FLASH_OPT_KEY1
#define FLASH_OPT_KEY1
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h:158
HAL_FLASH_ERROR_CRCRD_BANK1
#define HAL_FLASH_ERROR_CRCRD_BANK1
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:120
HAL_FLASH_ERROR_OB_CHANGE
#define HAL_FLASH_ERROR_OB_CHANGE
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_flash.h:135
HAL_FLASH_Program_IT
HAL_StatusTypeDef HAL_FLASH_Program_IT(uint32_t TypeProgram, uint32_t Address, uint64_t Data)
HAL_FLASH_Unlock
HAL_StatusTypeDef HAL_FLASH_Unlock(void)


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