summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2018-06-26 00:06:04 +1000
committerDamien George <damien.p.george@gmail.com>2018-06-26 00:06:04 +1000
commit9b158d60e160fd6be2fedc33a7d7327ec755f7b0 (patch)
tree8969b6a2c913ae4885d6eee0cabbbb7543ccf757
parent967123d42ee3089ae163dc08c05007075f7e9431 (diff)
stm32/mboot: Always use a flash latency of 1WS to match 48MHz HCLK.
-rw-r--r--ports/stm32/mboot/main.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/ports/stm32/mboot/main.c b/ports/stm32/mboot/main.c
index 1c762c9e4..32a8e76dd 100644
--- a/ports/stm32/mboot/main.c
+++ b/ports/stm32/mboot/main.c
@@ -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);