Skip to content

Commit

Permalink
fix the stm32 firmware update
Browse files Browse the repository at this point in the history
bug detail:
when the stm32 is in boot mode.if power down
stm32.it will not run into boot mode in the
 next power on.
  • Loading branch information
bigbearishappy committed Aug 30, 2021
1 parent 824754d commit 82fed6e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion extras/reTerminal/STM32G030F6_R2/Core/Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ static void Update_Firmware_Init(void)
SET_BIT(FLASH->OPTR, FLASH_OPTR_nBOOT0);
CLEAR_BIT(FLASH->ACR, FLASH_ACR_PROGEMPTY);

SET_BIT(FLASH->CR, FLASH_CR_STRT);
SET_BIT(FLASH->CR, FLASH_CR_OPTSTRT);
FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE);
CLEAR_BIT(FLASH->CR, FLASH_CR_OPTSTRT);

Expand Down
2 changes: 1 addition & 1 deletion extras/reTerminal/STM32G030F6_R2/Core/User/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void UPDATE_firmware(uint8_t enable)
CLEAR_BIT(FLASH->OPTR, FLASH_OPTR_nBOOT0);
SET_BIT(FLASH->ACR, FLASH_ACR_PROGEMPTY);

SET_BIT(FLASH->CR, FLASH_CR_STRT);
SET_BIT(FLASH->CR, FLASH_CR_OPTSTRT);
FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE);
CLEAR_BIT(FLASH->CR, FLASH_CR_OPTSTRT);

Expand Down

0 comments on commit 82fed6e

Please sign in to comment.