stm32/mboot: Always use a flash latency of 1WS to match 48MHz HCLK.

This commit is contained in:
Damien George 2018-06-26 00:06:04 +10:00
parent 967123d42e
commit 9b158d60e1
1 changed files with 2 additions and 4 deletions

View File

@ -51,10 +51,12 @@
#undef MICROPY_HW_CLK_PLLN
#undef MICROPY_HW_CLK_PLLP
#undef MICROPY_HW_CLK_PLLQ
#undef MICROPY_HW_FLASH_LATENCY
#define MICROPY_HW_CLK_PLLM (HSE_VALUE / 1000000)
#define MICROPY_HW_CLK_PLLN (192)
#define MICROPY_HW_CLK_PLLP (RCC_PLLP_DIV4)
#define MICROPY_HW_CLK_PLLQ (4)
#define MICROPY_HW_FLASH_LATENCY FLASH_LATENCY_1
// Work out which USB device to use for the USB DFU interface
#if !defined(MICROPY_HW_USB_MAIN_DEV)
@ -206,10 +208,6 @@ void SystemClock_Config(void) {
while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) == RESET) {
}
#if !defined(MICROPY_HW_FLASH_LATENCY)
#define MICROPY_HW_FLASH_LATENCY FLASH_LATENCY_1
#endif
// Increase latency before changing clock
if (MICROPY_HW_FLASH_LATENCY > (FLASH->ACR & FLASH_ACR_LATENCY)) {
__HAL_FLASH_SET_LATENCY(MICROPY_HW_FLASH_LATENCY);