diff options
Diffstat (limited to 'src/stm32')
-rw-r--r-- | src/stm32/stm32g0.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/stm32/stm32g0.c b/src/stm32/stm32g0.c index c243743b..244e00d9 100644 --- a/src/stm32/stm32g0.c +++ b/src/stm32/stm32g0.c @@ -183,8 +183,11 @@ armcm_main(void) check_usb_dfu_bootloader(); - // Set flash latency - FLASH->ACR = (2<<FLASH_ACR_LATENCY_Pos) | FLASH_ACR_ICEN | FLASH_ACR_PRFTEN; + // Set flash latency, cache and prefetch; use reset value as base + uint32_t acr = 0x00040600; + acr = (acr & ~FLASH_ACR_LATENCY) | (2<<FLASH_ACR_LATENCY_Pos); + acr |= FLASH_ACR_ICEN | FLASH_ACR_PRFTEN; + FLASH->ACR = acr; // Configure main clock clock_setup(); |