Merge branch 'wb-campaign-a2' into fenrir-fixes-2026-09-07

pull/883/head
Daniele Lacamera 2026-09-07 16:38:42 +02:00
commit 33e5bed910
2 changed files with 8 additions and 2 deletions

View File

@ -177,7 +177,7 @@ void fork_bootloader(void);
# define FLASH_SECTOR_8 0x8100000 /* 256 Kb */
# define FLASH_SECTOR_9 0x8140000 /* 256 Kb */
# define FLASH_SECTOR_10 0x8180000 /* 256 Kb */
# define FLASH_SECTOR_11 0x818C000 /* 256 Kb */
# define FLASH_SECTOR_11 0x81C0000 /* 256 Kb */
#endif
# define FLASH_TOP 0x8200000

View File

@ -254,11 +254,17 @@ static void clock_pll_off(void)
/* Enable internal high-speed oscillator. */
RCC_CR |= RCC_CR_MSION;
DMB();
while ((RCC_CFGR & RCC_CR_MSIRDY) == 0) {};
/* Wait for MSI to be ready. */
while ((RCC_CR & RCC_CR_MSIRDY) == 0)
;
/* Select MSI as SYSCLK source. */
reg32 = RCC_CFGR;
reg32 &= ~(RCC_CFGR_SW_MASK);
RCC_CFGR = reg32;
DMB();
/* Wait for the switch to be confirmed (SWS, bits 3:2). */
while (((RCC_CFGR >> 2) & RCC_CFGR_SW_MASK) != RCC_CFGR_SW_MSI)
;
/* Turn off PLL */
RCC_CR &= ~RCC_CR_PLLON;
DMB();