diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2019-10-15 17:45:48 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2019-10-23 21:34:48 -0400 |
commit | 0b0c47c5666bcaab2738807160c10e887d420ac6 (patch) | |
tree | c913f7c91e9b720414f578df8e57a89ece8f2ada /src/stm32 | |
parent | a6d90bb95e5fdf56993796660ee559ab5666ad0d (diff) | |
download | kutter-0b0c47c5666bcaab2738807160c10e887d420ac6.tar.gz kutter-0b0c47c5666bcaab2738807160c10e887d420ac6.tar.xz kutter-0b0c47c5666bcaab2738807160c10e887d420ac6.zip |
stm32: Support PA11/PA12 pin remap on stm32f042 tsop20 chip
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/stm32')
-rw-r--r-- | src/stm32/Kconfig | 4 | ||||
-rw-r--r-- | src/stm32/stm32f0.c | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/stm32/Kconfig b/src/stm32/Kconfig index cbaa7f32..378fb00b 100644 --- a/src/stm32/Kconfig +++ b/src/stm32/Kconfig @@ -124,6 +124,10 @@ config USBSERIAL bool "Use USB for communication (instead of serial)" depends on HAVE_STM32_USBFS || HAVE_STM32_USBOTG default y +config STM32F042_USB_PIN_SWAP + bool "Use PA9/PA10 for USB" if MACH_STM32F042 + depends on USBSERIAL && MACH_STM32F042 + default n config SERIAL depends on !USBSERIAL bool diff --git a/src/stm32/stm32f0.c b/src/stm32/stm32f0.c index d3c1afb4..2c6958a9 100644 --- a/src/stm32/stm32f0.c +++ b/src/stm32/stm32f0.c @@ -159,4 +159,12 @@ clock_setup(void) hsi48_setup(); else pll_setup(); + + // Support alternate USB pins on stm32f042 +#ifdef SYSCFG_CFGR1_PA11_PA12_RMP + if (CONFIG_STM32F042_USB_PIN_SWAP) { + enable_pclock(SYSCFG_BASE); + SYSCFG->CFGR1 |= SYSCFG_CFGR1_PA11_PA12_RMP; + } +#endif } |