• R/O
  • SSH
  • HTTPS

chibios: Commit


Commit MetaInfo

Revision13093 (tree)
Zeit2019-10-07 21:02:58
Autorcinsights

Log Message

Fix EFL L4+ and G0 dual bank checking wrong register

Ändern Zusammenfassung

Diff

--- trunk/os/hal/ports/STM32/STM32G0xx/hal_efl_lld.c (revision 13092)
+++ trunk/os/hal/ports/STM32/STM32G0xx/hal_efl_lld.c (revision 13093)
@@ -143,7 +143,7 @@
143143 static inline bool stm32_flash_dual_bank(EFlashDriver *eflp) {
144144
145145 #if STM32_FLASH_NUMBER_OF_BANKS > 1
146- return ((eflp->flash->SR & (FLASH_OPTR_DBANK | FLASH_OPTR_DB1M)) != 0U);
146+#error "Device settings incorrectly configured - single bank mode only supported"
147147 #endif
148148 (void)eflp;
149149 return false;
@@ -588,7 +588,8 @@
588588 devp->state = FLASH_READ;
589589
590590 /* Scanning the sector space.*/
591- for (i = 0U; i < bank->sectors_size / sizeof(uint32_t); i++) {
591+ uint32_t sector_size = flashGetSectorSize(getBaseFlash(devp), sector);
592+ for (i = 0U; i < sector_size / sizeof(uint32_t); i++) {
592593 if (*address != 0xFFFFFFFFU) {
593594 err = FLASH_ERROR_VERIFY;
594595 break;
--- trunk/os/hal/ports/STM32/STM32L4xx+/hal_efl_lld.c (revision 13092)
+++ trunk/os/hal/ports/STM32/STM32L4xx+/hal_efl_lld.c (revision 13093)
@@ -167,7 +167,7 @@
167167 static inline bool stm32_flash_dual_bank(EFlashDriver *eflp) {
168168
169169 #if STM32_FLASH_NUMBER_OF_BANKS > 1
170- return ((eflp->flash->SR & (FLASH_OPTR_DBANK | FLASH_OPTR_DB1M)) != 0U);
170+ return ((eflp->flash->OPTR & (FLASH_OPTR_DBANK | FLASH_OPTR_DB1M)) != 0U);
171171 #endif
172172 return false;
173173 }
@@ -603,7 +603,7 @@
603603 return FLASH_BUSY_ERASING;
604604 }
605605
606- /* Address of the sector in the selected bank.*/
606+ /* Address of the sector in the bank.*/
607607 address = (uint32_t *)(bank->address +
608608 flashGetSectorOffset(getBaseFlash(devp), sector));
609609
@@ -611,7 +611,8 @@
611611 devp->state = FLASH_READ;
612612
613613 /* Scanning the sector space.*/
614- for (i = 0U; i < bank->sectors_size / sizeof(uint32_t); i++) {
614+ uint32_t sector_size = flashGetSectorSize(getBaseFlash(devp), sector);
615+ for (i = 0U; i < sector_size / sizeof(uint32_t); i++) {
615616 if (*address != 0xFFFFFFFFU) {
616617 err = FLASH_ERROR_VERIFY;
617618 break;
Show on old repository browser