From 1e226a8893dea25c1c390243ec7176485715fe0c Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Wed, 13 Oct 2021 11:25:41 -0400 Subject: stm32: Add a MACH_STM32F0x2 alias for F042 and F072 chips The F042 and F072 chips are in the same series and the code should be nearly identical for these chips. Implement the alias and enable USB for the F072 chips. Signed-off-by: Kevin O'Connor --- src/stm32/stm32f0.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/stm32/stm32f0.c') diff --git a/src/stm32/stm32f0.c b/src/stm32/stm32f0.c index 701346c5..54338b14 100644 --- a/src/stm32/stm32f0.c +++ b/src/stm32/stm32f0.c @@ -162,7 +162,7 @@ pll_setup(void) static void hsi48_setup(void) { -#if CONFIG_MACH_STM32F042 +#if CONFIG_MACH_STM32F0x2 // Enable HSI48 RCC->CR2 |= RCC_CR2_HSI48ON; while (!(RCC->CR2 & RCC_CR2_HSI48RDY)) @@ -198,7 +198,7 @@ hsi14_setup(void) void armcm_main(void) { - if (CONFIG_USBSERIAL && CONFIG_MACH_STM32F042 + if (CONFIG_USBSERIAL && CONFIG_MACH_STM32F0x2 && *(uint64_t*)USB_BOOT_FLAG_ADDR == USB_BOOT_FLAG) { *(uint64_t*)USB_BOOT_FLAG_ADDR = 0; uint32_t *sysbase = (uint32_t*)0x1fffc400; @@ -215,7 +215,7 @@ armcm_main(void) FLASH->ACR = (1 << FLASH_ACR_LATENCY_Pos) | FLASH_ACR_PRFTBE; // Configure main clock - if (CONFIG_MACH_STM32F042 && CONFIG_STM32_CLOCK_REF_INTERNAL + if (CONFIG_MACH_STM32F0x2 && CONFIG_STM32_CLOCK_REF_INTERNAL && CONFIG_USBSERIAL) hsi48_setup(); else -- cgit v1.2.3-70-g09d2