diff --git a/arch/arm/include/stm32l4/irq.h b/arch/arm/include/stm32l4/irq.h index 3e5a6c58929..a6419445adb 100644 --- a/arch/arm/include/stm32l4/irq.h +++ b/arch/arm/include/stm32l4/irq.h @@ -76,7 +76,7 @@ #define STM32L4_IRQ_FIRST (16) /* Vector number of the first external interrupt */ -#if defined(CONFIG_STM32L4_STM32L4X2) || defined(CONFIG_STM32L4_STM32L4X3) +#if defined(CONFIG_STM32L4_STM32L4X3) # include #elif defined(CONFIG_STM32L4_STM32L4X5) # include diff --git a/arch/arm/include/stm32l4/stm32l4x3xx_irq.h b/arch/arm/include/stm32l4/stm32l4x3xx_irq.h index 011238dcb8f..4a60bb70ace 100644 --- a/arch/arm/include/stm32l4/stm32l4x3xx_irq.h +++ b/arch/arm/include/stm32l4/stm32l4x3xx_irq.h @@ -147,7 +147,7 @@ #define STM32L4_IRQ_I2C4EV (STM32L4_IRQ_FIRST + 83) /* 83: I2C4 event interrupt */ #define STM32L4_IRQ_I2C4ER (STM32L4_IRQ_FIRST + 84) /* 84: I2C4 error interrupt */ -#if defined(CONFIG_STM32L4_STM32L4X2) || defined(CONFIG_STM32L4_STM32L4X3) +#if defined(CONFIG_STM32L4_STM32L4X3) # define STM32L4_IRQ_NEXTINTS 85 #else # error "Unsupported STM32L4 chip" diff --git a/arch/arm/src/stm32l4/Kconfig b/arch/arm/src/stm32l4/Kconfig index 68bf1845afd..efc08c4652f 100644 --- a/arch/arm/src/stm32l4/Kconfig +++ b/arch/arm/src/stm32l4/Kconfig @@ -380,10 +380,43 @@ config ARCH_CHIP_STM32L496AG ---help--- STM32 L4 Cortex M4, 1024Kb FLASH, 320 Kb SRAM -config ARCH_CHIP_STM32L4A6 # REVISIT: expand for each chip - bool "STM32L4A6xx" +config ARCH_CHIP_STM32L4A6RG + bool "STM32L4A6RG" select STM32L4_STM32L4A6XX select STM32L4_FLASH_CONFIG_G + select STM32L4_IO_CONFIG_R + ---help--- + STM32 L4 Cortex M4, AES, HASH, 1024Kb FLASH, 320 Kb SRAM + +config ARCH_CHIP_STM32L4A6VG + bool "STM32L4A6VG" + select STM32L4_STM32L4A6XX + select STM32L4_FLASH_CONFIG_G + select STM32L4_IO_CONFIG_V + ---help--- + STM32 L4 Cortex M4, AES, HASH, 1024Kb FLASH, 320 Kb SRAM + +config ARCH_CHIP_STM32L4A6QG + bool "STM32L4A6QG" + select STM32L4_STM32L4A6XX + select STM32L4_FLASH_CONFIG_G + select STM32L4_IO_CONFIG_Q + ---help--- + STM32 L4 Cortex M4, AES, HASH, 1024Kb FLASH, 320 Kb SRAM + +config ARCH_CHIP_STM32L4A6ZG + bool "STM32L4A6ZG" + select STM32L4_STM32L4A6XX + select STM32L4_FLASH_CONFIG_G + select STM32L4_IO_CONFIG_Z + ---help--- + STM32 L4 Cortex M4, AES, HASH, 1024Kb FLASH, 320 Kb SRAM + +config ARCH_CHIP_STM32L4A6AG + bool "STM32L4A6AG" + select STM32L4_STM32L4A6XX + select STM32L4_FLASH_CONFIG_G + select STM32L4_IO_CONFIG_A ---help--- STM32 L4 Cortex M4, AES, HASH, 1024Kb FLASH, 320 Kb SRAM @@ -392,12 +425,28 @@ endchoice # STM32 L4 Chip Selection # Chip product lines config STM32L4_STM32L4X1 - # Note: This is _not_ for L471xx as in RM0392 + # STM32L4x1 Access Lines + # + # Avoid using this config as it is basically same subfamily + # as STM32L4_STM32L4X3 (documented in RM0394). + # + # Note: This is _not_ for STM32L471xx (documented in RM0392). bool default n select STM32L4_STM32L4X3 config STM32L4_STM32L4X2 + # STM32L4x2 USB Device Lines + # + # Avoid using this config as it is basically same subfamily + # as STM32L4_STM32L4X3 (documented in RM0394). + bool + default n + select STM32L4_STM32L4X3 + +config STM32L4_STM32L4X3 + # STM32L4 devices documented in RM0394, regardless of what ST's + # marketing calls them. bool default n select ARCH_HAVE_FPU @@ -408,21 +457,10 @@ config STM32L4_STM32L4X2 select STM32L4_HAVE_LPTIM2 select STM32L4_HAVE_COMP select STM32L4_HAVE_SAI1 - -config STM32L4_STM32L4X3 - bool - default n - select ARCH_HAVE_FPU - select STM32L4_HAVE_USART1 - select STM32L4_HAVE_USART2 - select STM32L4_HAVE_USART3 - select STM32L4_HAVE_LPTIM1 - select STM32L4_HAVE_LPTIM2 - select STM32L4_HAVE_COMP - select STM32L4_HAVE_SAI1 - select STM32L4_HAVE_LCD if !STM32L4_STM32L4X1 + select STM32L4_HAVE_LCD if !(STM32L4_STM32L4X1 || STM32L4_STM32L4X2) config STM32L4_STM32L4X5 + # STM32L4 USB OTG Lines (documented in RM0351) bool default n select ARCH_HAVE_FPU @@ -451,6 +489,7 @@ config STM32L4_STM32L4X5 select STM32L4_HAVE_DFSDM1 config STM32L4_STM32L4X6 + # STM32L4x6 (documented in RM0351) bool default n select ARCH_HAVE_FPU diff --git a/arch/arm/src/stm32l4/README.txt b/arch/arm/src/stm32l4/README.txt index f4ff8a2a88d..7b56ed9df63 100644 --- a/arch/arm/src/stm32l4/README.txt +++ b/arch/arm/src/stm32l4/README.txt @@ -13,9 +13,9 @@ The various supported STM32L4 families are: | | Not supported | RM0392 | STM32L471xx | -| STM32L4_STM32L4X1 | RM0394 | Subset of STM32L4_STM32L4X3 +| STM32L4_STM32L4X1 | RM0394 | Subset of STM32L4_STM32L4X3 [*] | -| STM32L4_STM32L4X2 | RM0394 | Subset of STM32L4_STM32L4X3 +| STM32L4_STM32L4X2 | RM0394 | Subset of STM32L4_STM32L4X3 [*] | | STM32L4_STM32L4X3 | RM0394 | STM32L43xxx/44xxx/45xxx/46xxx | @@ -27,6 +27,9 @@ The various supported STM32L4 families are: | Not supported | RM0432 | STM32L4Rxxx, STM32L4Sxxx ------------------------------------------------------------- +[*]: Please avoid depending on CONFIG_STM32L4_STM32L4X1 and + CONFIG_STM32L4_STM32L4X2 as the MCUs are of the same subfamily + as CONFIG_STM32L4_STM32L4X3. TODO list --------- diff --git a/arch/arm/src/stm32l4/chip/stm32l4_memorymap.h b/arch/arm/src/stm32l4/chip/stm32l4_memorymap.h index c879f7a3282..5fa6ccb89f3 100644 --- a/arch/arm/src/stm32l4/chip/stm32l4_memorymap.h +++ b/arch/arm/src/stm32l4/chip/stm32l4_memorymap.h @@ -131,7 +131,7 @@ #define STM32L4_OPAMP_BASE 0x40007800 #define STM32L4_DAC_BASE 0x40007400 #define STM32L4_PWR_BASE 0x40007000 -#if defined(CONFIG_STM32L4_STM32L4X2) || defined(CONFIG_STM32L4_STM32L4X3) +#if defined(CONFIG_STM32L4_STM32L4X3) # define STM32L4_USB_SRAM_BASE 0x40006c00 # define STM32L4_USB_FS_BASE 0x40006800 #else diff --git a/arch/arm/src/stm32l4/chip/stm32l4_syscfg.h b/arch/arm/src/stm32l4/chip/stm32l4_syscfg.h index ded9e8917fa..ba02c5c80f5 100644 --- a/arch/arm/src/stm32l4/chip/stm32l4_syscfg.h +++ b/arch/arm/src/stm32l4/chip/stm32l4_syscfg.h @@ -43,7 +43,7 @@ #include #include "chip.h" -#if defined(CONFIG_STM32L4_STM32L4X2) || defined(CONFIG_STM32L4_STM32L4X3) +#if defined(CONFIG_STM32L4_STM32L4X3) # include "chip/stm32l4x3xx_syscfg.h" #elif defined(CONFIG_STM32L4_STM32L4X5) # include "chip/stm32l4x5xx_syscfg.h" diff --git a/arch/arm/src/stm32l4/chip/stm32l4x3xx_rcc.h b/arch/arm/src/stm32l4/chip/stm32l4x3xx_rcc.h index 0c8068c6037..4f6af7e2061 100644 --- a/arch/arm/src/stm32l4/chip/stm32l4x3xx_rcc.h +++ b/arch/arm/src/stm32l4/chip/stm32l4x3xx_rcc.h @@ -45,7 +45,7 @@ #include -#if defined(CONFIG_STM32L4_STM32L4X2) || defined(CONFIG_STM32L4_STM32L4X3) +#if defined(CONFIG_STM32L4_STM32L4X3) /**************************************************************************************************** * Pre-processor Definitions diff --git a/arch/arm/src/stm32l4/chip/stm32l4x3xx_syscfg.h b/arch/arm/src/stm32l4/chip/stm32l4x3xx_syscfg.h index 6daace6dca5..446ce1811a1 100644 --- a/arch/arm/src/stm32l4/chip/stm32l4x3xx_syscfg.h +++ b/arch/arm/src/stm32l4/chip/stm32l4x3xx_syscfg.h @@ -43,7 +43,7 @@ #include #include "chip.h" -#if defined(CONFIG_STM32L4_STM32L4X2) || defined(CONFIG_STM32L4_STM32L4X3) +#if defined(CONFIG_STM32L4_STM32L4X3) /**************************************************************************************************** * Pre-processor Definitions diff --git a/arch/arm/src/stm32l4/stm32l4_adc.c b/arch/arm/src/stm32l4/stm32l4_adc.c index 6acbe84a106..01a230f6703 100644 --- a/arch/arm/src/stm32l4/stm32l4_adc.c +++ b/arch/arm/src/stm32l4/stm32l4_adc.c @@ -76,12 +76,12 @@ #if defined(CONFIG_STM32L4_ADC1) || defined(CONFIG_STM32L4_ADC2) || \ defined(CONFIG_STM32L4_ADC3) -#if !(defined(CONFIG_STM32L4_STM32L4X2) || defined(CONFIG_STM32L4_STM32L4X3) || \ - defined(CONFIG_STM32L4_STM32L4X6)) +#if !(defined(CONFIG_STM32L4_STM32L4X3) || \ + defined(CONFIG_STM32L4_STM32L4X5) || defined(CONFIG_STM32L4_STM32L4X6)) # error "Unrecognized STM32 chip" #endif -#if defined(CONFIG_STM32L4_STM32L4X2) || defined(CONFIG_STM32L4_STM32L4X3) +#if defined(CONFIG_STM32L4_STM32L4X3) # if defined(CONFIG_STM32L4_ADC2) || defined(CONFIG_STM32L4_ADC3) # error "Using non-existent ADC" # endif @@ -105,7 +105,7 @@ /* ADC interrupts ***********************************************************/ -#if defined(CONFIG_STM32L4_STM32L4X2) || defined(CONFIG_STM32L4_STM32L4X3) +#if defined(CONFIG_STM32L4_STM32L4X3) # define STM32L4_IRQ_ADC12 STM32L4_IRQ_ADC1 #endif diff --git a/arch/arm/src/stm32l4/stm32l4_comp.c b/arch/arm/src/stm32l4/stm32l4_comp.c index bcc8d1cd894..369ab8fee56 100644 --- a/arch/arm/src/stm32l4/stm32l4_comp.c +++ b/arch/arm/src/stm32l4/stm32l4_comp.c @@ -54,7 +54,7 @@ #include -#if !(defined(CONFIG_STM32L4_STM32L4X2) || defined(CONFIG_STM32L4_STM32L4X3) || \ +#if !(defined(CONFIG_STM32L4_STM32L4X3) || \ defined(CONFIG_STM32L4_STM32L4X5) || defined(CONFIG_STM32L4_STM32L4X6)) # error "Unrecognized STM32 chip" #endif @@ -373,7 +373,7 @@ static int stm32l4_compconfig(FAR const struct comp_dev_s *dev) regval |= COMP_CSR_INPSEL_PIN2; break; -#if defined(CONFIG_STM32L4_STM32L4X2) || defined(CONFIG_STM32L4_STM32L4X3) +#if defined(CONFIG_STM32L4_STM32L4X3) case STM32L4_COMP_INP_PIN_3: stm32l4_configgpio(cmp == STM32L4_COMP1 ? GPIO_COMP1_INP_3 : GPIO_COMP2_INP_3); regval |= COMP_CSR_INPSEL_PIN3; @@ -437,7 +437,7 @@ static int stm32l4_compconfig(FAR const struct comp_dev_s *dev) #endif break; -#if defined(CONFIG_STM32L4_STM32L4X2) || defined(CONFIG_STM32L4_STM32L4X3) +#if defined(CONFIG_STM32L4_STM32L4X3) case STM32L4_COMP_INM_PIN_3: stm32l4_configgpio(cmp == STM32L4_COMP1 ? GPIO_COMP1_INM_3 : GPIO_COMP2_INM_3); regval |= COMP_CSR_INMSEL_INMESEL; diff --git a/arch/arm/src/stm32l4/stm32l4_comp.h b/arch/arm/src/stm32l4/stm32l4_comp.h index fe7185301e0..6d939520b37 100644 --- a/arch/arm/src/stm32l4/stm32l4_comp.h +++ b/arch/arm/src/stm32l4/stm32l4_comp.h @@ -50,7 +50,7 @@ * Public Types ************************************************************************************/ -#if defined(CONFIG_STM32L4_STM32L4X2) || defined(CONFIG_STM32L4_STM32L4X3) +#if defined(CONFIG_STM32L4_STM32L4X3) /* Comparators */ diff --git a/arch/arm/src/stm32l4/stm32l4_dbgmcu.h b/arch/arm/src/stm32l4/stm32l4_dbgmcu.h index 886674f341c..56ad7499a55 100644 --- a/arch/arm/src/stm32l4/stm32l4_dbgmcu.h +++ b/arch/arm/src/stm32l4/stm32l4_dbgmcu.h @@ -45,7 +45,7 @@ #include "chip.h" -#if defined(CONFIG_STM32L4_STM32L4X2) || defined(CONFIG_STM32L4_STM32L4X3) +#if defined(CONFIG_STM32L4_STM32L4X3) # include "chip/stm32l4x3xx_dbgmcu.h" #elif defined(CONFIG_STM32L4_STM32L4X5) # include "chip/stm32l4x5xx_dbgmcu.h" diff --git a/arch/arm/src/stm32l4/stm32l4_dma.c b/arch/arm/src/stm32l4/stm32l4_dma.c index fe00a144b7c..52001261ade 100644 --- a/arch/arm/src/stm32l4/stm32l4_dma.c +++ b/arch/arm/src/stm32l4/stm32l4_dma.c @@ -49,7 +49,7 @@ * TODO: do we need separate implementation for STM32L4X3? */ -#if defined(CONFIG_STM32L4_STM32L4X2) || defined(CONFIG_STM32L4_STM32L4X3) || \ +#if defined(CONFIG_STM32L4_STM32L4X3) || \ defined(CONFIG_STM32L4_STM32L4X5) || defined(CONFIG_STM32L4_STM32L4X6) #include "stm32l4x6xx_dma.c" #else diff --git a/arch/arm/src/stm32l4/stm32l4_dma.h b/arch/arm/src/stm32l4/stm32l4_dma.h index 0152be030da..c3124652676 100644 --- a/arch/arm/src/stm32l4/stm32l4_dma.h +++ b/arch/arm/src/stm32l4/stm32l4_dma.h @@ -49,7 +49,7 @@ /* Include the correct DMA register definitions for this STM32 family */ -#if defined(CONFIG_STM32L4_STM32L4X2) || defined(CONFIG_STM32L4_STM32L4X3) +#if defined(CONFIG_STM32L4_STM32L4X3) # include "chip/stm32l4x3xx_dma.h" #elif defined(CONFIG_STM32L4_STM32L4X5) # include "chip/stm32l4x5xx_dma.h" diff --git a/arch/arm/src/stm32l4/stm32l4_exti_comp.c b/arch/arm/src/stm32l4/stm32l4_exti_comp.c index 35c3796733d..f7e4eb47533 100644 --- a/arch/arm/src/stm32l4/stm32l4_exti_comp.c +++ b/arch/arm/src/stm32l4/stm32l4_exti_comp.c @@ -69,7 +69,7 @@ static struct comp_callback_s g_comp_handlers[STM32L4_COMP_NUM]; static const uint32_t g_comp_lines[STM32L4_COMP_NUM] = { -#if defined(CONFIG_STM32L4_STM32L4X2) || defined(CONFIG_STM32L4_STM32L4X3) || \ +#if defined(CONFIG_STM32L4_STM32L4X3) || \ defined(CONFIG_STM32L4_STM32L4X5) || defined(CONFIG_STM32L4_STM32L4X6) EXTI1_COMP1, EXTI1_COMP2 diff --git a/arch/arm/src/stm32l4/stm32l4_firewall.h b/arch/arm/src/stm32l4/stm32l4_firewall.h index 8f45d7c0e5b..6f201027e25 100644 --- a/arch/arm/src/stm32l4/stm32l4_firewall.h +++ b/arch/arm/src/stm32l4/stm32l4_firewall.h @@ -47,7 +47,7 @@ /* Include the correct firewall register definitions for this STM32L4 family */ -#if defined(CONFIG_STM32L4_STM32L4X2) || defined(CONFIG_STM32L4_STM32L4X3) +#if defined(CONFIG_STM32L4_STM32L4X3) # include "chip/stm32l4x3xx_firewall.h" #elif defined(CONFIG_STM32L4_STM32L4X5) # include "chip/stm32l4x5xx_firewall.h" diff --git a/arch/arm/src/stm32l4/stm32l4_flash.c b/arch/arm/src/stm32l4/stm32l4_flash.c index 0cbbd20940a..5d25f2d9aed 100644 --- a/arch/arm/src/stm32l4/stm32l4_flash.c +++ b/arch/arm/src/stm32l4/stm32l4_flash.c @@ -63,7 +63,7 @@ #include "up_arch.h" -#if !(defined(CONFIG_STM32L4_STM32L4X2) || defined(CONFIG_STM32L4_STM32L4X3) || \ +#if !(defined(CONFIG_STM32L4_STM32L4X3) || \ defined(CONFIG_STM32L4_STM32L4X5) || defined(CONFIG_STM32L4_STM32L4X6)) # error "Unrecognized STM32 chip" #endif diff --git a/arch/arm/src/stm32l4/stm32l4_gpio.h b/arch/arm/src/stm32l4/stm32l4_gpio.h index bcbb5f475c2..9c32508973a 100644 --- a/arch/arm/src/stm32l4/stm32l4_gpio.h +++ b/arch/arm/src/stm32l4/stm32l4_gpio.h @@ -54,7 +54,7 @@ #include "chip.h" -#if defined(CONFIG_STM32L4_STM32L4X2) || defined(CONFIG_STM32L4_STM32L4X3) || \ +#if defined(CONFIG_STM32L4_STM32L4X3) || \ defined(CONFIG_STM32L4_STM32L4X5) || defined(CONFIG_STM32L4_STM32L4X6) # include "chip/stm32l4_gpio.h" #else diff --git a/arch/arm/src/stm32l4/stm32l4_rcc.c b/arch/arm/src/stm32l4/stm32l4_rcc.c index 72384f241a0..8e033dc2995 100644 --- a/arch/arm/src/stm32l4/stm32l4_rcc.c +++ b/arch/arm/src/stm32l4/stm32l4_rcc.c @@ -79,7 +79,7 @@ /* Include chip-specific clocking initialization logic */ -#if defined(CONFIG_STM32L4_STM32L4X2) || defined(CONFIG_STM32L4_STM32L4X3) +#if defined(CONFIG_STM32L4_STM32L4X3) # include "stm32l4x3xx_rcc.c" #elif defined(CONFIG_STM32L4_STM32L4X5) # include "stm32l4x5xx_rcc.c" diff --git a/arch/arm/src/stm32l4/stm32l4_rcc.h b/arch/arm/src/stm32l4/stm32l4_rcc.h index 2b0971b5f94..741b5620d5e 100644 --- a/arch/arm/src/stm32l4/stm32l4_rcc.h +++ b/arch/arm/src/stm32l4/stm32l4_rcc.h @@ -45,7 +45,7 @@ #include "up_arch.h" #include "chip.h" -#if defined(CONFIG_STM32L4_STM32L4X2) || defined(CONFIG_STM32L4_STM32L4X3) +#if defined(CONFIG_STM32L4_STM32L4X3) # include "chip/stm32l4x3xx_rcc.h" #elif defined(CONFIG_STM32L4_STM32L4X5) # include "chip/stm32l4x5xx_rcc.h" diff --git a/arch/arm/src/stm32l4/stm32l4_uart.h b/arch/arm/src/stm32l4/stm32l4_uart.h index 1a7249a698c..7a635d9f8d7 100644 --- a/arch/arm/src/stm32l4/stm32l4_uart.h +++ b/arch/arm/src/stm32l4/stm32l4_uart.h @@ -45,8 +45,8 @@ #include "chip.h" -#if defined(CONFIG_STM32L4_STM32L4X2) || defined(CONFIG_STM32L4_STM32L4X3) || \ - defined(CONFIG_STM32L4_STM32L4X5) || defined(CONFIG_STM32L4_STM32L4X6) +#if defined(CONFIG_STM32L4_STM32L4X3) || defined(CONFIG_STM32L4_STM32L4X5) || \ + defined(CONFIG_STM32L4_STM32L4X6) # include "chip/stm32l4_uart.h" #else # error "Unsupported STM32L4 chip"