This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch releases/13.0
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 9002941cd1008dd2b498d71b760d43da2b051e32
Author: raiden00pl <[email protected]>
AuthorDate: Mon May 25 22:43:32 2026 +0200

    !arch/stm32f0l0g0: move stm32l0 to its own directory
    
    BREAKING CHANGE:
    
    Part of splitting the legacy stm32 super-directory; relocates
    the stm32l0 sources, headers and boards into arch/arm/src/stm32l0,
    arch/arm/include/stm32l0 and boards/arm/stm32l0.
    
    Signed-off-by: raiden00pl <[email protected]>
---
 arch/arm/include/stm32l0/chip.h                    | 371 +++++++++++++++++++++
 .../{stm32f0l0g0/stm32l0_irq.h => stm32l0/irq.h}   |  79 ++---
 .../src => arch/arm/src/stm32l0}/CMakeLists.txt    |  19 +-
 arch/arm/src/stm32l0/Kconfig                       | 273 +++++++++++++++
 .../src => arch/arm/src/stm32l0}/Make.defs         |  22 +-
 arch/arm/src/stm32l0/chip.h                        |  44 +++
 arch/arm/src/stm32l0/hardware/stm32_memorymap.h    |  17 +
 arch/arm/src/stm32l0/hardware/stm32_pinmap.h       |  17 +
 .../hardware/stm32l0_exti.h                        |   8 +-
 .../hardware/stm32l0_flash.h                       |   8 +-
 .../hardware/stm32l0_memorymap.h                   |   8 +-
 .../hardware/stm32l0_pinmap.h                      |   8 +-
 .../hardware/stm32l0_pwr.h                         |   8 +-
 .../hardware/stm32l0_rcc.h                         |   8 +-
 .../hardware/stm32l0_syscfg.h                      |   8 +-
 .../arm/src/stm32l0/stm32.h                        |  64 ++--
 arch/arm/src/stm32l0/stm32_rcc.c                   | 220 ++++++++++++
 .../arm/src/{stm32f0l0g0 => stm32l0}/stm32l0_rcc.c |   2 +-
 .../src => stm32l0/b-l072z-lrwan1}/CMakeLists.txt  |  18 +-
 .../b-l072z-lrwan1/Kconfig                         |   0
 .../b-l072z-lrwan1/configs/adc/defconfig           |   2 +-
 .../b-l072z-lrwan1/configs/nsh/defconfig           |   2 +-
 .../b-l072z-lrwan1/configs/nxlines_oled/defconfig  |   2 +-
 .../b-l072z-lrwan1/configs/sx127x/defconfig        |   2 +-
 .../b-l072z-lrwan1/include/board.h                 |   2 +-
 .../b-l072z-lrwan1}/scripts/Make.defs              |   8 +-
 .../b-l072z-lrwan1/scripts/ld.script               |   2 +-
 .../b-l072z-lrwan1/src/CMakeLists.txt              |   2 +-
 .../b-l072z-lrwan1/src/Make.defs                   |   2 +-
 .../b-l072z-lrwan1/src/b-l072z-lrwan1.h            |   2 +-
 .../b-l072z-lrwan1/src/stm32_adc.c                 |   2 +-
 .../b-l072z-lrwan1/src/stm32_autoleds.c            |   2 +-
 .../b-l072z-lrwan1/src/stm32_boot.c                |   2 +-
 .../b-l072z-lrwan1/src/stm32_bringup.c             |   2 +-
 .../b-l072z-lrwan1/src/stm32_lcd_ssd1306.c         |   2 +-
 .../b-l072z-lrwan1/src/stm32_spi.c                 |   2 +-
 .../b-l072z-lrwan1/src/stm32_sx127x.c              |   2 +-
 .../src => stm32l0/common}/CMakeLists.txt          |  18 +-
 .../b-l072z-lrwan1 => stm32l0/common}/Kconfig      |   4 +-
 .../src/Make.defs => stm32l0/common/Makefile}      |  31 +-
 .../src => stm32l0/nucleo-l073rz}/CMakeLists.txt   |  18 +-
 .../{stm32f0l0g0 => stm32l0}/nucleo-l073rz/Kconfig |   0
 .../nucleo-l073rz/configs/nsh/defconfig            |   2 +-
 .../nucleo-l073rz/configs/sx127x/defconfig         |   2 +-
 .../nucleo-l073rz/include/board.h                  |   2 +-
 .../nucleo-l073rz}/scripts/Make.defs               |   8 +-
 .../nucleo-l073rz/scripts/ld.script                |   2 +-
 .../nucleo-l073rz/src/CMakeLists.txt               |   2 +-
 .../nucleo-l073rz/src/Make.defs                    |   2 +-
 .../nucleo-l073rz/src/nucleo-l073rz.h              |   2 +-
 .../nucleo-l073rz/src/stm32_autoleds.c             |   2 +-
 .../nucleo-l073rz/src/stm32_boot.c                 |   2 +-
 .../nucleo-l073rz/src/stm32_bringup.c              |   2 +-
 .../nucleo-l073rz/src/stm32_buttons.c              |   2 +-
 .../nucleo-l073rz/src/stm32_mfrc522.c              |   2 +-
 .../nucleo-l073rz/src/stm32_nrf24l01.c             |   2 +-
 .../nucleo-l073rz/src/stm32_spi.c                  |   2 +-
 .../nucleo-l073rz/src/stm32_sx127x.c               |   2 +-
 .../stm32l0538-disco}/CMakeLists.txt               |  18 +-
 .../stm32l0538-disco/Kconfig                       |   0
 .../stm32l0538-disco/configs/nsh/defconfig         |   2 +-
 .../stm32l0538-disco/include/board.h               |   2 +-
 .../stm32l0538-disco/scripts/Make.defs             |   2 +-
 .../stm32l0538-disco/scripts/ld.script             |   2 +-
 .../stm32l0538-disco/src/CMakeLists.txt            |   2 +-
 .../stm32l0538-disco/src/Make.defs                 |   2 +-
 .../stm32l0538-disco/src/stm32_autoleds.c          |   2 +-
 .../stm32l0538-disco/src/stm32_boot.c              |   2 +-
 .../stm32l0538-disco/src/stm32_bringup.c           |   2 +-
 .../stm32l0538-disco/src/stm32_buttons.c           |   2 +-
 .../stm32l0538-disco/src/stm32l0538-disco.h        |   2 +-
 71 files changed, 1114 insertions(+), 277 deletions(-)

diff --git a/arch/arm/include/stm32l0/chip.h b/arch/arm/include/stm32l0/chip.h
new file mode 100644
index 00000000000..dcd81994546
--- /dev/null
+++ b/arch/arm/include/stm32l0/chip.h
@@ -0,0 +1,371 @@
+/****************************************************************************
+ * arch/arm/include/stm32l0/chip.h
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __ARCH_ARM_INCLUDE_STM32L0_CHIP_H
+#define __ARCH_ARM_INCLUDE_STM32L0_CHIP_H
+
+#define ARMV6M_PERIPHERAL_INTERRUPTS 32
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+/****************************************************************************
+ * Pre-processor Prototypes
+ ****************************************************************************/
+
+/* Get customizations for each supported chip */
+
+#if defined(CONFIG_ARCH_CHIP_STM32L071K8)
+#  define STM32_NATIM           0  /* No advanced timers */
+#  define STM32_NGTIM16         4  /* 16-bit general up/down timers TIM2-3
+                                    * (with DMA) and TIM21-22 without DMA */
+#  define STM32_NGTIM32         0  /* No 32-bit general up/down timers */
+#  define STM32_NBTIM           2  /* 2 basic timers: TIM6, TIM7 with DMA */
+                                   /* 1 LPTIMER */
+#  define STM32_NSPI            1  /* 1 SPI modules SPI1 */
+#  define STM32_NI2S            0  /* 0 I2S module */
+#  define STM32_NI2C            2  /* 2 I2C */
+#  define STM32_NDMA            1  /* 1 DMA1, 7-channels */
+#  define STM32_NUSART          3  /* 3 USART modules, USART1-3 */
+                                   /* 1 LPUART */
+#  define STM32_NCAN            0  /* 0 CAN controllers */
+#  define STM32_NLCD            0  /* 0 LCD */
+#  define STM32_NUSBDEV         0  /* 0 USB full-speed device controller */
+#  define STM32_NUSBOTG         0  /* 0 USB OTG FS/HS (only USB 2.0 device) */
+#  define STM32_NCEC            0  /* 0 HDMI-CEC controller */
+#  define STM32_NADC            1  /* One 12-bit module */
+#  define STM32_NDAC            0  /* 0 DAC channel */
+#  define STM32_NCOMP           2  /* 2 Analog Comparators */
+#  define STM32_NCRC            0  /* 0 CRC module */
+#  define STM32_NRNG            0  /* 0 Random number generator (RNG) */
+#  define STM32_NCAP            0  /* 0 Capacitive sensing channels */
+#  define STM32_NPORTS          6  /* Six GPIO ports, GPIOA-E, H */
+
+#elif defined(CONFIG_ARCH_CHIP_STM32L053C8)
+#  define STM32_NATIM           0  /* No advanced timers */
+#  define STM32_NGTIM16         3  /* 16-bit general up/down timers TIM2-3
+                                    * (with DMA) and TIM22 without DMA */
+#  define STM32_NGTIM32         0  /* No 32-bit general up/down timers */
+#  define STM32_NBTIM           1  /* 1 basic timers: TIM6 with DMA */
+                                   /* 1 LPTIMER */
+#  define STM32_NSPI            2  /* 2 SPI modules SPI1 */
+#  define STM32_NI2S            1  /* 1 I2S module */
+#  define STM32_NI2C            2  /* 2 I2C */
+#  define STM32_NDMA            1  /* 1 DMA1, 7-channels */
+#  define STM32_NUSART          2  /* 2 USART modules, USART1-1 */
+                                   /* 1 LPUART */
+#  define STM32_NCAN            0  /* 0 CAN controllers */
+#  define STM32_NLCD            1  /* 1 LCD */
+#  define STM32_NUSBDEV         1  /* 1 USB full-speed device controller */
+#  define STM32_NUSBOTG         0  /* 0 USB OTG FS/HS (only USB 2.0 device) */
+#  define STM32_NCEC            0  /* 0 HDMI-CEC controller */
+#  define STM32_NADC            1  /* One 12-bit module */
+#  define STM32_NDAC            0  /* 0 DAC channel */
+#  define STM32_NCOMP           2  /* 2 Analog Comparators */
+#  define STM32_NCRC            0  /* 0 CRC module */
+#  define STM32_NRNG            0  /* 0 Random number generator (RNG) */
+#  define STM32_NCAP            24 /* 24 Capacitive sensing channels */
+#  define STM32_NPORTS          6  /* Six GPIO ports, GPIOA-E, H */
+
+#elif defined(CONFIG_ARCH_CHIP_STM32L053R8)
+#  define STM32_NATIM           0  /* No advanced timers */
+#  define STM32_NGTIM16         3  /* 16-bit general up/down timers TIM2-3
+                                    * (with DMA) and TIM22 without DMA */
+#  define STM32_NGTIM32         0  /* No 32-bit general up/down timers */
+#  define STM32_NBTIM           1  /* 1 basic timers: TIM6 with DMA */
+                                   /* 1 LPTIMER */
+#  define STM32_NSPI            2  /* 2 SPI modules SPI1 */
+#  define STM32_NI2S            1  /* 1 I2S module */
+#  define STM32_NI2C            2  /* 2 I2C */
+#  define STM32_NDMA            1  /* 1 DMA1, 7-channels */
+#  define STM32_NUSART          2  /* 2 USART modules, USART1-1 */
+                                   /* 1 LPUART */
+#  define STM32_NCAN            0  /* 0 CAN controllers */
+#  define STM32_NLCD            1  /* 1 LCD */
+#  define STM32_NUSBDEV         1  /* 1 USB full-speed device controller */
+#  define STM32_NUSBOTG         0  /* 0 USB OTG FS/HS (only USB 2.0 device) */
+#  define STM32_NCEC            0  /* 0 HDMI-CEC controller */
+#  define STM32_NADC            1  /* One 12-bit module */
+#  define STM32_NDAC            0  /* 0 DAC channel */
+#  define STM32_NCOMP           2  /* 2 Analog Comparators */
+#  define STM32_NCRC            0  /* 0 CRC module */
+#  define STM32_NRNG            0  /* 0 Random number generator (RNG) */
+#  define STM32_NCAP            24 /* 24 Capacitive sensing channels */
+#  define STM32_NPORTS          6  /* Six GPIO ports, GPIOA-E, H */
+
+#elif defined(CONFIG_ARCH_CHIP_STM32L071C8) || 
defined(CONFIG_ARCH_CHIP_STM32L071V8) || \
+      defined(CONFIG_ARCH_CHIP_STM32L071CB) || 
defined(CONFIG_ARCH_CHIP_STM32L071VB) || \
+      defined(CONFIG_ARCH_CHIP_STM32L071RB) || 
defined(CONFIG_ARCH_CHIP_STM32L071CZ) || \
+      defined(CONFIG_ARCH_CHIP_STM32L071VZ) || 
defined(CONFIG_ARCH_CHIP_STM32L071RZ)
+#  define STM32_NATIM           0  /* 0 advanced timers */
+#  define STM32_NGTIM16         4  /* 16-bit general up/down timers TIM2-3
+                                    * (with DMA) and TIM21-22 without DMA */
+#  define STM32_NGTIM32         0  /* 0 32-bit general up/down timers */
+#  define STM32_NBTIM           2  /* 2 basic timers: TIM6, TIM7 with DMA */
+                                   /* 1 LPTIMER */
+#  define STM32_NSPI            2  /* 2 SPI modules SPI1-2 */
+#  define STM32_NI2S            1  /* 1 I2S module */
+#  define STM32_NI2C            3  /* 3 I2C */
+#  define STM32_NDMA            1  /* 1 DMA1, 7-channels */
+#  define STM32_NUSART          4  /* 4 USART modules, USART1-4 */
+                                   /* 1 LPUART */
+#  define STM32_NCAN            0  /* 0 CAN controllers */
+#  define STM32_NLCD            0  /* 0 LCD */
+#  define STM32_NUSBDEV         0  /* 0 USB full-speed device controller */
+#  define STM32_NUSBOTG         0  /* 0 USB OTG FS/HS (only USB 2.0 device) */
+#  define STM32_NCEC            0  /* 0 HDMI-CEC controller */
+#  define STM32_NADC            1  /* One 12-bit module */
+#  define STM32_NDAC            0  /* 0 DAC channel */
+#  define STM32_NCOMP           2  /* 2 Analog Comparators */
+#  define STM32_NCRC            0  /* 0 CRC module */
+#  define STM32_NRNG            0  /* 0 Random number generator (RNG) */
+#  define STM32_NCAP            0  /* 0 Capacitive sensing channels */
+#  define STM32_NPORTS          6  /* Six GPIO ports, GPIOA-E, H */
+
+#elif defined(CONFIG_ARCH_CHIP_STM32L071KB) || 
defined(CONFIG_ARCH_CHIP_STM32L071KZ)
+#  define STM32_NATIM           0  /* 0 advanced timers */
+#  define STM32_NGTIM16         4  /* 16-bit general up/down timers TIM2-3
+                                    * (with DMA) and TIM21-22 without DMA */
+#  define STM32_NGTIM32         0  /* 0 32-bit general up/down timers */
+#  define STM32_NBTIM           2  /* 2 basic timers: TIM6, TIM7 with DMA */
+                                   /* 1 LPTIMER */
+#  define STM32_NSPI            1  /* 1 SPI modules SPI1 */
+#  define STM32_NI2S            0  /* 0 I2S module */
+#  define STM32_NI2C            3  /* 3 I2C */
+#  define STM32_NDMA            1  /* 1 DMA1, 7-channels */
+#  define STM32_NUSART          4  /* 4 USART modules, USART1-4 */
+                                   /* 1 LPUART */
+#  define STM32_NCAN            0  /* 0 CAN controllers */
+#  define STM32_NLCD            0  /* 0 LCD */
+#  define STM32_NUSBDEV         0  /* 0 USB full-speed device controller */
+#  define STM32_NUSBOTG         0  /* 0 USB OTG FS/HS (only USB 2.0 device) */
+#  define STM32_NCEC            0  /* 0 HDMI-CEC controller */
+#  define STM32_NADC            1  /* One 12-bit module */
+#  define STM32_NDAC            0  /* 0 DAC channel */
+#  define STM32_NCOMP           2  /* 2 Analog Comparators */
+#  define STM32_NCRC            0  /* 0 CRC module */
+#  define STM32_NRNG            0  /* 0 Random number generator (RNG) */
+#  define STM32_NCAP            0  /* 0 Capacitive sensing channels */
+#  define STM32_NPORTS          6  /* Six GPIO ports, GPIOA-E, H */
+
+#elif defined(CONFIG_ARCH_CHIP_STM32L072V8) || 
defined(CONFIG_ARCH_CHIP_STM32L072VB) || \
+      defined(CONFIG_ARCH_CHIP_STM32L072VZ)
+#  define STM32_NATIM           0  /* No advanced timers */
+#  define STM32_NGTIM16         4  /* 16-bit general up/down timers TIM2-3
+                                    * (with DMA) and TIM21-22 without DMA */
+#  define STM32_NGTIM32         0  /* No 32-bit general up/down timers */
+#  define STM32_NBTIM           2  /* Two basic timers: TIM6, TIM7 with DMA */
+                                   /* One LPTIMER */
+#  define STM32_NSPI            2  /* Two SPI modules SPI1-2 */
+#  define STM32_NI2S            1  /* One I2S module */
+#  define STM32_NI2C            3  /* Three I2C (2 with SMBus/PMBus) */
+#  define STM32_NDMA            1  /* One DMA1, 7-channels */
+#  define STM32_NUSART          4  /* Four USART modules, USART1-4 */
+                                   /* One LPUART */
+#  define STM32_NCAN            0  /* No CAN controllers */
+#  define STM32_NLCD            0  /* No LCD */
+#  define STM32_NUSBDEV         0  /* No USB full-speed device controller */
+#  define STM32_NUSBOTG         1  /* One USB OTG FS/HS (only USB 2.0 device) 
*/
+#  define STM32_NCEC            0  /* No HDMI-CEC controller */
+#  define STM32_NADC            1  /* One 12-bit module */
+#  define STM32_NDAC            2  /* Two DAC channels */
+#  define STM32_NCOMP           2  /* Two Analog Comparators */
+#  define STM32_NCRC            1  /* One CRC module */
+#  define STM32_NRNG            1  /* One Random number generator (RNG) */
+#  define STM32_NCAP            24 /* Twenty-four Capacitive sensing channels 
*/
+#  define STM32_NPORTS          6  /* Six GPIO ports, GPIOA-E, H */
+
+#elif defined(CONFIG_ARCH_CHIP_STM32L072KB) || 
defined(CONFIG_ARCH_CHIP_STM32L072KZ)
+#  define STM32_NATIM           0  /* No advanced timers */
+#  define STM32_NGTIM16         4  /* 16-bit general up/down timers TIM2-3
+                                    * (with DMA) and TIM21-22 without DMA */
+#  define STM32_NGTIM32         0  /* No 32-bit general up/down timers */
+#  define STM32_NBTIM           2  /* Two basic timers: TIM6, TIM7 with DMA */
+                                   /* One LPTIMER */
+#  define STM32_NSPI            2  /* Two SPI modules SPI1-2 */
+#  define STM32_NI2C            3  /* Three I2C (2 with SMBus/PMBus) */
+#  define STM32_NDMA            1  /* One DMA1, 7-channels */
+#  define STM32_NUSART          4  /* Four USART modules, USART1-4 */
+                                   /* One LPUART */
+#  define STM32_NCAN            0  /* No CAN controllers */
+#  define STM32_NLCD            0  /* No LCD */
+#  define STM32_NUSBDEV         0  /* No USB full-speed device controller */
+#  define STM32_NUSBOTG         1  /* One USB OTG FS/HS (only USB 2.0 device) 
*/
+#  define STM32_NCEC            0  /* No HDMI-CEC controller */
+#  define STM32_NADC            1  /* One 12-bit module */
+#  define STM32_NDAC            2  /* Two DAC channels */
+#  define STM32_NCOMP           2  /* Two Analog Comparators */
+#  define STM32_NCRC            1  /* One CRC module */
+#  define STM32_NRNG            1  /* One Random number generator (RNG) */
+#  define STM32_NCAP            13 /* Thirteen Capacitive sensing channels */
+#  define STM32_NPORTS          6  /* Six GPIO ports, GPIOA-E, H */
+
+#elif defined(CONFIG_ARCH_CHIP_STM32L072CB) || 
defined(CONFIG_ARCH_CHIP_STM32L072CZ)
+#  define STM32_NATIM           0  /* No advanced timers */
+#  define STM32_NGTIM16         4  /* 16-bit general up/down timers TIM2-3
+                                    * (with DMA) and TIM21-22 without DMA */
+#  define STM32_NGTIM32         0  /* No 32-bit general up/down timers */
+#  define STM32_NBTIM           2  /* Two basic timers: TIM6, TIM7 with DMA */
+                                   /* One LPTIMER */
+#  define STM32_NSPI            2  /* Two SPI modules SPI1-2 */
+#  define STM32_NI2S            1  /* One I2S module */
+#  define STM32_NI2C            3  /* Three I2C (2 with SMBus/PMBus) */
+#  define STM32_NDMA            1  /* One DMA1, 7-channels */
+#  define STM32_NUSART          4  /* Four USART modules, USART1-4 */
+                                   /* One LPUART */
+#  define STM32_NCAN            0  /* No CAN controllers */
+#  define STM32_NLCD            0  /* No LCD */
+#  define STM32_NUSBDEV         0  /* No USB full-speed device controller */
+#  define STM32_NUSBOTG         1  /* One USB OTG FS/HS (only USB 2.0 device) 
*/
+#  define STM32_NCEC            0  /* No HDMI-CEC controller */
+#  define STM32_NADC            1  /* One 12-bit module */
+#  define STM32_NDAC            2  /* Two DAC channels */
+#  define STM32_NCOMP           2  /* Two Analog Comparators */
+#  define STM32_NCRC            1  /* One CRC module */
+#  define STM32_NRNG            1  /* One Random number generator (RNG) */
+#  define STM32_NCAP            18 /* Nineteen Capacitive sensing channels */
+#  define STM32_NPORTS          6  /* Six GPIO ports, GPIOA-E, H */
+
+#elif defined(CONFIG_ARCH_CHIP_STM32L072RB) || 
defined(CONFIG_ARCH_CHIP_STM32L072RZ)
+#  define STM32_NATIM           0  /* No advanced timers */
+#  define STM32_NGTIM16         4  /* 16-bit general up/down timers TIM2-3
+                                    * (with DMA) and TIM21-22 without DMA */
+#  define STM32_NGTIM32         0  /* No 32-bit general up/down timers */
+#  define STM32_NBTIM           2  /* Two basic timers: TIM6, TIM7 with DMA */
+                                   /* One LPTIMER */
+#  define STM32_NSPI            2  /* Two SPI modules SPI1-2 */
+#  define STM32_NI2S            1  /* One I2S module */
+#  define STM32_NI2C            3  /* Three I2C (2 with SMBus/PMBus) */
+#  define STM32_NDMA            1  /* One DMA1, 7-channels */
+#  define STM32_NUSART          4  /* Four USART modules, USART1-4 */
+                                   /* One LPUART */
+#  define STM32_NCAN            0  /* No CAN controllers */
+#  define STM32_NLCD            0  /* No LCD */
+#  define STM32_NUSBDEV         0  /* No USB full-speed device controller */
+#  define STM32_NUSBOTG         1  /* One USB OTG FS/HS (only USB 2.0 device) 
*/
+#  define STM32_NCEC            0  /* No HDMI-CEC controller */
+#  define STM32_NADC            1  /* One 12-bit module */
+#  define STM32_NDAC            2  /* Two DAC channels */
+#  define STM32_NCOMP           2  /* Two Analog Comparators */
+#  define STM32_NCRC            1  /* One CRC module */
+#  define STM32_NRNG            1  /* One Random number generator (RNG) */
+#  define STM32_NCAP            24 /* Twenty-four Capacitive sensing channels 
*/
+#  define STM32_NPORTS          6  /* Six GPIO ports, GPIOA-E, H */
+
+#elif defined(CONFIG_ARCH_CHIP_STM32L073V8) || 
defined(CONFIG_ARCH_CHIP_STM32L073VB) || \
+      defined(CONFIG_ARCH_CHIP_STM32L073VZ)
+#  define STM32_NATIM           0  /* No advanced timers */
+#  define STM32_NGTIM16         4  /* 16-bit general up/down timers TIM2-3
+                                    * (with DMA) and TIM21-22 without DMA */
+#  define STM32_NGTIM32         0  /* No 32-bit general up/down timers */
+#  define STM32_NBTIM           2  /* Two basic timers: TIM6, TIM7 with DMA */
+                                   /* One LPTIMER */
+#  define STM32_NSPI            2  /* Two SPI modules SPI1-2 */
+#  define STM32_NI2S            1  /* One I2S module */
+#  define STM32_NI2C            3  /* Three I2C (2 with SMBus/PMBus) */
+#  define STM32_NDMA            1  /* One DMA1, 7-channels */
+#  define STM32_NUSART          4  /* Four USART modules, USART1-4 */
+                                   /* One LPUART */
+#  define STM32_NCAN            0  /* No CAN controllers */
+#  define STM32_NLCD            1  /* One LCD controller */
+#  define STM32_NUSBDEV         0  /* No USB full-speed device controller */
+#  define STM32_NUSBOTG         1  /* One USB OTG FS/HS (only USB 2.0 device) 
*/
+#  define STM32_NCEC            0  /* No HDMI-CEC controller */
+#  define STM32_NADC            1  /* One 12-bit module */
+#  define STM32_NDAC            2  /* Two DAC channels */
+#  define STM32_NCOMP           2  /* Two Analog Comparators */
+#  define STM32_NCRC            1  /* One CRC module */
+#  define STM32_NRNG            1  /* One Random number generator (RNG) */
+#  define STM32_NCAP            24 /* Twenty-four Capacitive sensing channels 
*/
+#  define STM32_NPORTS          6  /* Six GPIO ports, GPIOA-E, H */
+
+#elif defined(CONFIG_ARCH_CHIP_STM32L073CB) || 
defined(CONFIG_ARCH_CHIP_STM32L073CZ)
+#  define STM32_NATIM           0  /* No advanced timers */
+#  define STM32_NGTIM16         4  /* 16-bit general up/down timers TIM2-3
+                                    * (with DMA) and TIM21-22 without DMA */
+#  define STM32_NGTIM32         0  /* No 32-bit general up/down timers */
+#  define STM32_NBTIM           2  /* Two basic timers: TIM6, TIM7 with DMA */
+                                   /* One LPTIMER */
+#  define STM32_NSPI            2  /* Two SPI modules SPI1-2 */
+#  define STM32_NI2S            1  /* One I2S module */
+#  define STM32_NI2C            3  /* Three I2C (2 with SMBus/PMBus) */
+#  define STM32_NDMA            1  /* One DMA1, 7-channels */
+#  define STM32_NUSART          4  /* Four USART modules, USART1-4 */
+                                   /* One LPUART */
+#  define STM32_NCAN            0  /* No CAN controllers */
+#  define STM32_NLCD            1  /* One LCD controller */
+#  define STM32_NUSBDEV         0  /* No USB full-speed device controller */
+#  define STM32_NUSBOTG         1  /* One USB OTG FS/HS (only USB 2.0 device) 
*/
+#  define STM32_NCEC            0  /* No HDMI-CEC controller */
+#  define STM32_NADC            1  /* One 12-bit module */
+#  define STM32_NDAC            2  /* Two DAC channels */
+#  define STM32_NCOMP           2  /* Two Analog Comparators */
+#  define STM32_NCRC            1  /* One CRC module */
+#  define STM32_NRNG            1  /* One Random number generator (RNG) */
+#  define STM32_NCAP            17 /* Seventeen Capacitive sensing channels */
+#  define STM32_NPORTS          6  /* Six GPIO ports, GPIOA-E, H */
+
+#elif defined(CONFIG_ARCH_CHIP_STM32L073RB) || 
defined(CONFIG_ARCH_CHIP_STM32L073RZ)
+#  define STM32_NATIM           0  /* No advanced timers */
+#  define STM32_NGTIM16         4  /* 16-bit general up/down timers TIM2-3
+                                    * (with DMA) and TIM21-22 without DMA */
+#  define STM32_NGTIM32         0  /* No 32-bit general up/down timers */
+#  define STM32_NBTIM           2  /* Two basic timers: TIM6, TIM7 with DMA */
+                                   /* One LPTIMER */
+#  define STM32_NSPI            2  /* Two SPI modules SPI1-2 */
+#  define STM32_NI2S            1  /* One I2S module */
+#  define STM32_NI2C            3  /* Three I2C (2 with SMBus/PMBus) */
+#  define STM32_NDMA            1  /* One DMA1, 7-channels */
+#  define STM32_NUSART          4  /* Four USART modules, USART1-4 */
+                                   /* One LPUART */
+#  define STM32_NCAN            0  /* No CAN controllers */
+#  define STM32_NLCD            1  /* One LCD controller */
+#  define STM32_NUSBDEV         0  /* No USB full-speed device controller */
+#  define STM32_NUSBOTG         1  /* One USB OTG FS/HS (only USB 2.0 device) 
*/
+#  define STM32_NCEC            0  /* No HDMI-CEC controller */
+#  define STM32_NADC            1  /* One 12-bit module */
+#  define STM32_NDAC            2  /* Two DAC channels */
+#  define STM32_NCOMP           2  /* Two Analog Comparators */
+#  define STM32_NCRC            1  /* One CRC module */
+#  define STM32_NRNG            1  /* One Random number generator (RNG) */
+#  define STM32_NCAP            24 /* Twenty-four Capacitive sensing channels 
*/
+#  define STM32_NPORTS          6  /* Six GPIO ports, GPIOA-E, H */
+
+#endif
+
+/* NVIC priority levels *****************************************************/
+
+/* Each priority field holds a priority value, 0-31. The lower the value,
+ * the greater the priority of the corresponding interrupt.  The processor
+ * implements only bits[7:6] of each field, bits[5:0] read as zero and
+ * ignore writes.
+ */
+
+#define NVIC_SYSH_PRIORITY_MIN     0xc0 /* All bits[7:6] set is minimum 
priority */
+#define NVIC_SYSH_PRIORITY_DEFAULT 0x80 /* Midpoint is the default */
+#define NVIC_SYSH_PRIORITY_MAX     0x00 /* Zero is maximum priority */
+#define NVIC_SYSH_PRIORITY_STEP    0x40 /* Two bits of interrupt priority used 
*/
+
+#endif /* __ARCH_ARM_INCLUDE_STM32L0_CHIP_H */
diff --git a/arch/arm/include/stm32f0l0g0/stm32l0_irq.h 
b/arch/arm/include/stm32l0/irq.h
similarity index 76%
rename from arch/arm/include/stm32f0l0g0/stm32l0_irq.h
rename to arch/arm/include/stm32l0/irq.h
index 166815ea7fa..93fe2b0e049 100644
--- a/arch/arm/include/stm32f0l0g0/stm32l0_irq.h
+++ b/arch/arm/include/stm32l0/irq.h
@@ -1,5 +1,5 @@
 /****************************************************************************
- * arch/arm/include/stm32f0l0g0/stm32l0_irq.h
+ * arch/arm/include/stm32l0/irq.h
  *
  * SPDX-License-Identifier: Apache-2.0
  *
@@ -20,34 +20,54 @@
  *
  ****************************************************************************/
 
-/* This file should never be included directly but, rather,
- * only indirectly through nuttx/irq.h
+/* This file should never be included directly but, rather, only indirectly
+ * through nuttx/irq.h
  */
 
-#ifndef __ARCH_ARM_INCLUDE_STM32F0L0G0_STM32L0_IRQ_H
-#define __ARCH_ARM_INCLUDE_STM32F0L0G0_STM32L0_IRQ_H
+#ifndef __ARCH_ARM_INCLUDE_STM32L0_IRQ_H
+#define __ARCH_ARM_INCLUDE_STM32L0_IRQ_H
 
 /****************************************************************************
  * Included Files
  ****************************************************************************/
 
-#include <nuttx/config.h>
-#include <nuttx/irq.h>
-#include <arch/stm32f0l0g0/chip.h>
+#ifndef __ASSEMBLY__
+#  include <stdint.h>
+#endif
+#include <arch/stm32l0/chip.h>
 
 /****************************************************************************
  * Pre-processor Prototypes
  ****************************************************************************/
 
-/* IRQ numbers.
- * The IRQ number corresponds vector number and hence map directly to
- * bits in the NVIC.  This does, however, waste several words of memory in
- * the IRQ to handle mapping tables.
- *
- * Processor Exceptions (vectors 0-15).  These common definitions
- * can be found in nuttx/arch/arm/include/stm32f0l0g0/irq.h
+/* IRQ numbers.  The IRQ number corresponds vector number and hence map
+ * directly to bits in the NVIC.  This does, however, waste several words of
+ * memory in the IRQ to handle mapping tables.
  */
 
+/* Common Processor Exceptions (vectors 0-15) */
+
+#define STM32_IRQ_RESERVED       (0) /* Reserved vector (only used with 
CONFIG_DEBUG_FEATURES) */
+                                     /* Vector  0: Reset stack pointer value */
+                                     /* Vector  1: Reset (not handler as an 
IRQ) */
+#define STM32_IRQ_NMI            (2) /* Vector  2: Non-Maskable Interrupt 
(NMI) */
+#define STM32_IRQ_HARDFAULT      (3) /* Vector  3: Hard fault */
+                                     /* Vectors 4-10: Reserved */
+#define STM32_IRQ_SVCALL        (11) /* Vector 11: SVC call */
+                                     /* Vector 12-13: Reserved */
+#define STM32_IRQ_PENDSV        (14) /* Vector 14: Pendable system service 
request */
+#define STM32_IRQ_SYSTICK       (15) /* Vector 15: System tick */
+
+/* External interrupts (vectors >= 16) */
+
+#define STM32_IRQ_EXTINT        (16) /* Vector number of the first external 
interrupt */
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+/* External interrupt vectors */
+
 #define STM32_IRQ_WWDG        (STM32_IRQ_EXTINT + 0)  /* 0:  Window Watchdog 
interrupt */
 #define STM32_IRQ_PVD         (STM32_IRQ_EXTINT + 1)  /* 1:  PVD through EXTI 
Line detection interrupt */
 #define STM32_IRQ_RTC         (STM32_IRQ_EXTINT + 2)  /* 2:  RTC global 
interrupt */
@@ -92,31 +112,6 @@
 
 #define STM32_IRQ_NEXTINTS    (32)
 
-/****************************************************************************
- * Public Types
- ****************************************************************************/
-
-/****************************************************************************
- * Public Data
- ****************************************************************************/
-
-#ifndef __ASSEMBLY__
-#ifdef __cplusplus
-#define EXTERN extern "C"
-extern "C"
-{
-#else
-#define EXTERN extern
-#endif
-
-/****************************************************************************
- * Public Functions Prototypes
- ****************************************************************************/
-
-#undef EXTERN
-#ifdef __cplusplus
-}
-#endif
-#endif
+#define NR_IRQS               (STM32_IRQ_EXTINT + STM32_IRQ_NEXTINTS)
 
-#endif /* __ARCH_ARM_INCLUDE_STM32F0L0G0_STM32L0_IRQ_H */
+#endif /* __ARCH_ARM_INCLUDE_STM32L0_IRQ_H */
diff --git a/boards/arm/stm32f0l0g0/stm32l0538-disco/src/CMakeLists.txt 
b/arch/arm/src/stm32l0/CMakeLists.txt
similarity index 71%
copy from boards/arm/stm32f0l0g0/stm32l0538-disco/src/CMakeLists.txt
copy to arch/arm/src/stm32l0/CMakeLists.txt
index 2d3a59a01db..0b2c640ff2d 100644
--- a/boards/arm/stm32f0l0g0/stm32l0538-disco/src/CMakeLists.txt
+++ b/arch/arm/src/stm32l0/CMakeLists.txt
@@ -1,5 +1,5 @@
 # 
##############################################################################
-# boards/arm/stm32f0l0g0/stm32l0538-disco/src/CMakeLists.txt
+# arch/arm/src/stm32l0/CMakeLists.txt
 #
 # SPDX-License-Identifier: Apache-2.0
 #
@@ -20,18 +20,13 @@
 #
 # 
##############################################################################
 
-set(SRCS stm32_boot.c stm32_bringup.c)
+set(SRCS)
 
-if(CONFIG_ARCH_LEDS)
-  list(APPEND SRCS stm32_autoleds.c)
-else()
-  list(APPEND SRCS stm32_userleds.c)
-endif()
+list(APPEND SRCS stm32_rcc.c)
 
-if(CONFIG_ARCH_BUTTONS)
-  list(APPEND SRCS stm32_buttons.c)
+if(CONFIG_BUILD_PROTECTED)
+  list(APPEND SRCS stm32_userspace.c)
 endif()
 
-target_sources(board PRIVATE ${SRCS})
-
-set_property(GLOBAL PROPERTY LD_SCRIPT "${NUTTX_BOARD_DIR}/scripts/ld.script")
+target_sources(arch PRIVATE ${SRCS})
+add_subdirectory(${NUTTX_DIR}/arch/arm/src/common/stm32 stm32_common)
diff --git a/arch/arm/src/stm32l0/Kconfig b/arch/arm/src/stm32l0/Kconfig
new file mode 100644
index 00000000000..6d71aebe758
--- /dev/null
+++ b/arch/arm/src/stm32l0/Kconfig
@@ -0,0 +1,273 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+comment "STM32 L0 configuration"
+
+if ARCH_CHIP_STM32L0
+
+choice
+       prompt "ST STM32L0 Chip Selection"
+       default ARCH_CHIP_STM32L073RZ
+       depends on ARCH_CHIP_STM32L0
+
+config ARCH_CHIP_STM32L053C8
+       bool "STM32L053C8"
+       select ARCH_CHIP_STM32L053XX
+       depends on ARCH_CHIP_STM32L0
+
+config ARCH_CHIP_STM32L053R8
+       bool "STM32L053R8"
+       select ARCH_CHIP_STM32L053XX
+       depends on ARCH_CHIP_STM32L0
+
+config ARCH_CHIP_STM32L071K8
+       bool "STM32L071K8"
+       select ARCH_CHIP_STM32L071XX
+       depends on ARCH_CHIP_STM32L0
+
+config ARCH_CHIP_STM32L071KB
+       bool "STM32L071KB"
+       select ARCH_CHIP_STM32L071XX
+       depends on ARCH_CHIP_STM32L0
+
+config ARCH_CHIP_STM32L071KZ
+       bool "STM32L071KZ"
+       select ARCH_CHIP_STM32L071XX
+       depends on ARCH_CHIP_STM32L0
+
+config ARCH_CHIP_STM32L071C8
+       bool "STM32L071C8"
+       select ARCH_CHIP_STM32L071XX
+       select STM32_HAVE_USART5
+       select STM32_HAVE_SPI2
+       select STM32_HAVE_I2C3
+       depends on ARCH_CHIP_STM32L0
+
+config ARCH_CHIP_STM32L071CB
+       bool "STM32L071CB"
+       select ARCH_CHIP_STM32L071XX
+       select STM32_HAVE_USART5
+       select STM32_HAVE_SPI2
+       select STM32_HAVE_I2C3
+       depends on ARCH_CHIP_STM32L0
+
+config ARCH_CHIP_STM32L071CZ
+       bool "STM32L071CZ"
+       select ARCH_CHIP_STM32L071XX
+       select STM32_HAVE_USART5
+       select STM32_HAVE_SPI2
+       select STM32_HAVE_I2C3
+       depends on ARCH_CHIP_STM32L0
+
+config ARCH_CHIP_STM32L071V8
+       bool "STM32L071V8"
+       select ARCH_CHIP_STM32L071XX
+       select STM32_HAVE_USART5
+       select STM32_HAVE_SPI2
+       select STM32_HAVE_I2C3
+       depends on ARCH_CHIP_STM32L0
+
+config ARCH_CHIP_STM32L071VB
+       bool "STM32L071VB"
+       select ARCH_CHIP_STM32L071XX
+       select STM32_HAVE_USART5
+       select STM32_HAVE_SPI2
+       select STM32_HAVE_I2C3
+       depends on ARCH_CHIP_STM32L0
+
+config ARCH_CHIP_STM32L071VZ
+       bool "STM32L071VZ"
+       select ARCH_CHIP_STM32L071XX
+       select STM32_HAVE_USART5
+       select STM32_HAVE_SPI2
+       select STM32_HAVE_I2C3
+       depends on ARCH_CHIP_STM32L0
+
+config ARCH_CHIP_STM32L071RB
+       bool "STM32L071RB"
+       select ARCH_CHIP_STM32L071XX
+       select STM32_HAVE_USART5
+       select STM32_HAVE_SPI2
+       select STM32_HAVE_I2C3
+       depends on ARCH_CHIP_STM32L0
+
+config ARCH_CHIP_STM32L071RZ
+       bool "STM32L071RZ"
+       select ARCH_CHIP_STM32L071XX
+       select STM32_HAVE_USART5
+       select STM32_HAVE_SPI2
+       select STM32_HAVE_I2C3
+       depends on ARCH_CHIP_STM32L0
+
+config ARCH_CHIP_STM32L072V8
+       bool "STM32L072V8"
+       select ARCH_CHIP_STM32L072XX
+       select STM32_HAVE_SPI2
+       select STM32_HAVE_I2C3
+       depends on ARCH_CHIP_STM32L0
+
+config ARCH_CHIP_STM32L072VB
+       bool "STM32L072VB"
+       select ARCH_CHIP_STM32L072XX
+       select STM32_HAVE_SPI2
+       select STM32_HAVE_I2C3
+       depends on ARCH_CHIP_STM32L0
+
+config ARCH_CHIP_STM32L072VZ
+       bool "STM32L072VZ"
+       select ARCH_CHIP_STM32L072XX
+       select STM32_HAVE_SPI2
+       select STM32_HAVE_I2C3
+       depends on ARCH_CHIP_STM32L0
+
+config ARCH_CHIP_STM32L072KB
+       bool "STM32L072KB"
+       select ARCH_CHIP_STM32L072XX
+       depends on ARCH_CHIP_STM32L0
+
+config ARCH_CHIP_STM32L072KZ
+       bool "STM32L072KZ"
+       select ARCH_CHIP_STM32L072XX
+       depends on ARCH_CHIP_STM32L0
+
+config ARCH_CHIP_STM32L072CB
+       bool "STM32L072CB"
+       select ARCH_CHIP_STM32L072XX
+       select STM32_HAVE_SPI2
+       select STM32_HAVE_I2C3
+       depends on ARCH_CHIP_STM32L0
+
+config ARCH_CHIP_STM32L072CZ
+       bool "STM32L072CZ"
+       select ARCH_CHIP_STM32L072XX
+       select STM32_HAVE_SPI2
+       select STM32_HAVE_I2C3
+       depends on ARCH_CHIP_STM32L0
+
+config ARCH_CHIP_STM32L072RB
+       bool "STM32L072RB"
+       select ARCH_CHIP_STM32L072XX
+       select STM32_HAVE_SPI2
+       select STM32_HAVE_I2C3
+       depends on ARCH_CHIP_STM32L0
+
+config ARCH_CHIP_STM32L072RZ
+       bool "STM32L072RZ"
+       select ARCH_CHIP_STM32L072XX
+       select STM32_HAVE_SPI2
+       select STM32_HAVE_I2C3
+       depends on ARCH_CHIP_STM32L0
+
+config ARCH_CHIP_STM32L073V8
+       bool "STM32L073V8"
+       select ARCH_CHIP_STM32L073XX
+       depends on ARCH_CHIP_STM32L0
+
+config ARCH_CHIP_STM32L073VB
+       bool "STM32L073VB"
+       select ARCH_CHIP_STM32L073XX
+       depends on ARCH_CHIP_STM32L0
+
+config ARCH_CHIP_STM32L073VZ
+       bool "STM32L073VZ"
+       select ARCH_CHIP_STM32L073XX
+       depends on ARCH_CHIP_STM32L0
+
+config ARCH_CHIP_STM32L073CB
+       bool "STM32L073CB"
+       select ARCH_CHIP_STM32L073XX
+       depends on ARCH_CHIP_STM32L0
+
+config ARCH_CHIP_STM32L073CZ
+       bool "STM32L073CZ"
+       select ARCH_CHIP_STM32L073XX
+       depends on ARCH_CHIP_STM32L0
+
+config ARCH_CHIP_STM32L073RB
+       bool "STM32L073RB"
+       select ARCH_CHIP_STM32L073XX
+       depends on ARCH_CHIP_STM32L0
+
+config ARCH_CHIP_STM32L073RZ
+       bool "STM32L073RZ"
+       select ARCH_CHIP_STM32L073XX
+       depends on ARCH_CHIP_STM32L0
+
+endchoice
+
+endif
+
+config STM32_STM32L0
+       bool
+       default n
+       select STM32_HAVE_DMA1
+       select STM32_HAVE_I2C1
+       select STM32_HAVE_SPI1
+       select STM32_HAVE_USART1
+       select STM32_HAVE_USART2
+       select STM32_ENERGYLITE
+       select STM32_HAVE_LCD
+       select STM32_HAVE_VREFINT
+       select STM32_HAVE_IP_ADC_M0_V1
+       select STM32_HAVE_CRC
+       select STM32_HAVE_PWR
+       select STM32_HAVE_BKP
+       select STM32_HAVE_BKPSRAM
+       select STM32_HAVE_IP_AES_M0_V1 if STM32_HAVE_AES
+       select STM32_HAVE_IP_COMP_M0_V1 if STM32_HAVE_COMP
+       select STM32_HAVE_IP_DAC_M0_V1 if STM32_HAVE_DAC1
+       select STM32_HAVE_IP_DBGMCU_M0_V1
+       select STM32_HAVE_IP_DMA_V1
+       select STM32_HAVE_IP_DMA_V1_7CH
+       select STM32_HAVE_IP_EXTI_V1
+       select STM32_HAVE_IP_FLASH_M0_V1
+       select STM32_HAVE_IP_GPIO_M0_V1
+       select STM32_HAVE_IP_I2C_M0_V1
+       select STM32_HAVE_IP_PWR_M0_V1
+       select STM32_HAVE_IP_SPI_V1
+       select STM32_HAVE_IP_TIMERS_M0_V1
+       select STM32_HAVE_IP_USART_V3
+       select STM32_HAVE_IP_WDG_M0_V1
+       select STM32_HAVE_IP_UID_M0_V1
+       select STM32_HAVE_IP_RNG_M0_V1 if STM32_HAVE_RNG
+       select STM32_HAVE_IP_RTCC_M0_V1
+       select STM32_HAVE_IP_USBDEV_M0_V1 if STM32_HAVE_USBDEV
+       select STM32_HAVE_IP_HSI48_M0_V1 if STM32_HAVE_HSI48
+
+config ARCH_CHIP_STM32L053XX
+       bool
+       select STM32_STM32L0
+
+config ARCH_CHIP_STM32L071XX
+       bool
+       select STM32_STM32L0
+       select STM32_HAVE_RNG
+       select STM32_HAVE_HSI48
+       select STM32_HAVE_USART4
+
+config ARCH_CHIP_STM32L072XX
+       bool
+       select STM32_STM32L0
+       select STM32_HAVE_RNG
+       select STM32_HAVE_HSI48
+       select STM32_HAVE_USART4
+       select STM32_HAVE_USART5
+       select STM32_HAVE_I2C2
+       select STM32_HAVE_USBDEV
+
+config ARCH_CHIP_STM32L073XX
+       bool
+       select STM32_STM32L0
+       select STM32_HAVE_RNG
+       select STM32_HAVE_HSI48
+       select STM32_HAVE_USART4
+       select STM32_HAVE_USART5
+       select STM32_HAVE_SPI2
+       select STM32_HAVE_I2C2
+       select STM32_HAVE_I2C3
+       select STM32_HAVE_USBDEV
+
+config STM32_FLASH_OVERRIDE
+       bool "Override Flash Designator"
+       default n
diff --git a/boards/arm/stm32f0l0g0/stm32l0538-disco/src/Make.defs 
b/arch/arm/src/stm32l0/Make.defs
similarity index 66%
copy from boards/arm/stm32f0l0g0/stm32l0538-disco/src/Make.defs
copy to arch/arm/src/stm32l0/Make.defs
index 502d059a105..41ee69999f4 100644
--- a/boards/arm/stm32f0l0g0/stm32l0538-disco/src/Make.defs
+++ b/arch/arm/src/stm32l0/Make.defs
@@ -1,5 +1,5 @@
 ############################################################################
-# boards/arm/stm32f0l0g0/stm32l0538-disco/src/Make.defs
+# arch/arm/src/stm32l0/Make.defs
 #
 # SPDX-License-Identifier: Apache-2.0
 #
@@ -10,7 +10,7 @@
 # "License"); you may not use this file except in compliance with the
 # License.  You may obtain a copy of the License at
 #
-#  http://www.apache.org/licenses/LICENSE-2.0
+#   http://www.apache.org/licenses/LICENSE-2.0
 #
 # Unless required by applicable law or agreed to in writing, software
 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
@@ -20,20 +20,12 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include armv6-m/Make.defs
 
-CSRCS = stm32_boot.c stm32_bringup.c
+CHIP_CSRCS  = stm32_rcc.c
 
-ifeq ($(CONFIG_ARCH_LEDS),y)
-CSRCS += stm32_autoleds.c
-else
-CSRCS += stm32_userleds.c
+ifeq ($(CONFIG_BUILD_PROTECTED),y)
+CHIP_CSRCS += stm32_userspace.c
 endif
 
-ifeq ($(CONFIG_ARCH_BUTTONS),y)
-CSRCS += stm32_buttons.c
-endif
-
-DEPPATH += --dep-path board
-VPATH += :board
-CFLAGS += 
${INCDIR_PREFIX}$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)board
+include common/stm32/Make.defs
diff --git a/arch/arm/src/stm32l0/chip.h b/arch/arm/src/stm32l0/chip.h
new file mode 100644
index 00000000000..f5e1ecde93e
--- /dev/null
+++ b/arch/arm/src/stm32l0/chip.h
@@ -0,0 +1,44 @@
+/****************************************************************************
+ * arch/arm/src/stm32l0/chip.h
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __ARCH_ARM_SRC_STM32L0_CHIP_H
+#define __ARCH_ARM_SRC_STM32L0_CHIP_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+#include "nvic.h"
+
+/* Include the chip capabilities file */
+
+#include <arch/stm32l0/chip.h>
+
+/* Include the memory map file.
+ * Other chip hardware files should then include this file for the proper
+ * setup.
+ */
+
+#include "hardware/stm32_memorymap.h"
+
+#endif /* __ARCH_ARM_SRC_STM32L0_CHIP_H */
diff --git a/arch/arm/src/stm32l0/hardware/stm32_memorymap.h 
b/arch/arm/src/stm32l0/hardware/stm32_memorymap.h
new file mode 100644
index 00000000000..44f335487ab
--- /dev/null
+++ b/arch/arm/src/stm32l0/hardware/stm32_memorymap.h
@@ -0,0 +1,17 @@
+/****************************************************************************
+ * arch/arm/src/stm32l0/hardware/stm32_memorymap.h
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ ****************************************************************************/
+
+#ifndef __ARCH_ARM_SRC_STM32L0_HARDWARE_STM32_MEMORYMAP_H
+#define __ARCH_ARM_SRC_STM32L0_HARDWARE_STM32_MEMORYMAP_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include "hardware/stm32l0_memorymap.h"
+
+#endif /* __ARCH_ARM_SRC_STM32L0_HARDWARE_STM32_MEMORYMAP_H */
diff --git a/arch/arm/src/stm32l0/hardware/stm32_pinmap.h 
b/arch/arm/src/stm32l0/hardware/stm32_pinmap.h
new file mode 100644
index 00000000000..680c386947b
--- /dev/null
+++ b/arch/arm/src/stm32l0/hardware/stm32_pinmap.h
@@ -0,0 +1,17 @@
+/****************************************************************************
+ * arch/arm/src/stm32l0/hardware/stm32_pinmap.h
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ ****************************************************************************/
+
+#ifndef __ARCH_ARM_SRC_STM32L0_HARDWARE_STM32_PINMAP_H
+#define __ARCH_ARM_SRC_STM32L0_HARDWARE_STM32_PINMAP_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include "hardware/stm32l0_pinmap.h"
+
+#endif /* __ARCH_ARM_SRC_STM32L0_HARDWARE_STM32_PINMAP_H */
diff --git a/arch/arm/src/stm32f0l0g0/hardware/stm32l0_exti.h 
b/arch/arm/src/stm32l0/hardware/stm32l0_exti.h
similarity index 96%
rename from arch/arm/src/stm32f0l0g0/hardware/stm32l0_exti.h
rename to arch/arm/src/stm32l0/hardware/stm32l0_exti.h
index 4f246ccd8f7..dea6972eae5 100644
--- a/arch/arm/src/stm32f0l0g0/hardware/stm32l0_exti.h
+++ b/arch/arm/src/stm32l0/hardware/stm32l0_exti.h
@@ -1,5 +1,5 @@
 /****************************************************************************
- * arch/arm/src/stm32f0l0g0/hardware/stm32l0_exti.h
+ * arch/arm/src/stm32l0/hardware/stm32l0_exti.h
  *
  * SPDX-License-Identifier: Apache-2.0
  *
@@ -20,8 +20,8 @@
  *
  ****************************************************************************/
 
-#ifndef __ARCH_ARM_SRC_STM32F0L0G0_HARDWARE_STM32L0_EXTI_H
-#define __ARCH_ARM_SRC_STM32F0L0G0_HARDWARE_STM32L0_EXTI_H
+#ifndef __ARCH_ARM_SRC_STM32L0_HARDWARE_STM32L0_EXTI_H
+#define __ARCH_ARM_SRC_STM32L0_HARDWARE_STM32L0_EXTI_H
 
 /****************************************************************************
  * Included Files
@@ -116,4 +116,4 @@
 #define EXTI_PR_SHIFT            (0)                /* Bits 0-X: Pending bit 
for all lines */
 #define EXTI_PR_MASK             STM32_EXTI_MASK
 
-#endif /* __ARCH_ARM_SRC_STM32F0L0G0_HARDWARE_STM32L0_EXTI_H */
+#endif /* __ARCH_ARM_SRC_STM32L0_HARDWARE_STM32L0_EXTI_H */
diff --git a/arch/arm/src/stm32f0l0g0/hardware/stm32l0_flash.h 
b/arch/arm/src/stm32l0/hardware/stm32l0_flash.h
similarity index 95%
rename from arch/arm/src/stm32f0l0g0/hardware/stm32l0_flash.h
rename to arch/arm/src/stm32l0/hardware/stm32l0_flash.h
index 489d8588f18..2f22a50f7f8 100644
--- a/arch/arm/src/stm32f0l0g0/hardware/stm32l0_flash.h
+++ b/arch/arm/src/stm32l0/hardware/stm32l0_flash.h
@@ -1,5 +1,5 @@
 /****************************************************************************
- * arch/arm/src/stm32f0l0g0/hardware/stm32l0_flash.h
+ * arch/arm/src/stm32l0/hardware/stm32l0_flash.h
  *
  * SPDX-License-Identifier: Apache-2.0
  *
@@ -20,8 +20,8 @@
  *
  ****************************************************************************/
 
-#ifndef __ARCH_ARM_SRC_STM32F0L0G0_HARDWARE_STM32L0_FLASH_H
-#define __ARCH_ARM_SRC_STM32F0L0G0_HARDWARE_STM32L0_FLASH_H
+#ifndef __ARCH_ARM_SRC_STM32L0_HARDWARE_STM32L0_FLASH_H
+#define __ARCH_ARM_SRC_STM32L0_HARDWARE_STM32L0_FLASH_H
 
 /****************************************************************************
  * Included Files
@@ -102,4 +102,4 @@
 #define FLASH_SR_OPTVERRUSR         (1 << 12) /* Bit 12: Option UserValidity 
Error */
 #define FLASH_SR_RDERR              (1 << 13) /* Bit 13: Read protected error 
*/
 
-#endif /* __ARCH_ARM_SRC_STM32F0L0G0_HARDWARE_STM32L0_FLASH_H */
+#endif /* __ARCH_ARM_SRC_STM32L0_HARDWARE_STM32L0_FLASH_H */
diff --git a/arch/arm/src/stm32f0l0g0/hardware/stm32l0_memorymap.h 
b/arch/arm/src/stm32l0/hardware/stm32l0_memorymap.h
similarity index 96%
rename from arch/arm/src/stm32f0l0g0/hardware/stm32l0_memorymap.h
rename to arch/arm/src/stm32l0/hardware/stm32l0_memorymap.h
index 30da782402d..dfdb2b3c4bc 100644
--- a/arch/arm/src/stm32f0l0g0/hardware/stm32l0_memorymap.h
+++ b/arch/arm/src/stm32l0/hardware/stm32l0_memorymap.h
@@ -1,5 +1,5 @@
 /****************************************************************************
- * arch/arm/src/stm32f0l0g0/hardware/stm32l0_memorymap.h
+ * arch/arm/src/stm32l0/hardware/stm32l0_memorymap.h
  *
  * SPDX-License-Identifier: Apache-2.0
  *
@@ -20,8 +20,8 @@
  *
  ****************************************************************************/
 
-#ifndef __ARCH_ARM_SRC_STM32F0L0G0_HARDWARE_STM32L0_MEMORYMAP_H
-#define __ARCH_ARM_SRC_STM32F0L0G0_HARDWARE_STM32L0_MEMORYMAP_H
+#ifndef __ARCH_ARM_SRC_STM32L0_HARDWARE_STM32L0_MEMORYMAP_H
+#define __ARCH_ARM_SRC_STM32L0_HARDWARE_STM32L0_MEMORYMAP_H
 
 /****************************************************************************
  * Pre-processor Definitions
@@ -118,4 +118,4 @@
 
 #define STM32_SYSMEM_UID     0x1ff80050     /* The 96-bit unique device 
identifier */
 
-#endif /* __ARCH_ARM_SRC_STM32F0L0G0_HARDWARE_STM32L0_MEMORYMAP_H */
+#endif /* __ARCH_ARM_SRC_STM32L0_HARDWARE_STM32L0_MEMORYMAP_H */
diff --git a/arch/arm/src/stm32f0l0g0/hardware/stm32l0_pinmap.h 
b/arch/arm/src/stm32l0/hardware/stm32l0_pinmap.h
similarity index 98%
rename from arch/arm/src/stm32f0l0g0/hardware/stm32l0_pinmap.h
rename to arch/arm/src/stm32l0/hardware/stm32l0_pinmap.h
index a47d0df7245..9e18b9be9ab 100644
--- a/arch/arm/src/stm32f0l0g0/hardware/stm32l0_pinmap.h
+++ b/arch/arm/src/stm32l0/hardware/stm32l0_pinmap.h
@@ -1,5 +1,5 @@
 /****************************************************************************
- * arch/arm/src/stm32f0l0g0/hardware/stm32l0_pinmap.h
+ * arch/arm/src/stm32l0/hardware/stm32l0_pinmap.h
  *
  * SPDX-License-Identifier: Apache-2.0
  *
@@ -20,8 +20,8 @@
  *
  ****************************************************************************/
 
-#ifndef __ARCH_ARM_SRC_STM32F0L0G0_HARDWARE_STM32L0_PINMAP_H
-#define __ARCH_ARM_SRC_STM32F0L0G0_HARDWARE_STM32L0_PINMAP_H
+#ifndef __ARCH_ARM_SRC_STM32L0_HARDWARE_STM32L0_PINMAP_H
+#define __ARCH_ARM_SRC_STM32L0_HARDWARE_STM32L0_PINMAP_H
 
 /****************************************************************************
  * Included Files
@@ -326,4 +326,4 @@
 
 /* TODO: LPUART */
 
-#endif /* __ARCH_ARM_SRC_STM32F0L0G0_HARDWARE_STM32L0_PINMAP_H */
+#endif /* __ARCH_ARM_SRC_STM32L0_HARDWARE_STM32L0_PINMAP_H */
diff --git a/arch/arm/src/stm32f0l0g0/hardware/stm32l0_pwr.h 
b/arch/arm/src/stm32l0/hardware/stm32l0_pwr.h
similarity index 95%
rename from arch/arm/src/stm32f0l0g0/hardware/stm32l0_pwr.h
rename to arch/arm/src/stm32l0/hardware/stm32l0_pwr.h
index b5c00fa05e0..9f98c41d294 100644
--- a/arch/arm/src/stm32f0l0g0/hardware/stm32l0_pwr.h
+++ b/arch/arm/src/stm32l0/hardware/stm32l0_pwr.h
@@ -1,5 +1,5 @@
 /****************************************************************************
- * arch/arm/src/stm32f0l0g0/hardware/stm32l0_pwr.h
+ * arch/arm/src/stm32l0/hardware/stm32l0_pwr.h
  *
  * SPDX-License-Identifier: Apache-2.0
  *
@@ -20,8 +20,8 @@
  *
  ****************************************************************************/
 
-#ifndef __ARCH_ARM_SRC_STM32F0L0G0_HARDWARE_STM32L0_PWR_H
-#define __ARCH_ARM_SRC_STM32F0L0G0_HARDWARE_STM32L0_PWR_H
+#ifndef __ARCH_ARM_SRC_STM32L0_HARDWARE_STM32L0_PWR_H
+#define __ARCH_ARM_SRC_STM32L0_HARDWARE_STM32L0_PWR_H
 
 /****************************************************************************
  * Included Files
@@ -91,4 +91,4 @@
 #define PWR_CSR_EWUP2          (1 << 9)  /* Bit 9:  Enable WKUP2 pin */
 #define PWR_CSR_EWUP3          (1 << 10) /* Bit 10: Enable WKUP3 pin */
 
-#endif /* __ARCH_ARM_SRC_STM32F0L0G0_HARDWARE_STM32L0_PWR_H */
+#endif /* __ARCH_ARM_SRC_STM32L0_HARDWARE_STM32L0_PWR_H */
diff --git a/arch/arm/src/stm32f0l0g0/hardware/stm32l0_rcc.h 
b/arch/arm/src/stm32l0/hardware/stm32l0_rcc.h
similarity index 99%
rename from arch/arm/src/stm32f0l0g0/hardware/stm32l0_rcc.h
rename to arch/arm/src/stm32l0/hardware/stm32l0_rcc.h
index 42a19e50100..1b924ce6870 100644
--- a/arch/arm/src/stm32f0l0g0/hardware/stm32l0_rcc.h
+++ b/arch/arm/src/stm32l0/hardware/stm32l0_rcc.h
@@ -1,5 +1,5 @@
 /****************************************************************************
- * arch/arm/src/stm32f0l0g0/hardware/stm32l0_rcc.h
+ * arch/arm/src/stm32l0/hardware/stm32l0_rcc.h
  *
  * SPDX-License-Identifier: Apache-2.0
  *
@@ -20,8 +20,8 @@
  *
  ****************************************************************************/
 
-#ifndef __ARCH_ARM_SRC_STM32F0L0G0_HARDWARE_STM32L0_RCC_H
-#define __ARCH_ARM_SRC_STM32F0L0G0_HARDWARE_STM32L0_RCC_H
+#ifndef __ARCH_ARM_SRC_STM32L0_HARDWARE_STM32L0_RCC_H
+#define __ARCH_ARM_SRC_STM32L0_HARDWARE_STM32L0_RCC_H
 
 /****************************************************************************
  * Pre-processor Definitions
@@ -538,4 +538,4 @@
 #define RCC_CSR_WWDGRSTF                (1 << 30) /* Bit 30: WWDG reset flag */
 #define RCC_CSR_LPWRRSTF                (1 << 31) /* Bit 31: Low-power reset 
flag */
 
-#endif /* __ARCH_ARM_SRC_STM32F0L0G0_HARDWARE_STM32L0_RCC_H */
+#endif /* __ARCH_ARM_SRC_STM32L0_HARDWARE_STM32L0_RCC_H */
diff --git a/arch/arm/src/stm32f0l0g0/hardware/stm32l0_syscfg.h 
b/arch/arm/src/stm32l0/hardware/stm32l0_syscfg.h
similarity index 97%
rename from arch/arm/src/stm32f0l0g0/hardware/stm32l0_syscfg.h
rename to arch/arm/src/stm32l0/hardware/stm32l0_syscfg.h
index 85d28dc0ce9..e3dd1bf7159 100644
--- a/arch/arm/src/stm32f0l0g0/hardware/stm32l0_syscfg.h
+++ b/arch/arm/src/stm32l0/hardware/stm32l0_syscfg.h
@@ -1,5 +1,5 @@
 /****************************************************************************
- * arch/arm/src/stm32f0l0g0/hardware/stm32l0_syscfg.h
+ * arch/arm/src/stm32l0/hardware/stm32l0_syscfg.h
  *
  * SPDX-License-Identifier: Apache-2.0
  *
@@ -20,8 +20,8 @@
  *
  ****************************************************************************/
 
-#ifndef __ARCH_ARM_SRC_STM32F0L0G0_HARDWARE_STM32L0_SYSCFG_H
-#define __ARCH_ARM_SRC_STM32F0L0G0_HARDWARE_STM32L0_SYSCFG_H
+#ifndef __ARCH_ARM_SRC_STM32L0_HARDWARE_STM32L0_SYSCFG_H
+#define __ARCH_ARM_SRC_STM32L0_HARDWARE_STM32L0_SYSCFG_H
 
 /****************************************************************************
  * Included Files
@@ -132,4 +132,4 @@
 #define SYSCFG_EXTICR4_EXTI15_SHIFT   (12)      /* Bits 12-15: EXTI 15 
configuration */
 #define SYSCFG_EXTICR4_EXTI15_MASK    (SYSCFG_EXTICR_PORT_MASK << 
SYSCFG_EXTICR4_EXTI15_SHIFT)
 
-#endif /* __ARCH_ARM_SRC_STM32F0L0G0_HARDWARE_STM32L0_SYSCFG_H */
+#endif /* __ARCH_ARM_SRC_STM32L0_HARDWARE_STM32L0_SYSCFG_H */
diff --git a/boards/arm/stm32f0l0g0/stm32l0538-disco/src/stm32_autoleds.c 
b/arch/arm/src/stm32l0/stm32.h
similarity index 56%
copy from boards/arm/stm32f0l0g0/stm32l0538-disco/src/stm32_autoleds.c
copy to arch/arm/src/stm32l0/stm32.h
index b7564b91312..cdcdb2d4aa7 100644
--- a/boards/arm/stm32f0l0g0/stm32l0538-disco/src/stm32_autoleds.c
+++ b/arch/arm/src/stm32l0/stm32.h
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/arm/stm32f0l0g0/stm32l0538-disco/src/stm32_autoleds.c
+ * arch/arm/src/stm32l0/stm32.h
  *
  * SPDX-License-Identifier: Apache-2.0
  *
@@ -20,61 +20,35 @@
  *
  ****************************************************************************/
 
+#ifndef __ARCH_ARM_SRC_STM32L0_STM32_H
+#define __ARCH_ARM_SRC_STM32L0_STM32_H
+
 /****************************************************************************
  * Included Files
  ****************************************************************************/
 
 #include <nuttx/config.h>
-
+#include <sys/types.h>
 #include <stdint.h>
 #include <stdbool.h>
 
-#include <nuttx/board.h>
-
-#include "stm32_gpio.h"
-#include "stm32l0538-disco.h"
-
-#include <arch/board/board.h>
-
-#ifdef CONFIG_ARCH_LEDS
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: board_autoled_initialize
- ****************************************************************************/
+#include "arm_internal.h"
 
-void board_autoled_initialize(void)
-{
-  /* Configure LED1 GPIO for output */
+/* Peripherals **************************************************************/
 
-  stm32_configgpio(GPIO_LED1);
-}
-
-/****************************************************************************
- * Name: board_autoled_on
- ****************************************************************************/
-
-void board_autoled_on(int led)
-{
-  if (led == BOARD_LED1)
-    {
-      stm32_gpiowrite(GPIO_LED1, true);
-    }
-}
+#include "chip.h"
+#include "stm32_dma.h"
+#include "stm32_gpio.h"
+#include "stm32_i2c.h"
+#include "stm32_pwr.h"
+#include "stm32_rcc.h"
+#include "stm32_spi.h"
+#include "stm32_uart.h"
+#include "stm32_lowputc.h"
+#include "stm32_adc.h"
 
 /****************************************************************************
- * Name: board_autoled_off
+ * Pre-processor Definitions
  ****************************************************************************/
 
-void board_autoled_off(int led)
-{
-  if (led == BOARD_LED1)
-    {
-      stm32_gpiowrite(GPIO_LED1, false);
-    }
-}
-
-#endif /* CONFIG_ARCH_LEDS */
+#endif /* __ARCH_ARM_SRC_STM32L0_STM32_H */
diff --git a/arch/arm/src/stm32l0/stm32_rcc.c b/arch/arm/src/stm32l0/stm32_rcc.c
new file mode 100644
index 00000000000..a41366fdfeb
--- /dev/null
+++ b/arch/arm/src/stm32l0/stm32_rcc.c
@@ -0,0 +1,220 @@
+/****************************************************************************
+ * arch/arm/src/stm32l0/stm32_rcc.c
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdint.h>
+#include <stdio.h>
+#include <assert.h>
+#include <nuttx/debug.h>
+
+#include <arch/board/board.h>
+
+#include "arm_internal.h"
+#include "hardware/stm32_flash.h"
+#include "stm32_rcc.h"
+#include "stm32_hsi48_m0_v1.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifdef CONFIG_STM32_RNG
+#  ifndef STM32_USE_CLK48
+#    error RNG requires CLK48 enabled
+#  endif
+#endif
+
+#ifdef CONFIG_STM32_USB
+#  ifndef STM32_USE_CLK48
+#    error USB requires CLK48 enabled
+#  endif
+#endif
+
+static_assert(CONFIG_BOARD_LOOPSPERMSEC != -1,
+              "Configure BOARD_LOOPSPERMSEC to non-default value.");
+
+/* Allow up to 100 milliseconds for the high speed clock to become ready.
+ * that is a very long delay, but if the clock does not become ready we are
+ * hosed anyway.
+ */
+
+#define HSERDY_TIMEOUT (100 * CONFIG_BOARD_LOOPSPERMSEC)
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+/* Include chip-specific clocking initialization logic */
+
+#include "stm32l0_rcc.c"
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: rcc_resetbkp
+ *
+ * Description:
+ *   The RTC needs to reset the Backup Domain to change RTCSEL and resetting
+ *   the Backup Domain renders to disabling the LSE as consequence.
+ *   In order to avoid resetting the Backup Domain when we already configured
+ *   LSE we will reset the Backup Domain early (here).
+ *
+ * Input Parameters:
+ *   None
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+#if defined(CONFIG_STM32_RTC) && defined(CONFIG_STM32_PWR)
+static inline void rcc_resetbkp(void)
+{
+  uint32_t regval;
+
+  /* Check if the RTC is already configured */
+
+  stm32_pwr_initbkp(false);
+
+  regval = getreg32(RTC_MAGIC_REG);
+  if (regval != RTC_MAGIC && regval != RTC_MAGIC_TIME_SET)
+    {
+      stm32_pwr_enablebkp(true);
+
+      /* We might be changing RTCSEL - to ensure such changes work, we must
+       * reset the backup domain (having backed up the RTC_MAGIC token)
+       */
+
+      modifyreg32(STM32_RCC_BDCR, 0, RCC_BDCR_BDRST);
+      modifyreg32(STM32_RCC_BDCR, RCC_BDCR_BDRST, 0);
+
+      stm32_pwr_enablebkp(false);
+    }
+}
+#else
+#  define rcc_resetbkp()
+#endif
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: stm32_clockconfig
+ *
+ * Description:
+ *   Called to establish the clock settings based on the values in board.h.
+ *   This function (by default) will reset most everything, enable the PLL,
+ *   and enable peripheral clocking for all peripherals enabled in the NuttX
+ *   configuration file.
+ *
+ *   If CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG is defined, then
+ *   clocking will be enabled by an externally provided, board-specific
+ *   function called stm32_board_clockconfig().
+ *
+ * Input Parameters:
+ *   None
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+void stm32_clockconfig(void)
+{
+  /* Make sure that we are starting in the reset state */
+
+  rcc_reset();
+
+  /* Reset backup domain if appropriate */
+
+  rcc_resetbkp();
+
+#if defined(CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG)
+  /* Invoke Board Custom Clock Configuration */
+
+  stm32_board_clockconfig();
+
+#else
+  /* Invoke standard, fixed clock configuration based on definitions
+   * in board.h
+   */
+
+  stm32_stdclockconfig();
+
+#endif
+
+  /* Enable peripheral clocking */
+
+  rcc_enableperipherals();
+}
+
+/****************************************************************************
+ * Name: stm32_clockenable
+ *
+ * Description:
+ *   Re-enable the clock and restore the clock settings based on settings in
+ *   board.h.  This function is only available to support low-power modes of
+ *   operation:  When re-awakening from deep-sleep modes, it is necessary to
+ *   re-enable/re-start the PLL
+ *
+ *   This functional performs a subset of the operations performed by
+ *   stm32_clockconfig():  It does not reset any devices, and it does not
+ *   reset the currently enabled peripheral clocks.
+ *
+ *   If CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG is defined, then
+ *   clocking will be enabled by an externally provided, board-specific
+ *   function called stm32_board_clockconfig().
+ *
+ * Input Parameters:
+ *   None
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_PM
+void stm32_clockenable(void)
+{
+#if defined(CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG)
+  /* Invoke Board Custom Clock Configuration */
+
+  stm32_board_clockconfig();
+
+#else
+  /* Invoke standard, fixed clock configuration based on definitions
+   * in board.h
+   */
+
+  stm32_stdclockconfig();
+
+#endif
+}
+#endif
diff --git a/arch/arm/src/stm32f0l0g0/stm32l0_rcc.c 
b/arch/arm/src/stm32l0/stm32l0_rcc.c
similarity index 99%
rename from arch/arm/src/stm32f0l0g0/stm32l0_rcc.c
rename to arch/arm/src/stm32l0/stm32l0_rcc.c
index 6e7b9a92f9d..79359bb30bf 100644
--- a/arch/arm/src/stm32f0l0g0/stm32l0_rcc.c
+++ b/arch/arm/src/stm32l0/stm32l0_rcc.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * arch/arm/src/stm32f0l0g0/stm32l0_rcc.c
+ * arch/arm/src/stm32l0/stm32l0_rcc.c
  *
  * SPDX-License-Identifier: Apache-2.0
  *
diff --git a/boards/arm/stm32f0l0g0/stm32l0538-disco/src/CMakeLists.txt 
b/boards/arm/stm32l0/b-l072z-lrwan1/CMakeLists.txt
similarity index 71%
copy from boards/arm/stm32f0l0g0/stm32l0538-disco/src/CMakeLists.txt
copy to boards/arm/stm32l0/b-l072z-lrwan1/CMakeLists.txt
index 2d3a59a01db..f474a7db2a1 100644
--- a/boards/arm/stm32f0l0g0/stm32l0538-disco/src/CMakeLists.txt
+++ b/boards/arm/stm32l0/b-l072z-lrwan1/CMakeLists.txt
@@ -1,5 +1,5 @@
 # 
##############################################################################
-# boards/arm/stm32f0l0g0/stm32l0538-disco/src/CMakeLists.txt
+# boards/arm/stm32l0/b-l072z-lrwan1/CMakeLists.txt
 #
 # SPDX-License-Identifier: Apache-2.0
 #
@@ -20,18 +20,4 @@
 #
 # 
##############################################################################
 
-set(SRCS stm32_boot.c stm32_bringup.c)
-
-if(CONFIG_ARCH_LEDS)
-  list(APPEND SRCS stm32_autoleds.c)
-else()
-  list(APPEND SRCS stm32_userleds.c)
-endif()
-
-if(CONFIG_ARCH_BUTTONS)
-  list(APPEND SRCS stm32_buttons.c)
-endif()
-
-target_sources(board PRIVATE ${SRCS})
-
-set_property(GLOBAL PROPERTY LD_SCRIPT "${NUTTX_BOARD_DIR}/scripts/ld.script")
+add_subdirectory(src)
diff --git a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/Kconfig 
b/boards/arm/stm32l0/b-l072z-lrwan1/Kconfig
similarity index 100%
copy from boards/arm/stm32f0l0g0/b-l072z-lrwan1/Kconfig
copy to boards/arm/stm32l0/b-l072z-lrwan1/Kconfig
diff --git a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/configs/adc/defconfig 
b/boards/arm/stm32l0/b-l072z-lrwan1/configs/adc/defconfig
similarity index 98%
rename from boards/arm/stm32f0l0g0/b-l072z-lrwan1/configs/adc/defconfig
rename to boards/arm/stm32l0/b-l072z-lrwan1/configs/adc/defconfig
index faac0bde227..016388d1db9 100644
--- a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/configs/adc/defconfig
+++ b/boards/arm/stm32l0/b-l072z-lrwan1/configs/adc/defconfig
@@ -11,7 +11,7 @@ CONFIG_ANALOG=y
 CONFIG_ARCH="arm"
 CONFIG_ARCH_BOARD="b-l072z-lrwan1"
 CONFIG_ARCH_BOARD_B_L072Z_LRWAN1=y
-CONFIG_ARCH_CHIP="stm32f0l0g0"
+CONFIG_ARCH_CHIP="stm32l0"
 CONFIG_ARCH_CHIP_STM32=y
 CONFIG_ARCH_CHIP_STM32L072CZ=y
 CONFIG_ARCH_CHIP_STM32L072XX=y
diff --git a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/configs/nsh/defconfig 
b/boards/arm/stm32l0/b-l072z-lrwan1/configs/nsh/defconfig
similarity index 97%
rename from boards/arm/stm32f0l0g0/b-l072z-lrwan1/configs/nsh/defconfig
rename to boards/arm/stm32l0/b-l072z-lrwan1/configs/nsh/defconfig
index b51bbbb4f4a..f8dc57d2784 100644
--- a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/configs/nsh/defconfig
+++ b/boards/arm/stm32l0/b-l072z-lrwan1/configs/nsh/defconfig
@@ -9,7 +9,7 @@
 CONFIG_ARCH="arm"
 CONFIG_ARCH_BOARD="b-l072z-lrwan1"
 CONFIG_ARCH_BOARD_B_L072Z_LRWAN1=y
-CONFIG_ARCH_CHIP="stm32f0l0g0"
+CONFIG_ARCH_CHIP="stm32l0"
 CONFIG_ARCH_CHIP_STM32=y
 CONFIG_ARCH_CHIP_STM32L072CZ=y
 CONFIG_ARCH_CHIP_STM32L072XX=y
diff --git 
a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/configs/nxlines_oled/defconfig 
b/boards/arm/stm32l0/b-l072z-lrwan1/configs/nxlines_oled/defconfig
similarity index 98%
rename from boards/arm/stm32f0l0g0/b-l072z-lrwan1/configs/nxlines_oled/defconfig
rename to boards/arm/stm32l0/b-l072z-lrwan1/configs/nxlines_oled/defconfig
index 6be6bf998c4..b2c85a1eebb 100644
--- a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/configs/nxlines_oled/defconfig
+++ b/boards/arm/stm32l0/b-l072z-lrwan1/configs/nxlines_oled/defconfig
@@ -12,7 +12,7 @@ CONFIG_ARCH="arm"
 CONFIG_ARCH_BOARD="b-l072z-lrwan1"
 CONFIG_ARCH_BOARD_B_L072Z_LRWAN1=y
 CONFIG_ARCH_BOARD_COMMON=y
-CONFIG_ARCH_CHIP="stm32f0l0g0"
+CONFIG_ARCH_CHIP="stm32l0"
 CONFIG_ARCH_CHIP_STM32=y
 CONFIG_ARCH_CHIP_STM32L072CZ=y
 CONFIG_ARCH_CHIP_STM32L072XX=y
diff --git a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/configs/sx127x/defconfig 
b/boards/arm/stm32l0/b-l072z-lrwan1/configs/sx127x/defconfig
similarity index 98%
rename from boards/arm/stm32f0l0g0/b-l072z-lrwan1/configs/sx127x/defconfig
rename to boards/arm/stm32l0/b-l072z-lrwan1/configs/sx127x/defconfig
index cfe38151ba5..1f5723aba0a 100644
--- a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/configs/sx127x/defconfig
+++ b/boards/arm/stm32l0/b-l072z-lrwan1/configs/sx127x/defconfig
@@ -9,7 +9,7 @@
 CONFIG_ARCH="arm"
 CONFIG_ARCH_BOARD="b-l072z-lrwan1"
 CONFIG_ARCH_BOARD_B_L072Z_LRWAN1=y
-CONFIG_ARCH_CHIP="stm32f0l0g0"
+CONFIG_ARCH_CHIP="stm32l0"
 CONFIG_ARCH_CHIP_STM32=y
 CONFIG_ARCH_CHIP_STM32L072CZ=y
 CONFIG_ARCH_CHIP_STM32L072XX=y
diff --git a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/include/board.h 
b/boards/arm/stm32l0/b-l072z-lrwan1/include/board.h
similarity index 99%
rename from boards/arm/stm32f0l0g0/b-l072z-lrwan1/include/board.h
rename to boards/arm/stm32l0/b-l072z-lrwan1/include/board.h
index 95e19a5a6c2..2029f595402 100644
--- a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/include/board.h
+++ b/boards/arm/stm32l0/b-l072z-lrwan1/include/board.h
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/arm/stm32f0l0g0/b-l072z-lrwan1/include/board.h
+ * boards/arm/stm32l0/b-l072z-lrwan1/include/board.h
  *
  * SPDX-License-Identifier: Apache-2.0
  *
diff --git a/boards/arm/stm32f0l0g0/stm32l0538-disco/scripts/Make.defs 
b/boards/arm/stm32l0/b-l072z-lrwan1/scripts/Make.defs
similarity index 79%
copy from boards/arm/stm32f0l0g0/stm32l0538-disco/scripts/Make.defs
copy to boards/arm/stm32l0/b-l072z-lrwan1/scripts/Make.defs
index 5417678c0ce..74fc513e986 100644
--- a/boards/arm/stm32f0l0g0/stm32l0538-disco/scripts/Make.defs
+++ b/boards/arm/stm32l0/b-l072z-lrwan1/scripts/Make.defs
@@ -1,5 +1,5 @@
 ############################################################################
-# boards/arm/stm32f0l0g0/stm32l0538-disco/scripts/Make.defs
+# boards/arm/stm32l0/b-l072z-lrwan1/scripts/Make.defs
 #
 # SPDX-License-Identifier: Apache-2.0
 #
@@ -27,13 +27,11 @@ include $(TOPDIR)/arch/arm/src/armv6-m/Toolchain.defs
 LDSCRIPT = ld.script
 ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)$(LDSCRIPT)
 
-ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
-ARCHWARNINGSXX = -Wall -Wshadow -Wundef
 ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10
 
-CFLAGS := $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) 
$(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
+CFLAGS := $(ARCHCFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) 
$(ARCHDEFINES) $(EXTRAFLAGS)
 CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
-CXXFLAGS := $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) 
$(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
+CXXFLAGS := $(ARCHCXXFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) 
$(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
 CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
 CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
 AFLAGS := $(CFLAGS) -D__ASSEMBLY__
diff --git a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/scripts/ld.script 
b/boards/arm/stm32l0/b-l072z-lrwan1/scripts/ld.script
similarity index 98%
rename from boards/arm/stm32f0l0g0/b-l072z-lrwan1/scripts/ld.script
rename to boards/arm/stm32l0/b-l072z-lrwan1/scripts/ld.script
index c95d535e86d..1c6f4b40e82 100644
--- a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/scripts/ld.script
+++ b/boards/arm/stm32l0/b-l072z-lrwan1/scripts/ld.script
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/arm/stm32f0l0g0/b-l072z-lrwan1/scripts/ld.script
+ * boards/arm/stm32l0/b-l072z-lrwan1/scripts/ld.script
  *
  * SPDX-License-Identifier: Apache-2.0
  *
diff --git a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/CMakeLists.txt 
b/boards/arm/stm32l0/b-l072z-lrwan1/src/CMakeLists.txt
similarity index 96%
rename from boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/CMakeLists.txt
rename to boards/arm/stm32l0/b-l072z-lrwan1/src/CMakeLists.txt
index 4770af26d5f..3c1bf3c65f3 100644
--- a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/CMakeLists.txt
+++ b/boards/arm/stm32l0/b-l072z-lrwan1/src/CMakeLists.txt
@@ -1,5 +1,5 @@
 # 
##############################################################################
-# boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/CMakeLists.txt
+# boards/arm/stm32l0/b-l072z-lrwan1/src/CMakeLists.txt
 #
 # SPDX-License-Identifier: Apache-2.0
 #
diff --git a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/Make.defs 
b/boards/arm/stm32l0/b-l072z-lrwan1/src/Make.defs
similarity index 96%
rename from boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/Make.defs
rename to boards/arm/stm32l0/b-l072z-lrwan1/src/Make.defs
index 55c1d27f870..0ef4cef9f33 100644
--- a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/Make.defs
+++ b/boards/arm/stm32l0/b-l072z-lrwan1/src/Make.defs
@@ -1,5 +1,5 @@
 ############################################################################
-# boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/Make.defs
+# boards/arm/stm32l0/b-l072z-lrwan1/src/Make.defs
 #
 # SPDX-License-Identifier: Apache-2.0
 #
diff --git a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/b-l072z-lrwan1.h 
b/boards/arm/stm32l0/b-l072z-lrwan1/src/b-l072z-lrwan1.h
similarity index 98%
rename from boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/b-l072z-lrwan1.h
rename to boards/arm/stm32l0/b-l072z-lrwan1/src/b-l072z-lrwan1.h
index 81c81c06f1d..dfbc614c322 100644
--- a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/b-l072z-lrwan1.h
+++ b/boards/arm/stm32l0/b-l072z-lrwan1/src/b-l072z-lrwan1.h
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/b-l072z-lrwan1.h
+ * boards/arm/stm32l0/b-l072z-lrwan1/src/b-l072z-lrwan1.h
  *
  * SPDX-License-Identifier: Apache-2.0
  *
diff --git a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_adc.c 
b/boards/arm/stm32l0/b-l072z-lrwan1/src/stm32_adc.c
similarity index 98%
rename from boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_adc.c
rename to boards/arm/stm32l0/b-l072z-lrwan1/src/stm32_adc.c
index 36d2d48f60e..593a484fd83 100644
--- a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_adc.c
+++ b/boards/arm/stm32l0/b-l072z-lrwan1/src/stm32_adc.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_adc.c
+ * boards/arm/stm32l0/b-l072z-lrwan1/src/stm32_adc.c
  *
  * SPDX-License-Identifier: Apache-2.0
  *
diff --git a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_autoleds.c 
b/boards/arm/stm32l0/b-l072z-lrwan1/src/stm32_autoleds.c
similarity index 97%
rename from boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_autoleds.c
rename to boards/arm/stm32l0/b-l072z-lrwan1/src/stm32_autoleds.c
index c71e5764e6e..1b0b8cd55b3 100644
--- a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_autoleds.c
+++ b/boards/arm/stm32l0/b-l072z-lrwan1/src/stm32_autoleds.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_autoleds.c
+ * boards/arm/stm32l0/b-l072z-lrwan1/src/stm32_autoleds.c
  *
  * SPDX-License-Identifier: Apache-2.0
  *
diff --git a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_boot.c 
b/boards/arm/stm32l0/b-l072z-lrwan1/src/stm32_boot.c
similarity index 98%
rename from boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_boot.c
rename to boards/arm/stm32l0/b-l072z-lrwan1/src/stm32_boot.c
index ce025e3b964..aad79dbb41f 100644
--- a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_boot.c
+++ b/boards/arm/stm32l0/b-l072z-lrwan1/src/stm32_boot.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_boot.c
+ * boards/arm/stm32l0/b-l072z-lrwan1/src/stm32_boot.c
  *
  * SPDX-License-Identifier: Apache-2.0
  *
diff --git a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_bringup.c 
b/boards/arm/stm32l0/b-l072z-lrwan1/src/stm32_bringup.c
similarity index 98%
rename from boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_bringup.c
rename to boards/arm/stm32l0/b-l072z-lrwan1/src/stm32_bringup.c
index 152c4cc463c..c3935c1ff16 100644
--- a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_bringup.c
+++ b/boards/arm/stm32l0/b-l072z-lrwan1/src/stm32_bringup.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_bringup.c
+ * boards/arm/stm32l0/b-l072z-lrwan1/src/stm32_bringup.c
  *
  * SPDX-License-Identifier: Apache-2.0
  *
diff --git a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_lcd_ssd1306.c 
b/boards/arm/stm32l0/b-l072z-lrwan1/src/stm32_lcd_ssd1306.c
similarity index 97%
rename from boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_lcd_ssd1306.c
rename to boards/arm/stm32l0/b-l072z-lrwan1/src/stm32_lcd_ssd1306.c
index dcdae68aef2..9644213f066 100644
--- a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_lcd_ssd1306.c
+++ b/boards/arm/stm32l0/b-l072z-lrwan1/src/stm32_lcd_ssd1306.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_lcd_ssd1306.c
+ * boards/arm/stm32l0/b-l072z-lrwan1/src/stm32_lcd_ssd1306.c
  *
  * SPDX-License-Identifier: Apache-2.0
  *
diff --git a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_spi.c 
b/boards/arm/stm32l0/b-l072z-lrwan1/src/stm32_spi.c
similarity index 99%
rename from boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_spi.c
rename to boards/arm/stm32l0/b-l072z-lrwan1/src/stm32_spi.c
index 7b42fb7e3ce..368df13bf05 100644
--- a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_spi.c
+++ b/boards/arm/stm32l0/b-l072z-lrwan1/src/stm32_spi.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_spi.c
+ * boards/arm/stm32l0/b-l072z-lrwan1/src/stm32_spi.c
  *
  * SPDX-License-Identifier: Apache-2.0
  *
diff --git a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_sx127x.c 
b/boards/arm/stm32l0/b-l072z-lrwan1/src/stm32_sx127x.c
similarity index 99%
rename from boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_sx127x.c
rename to boards/arm/stm32l0/b-l072z-lrwan1/src/stm32_sx127x.c
index 32e9e675406..e6ffc468139 100644
--- a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_sx127x.c
+++ b/boards/arm/stm32l0/b-l072z-lrwan1/src/stm32_sx127x.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/arm/stm32f0l0g0/b-l072z-lrwan1/src/stm32_sx127x.c
+ * boards/arm/stm32l0/b-l072z-lrwan1/src/stm32_sx127x.c
  *
  * SPDX-License-Identifier: Apache-2.0
  *
diff --git a/boards/arm/stm32f0l0g0/stm32l0538-disco/src/CMakeLists.txt 
b/boards/arm/stm32l0/common/CMakeLists.txt
similarity index 71%
copy from boards/arm/stm32f0l0g0/stm32l0538-disco/src/CMakeLists.txt
copy to boards/arm/stm32l0/common/CMakeLists.txt
index 2d3a59a01db..8ee0b83c1a4 100644
--- a/boards/arm/stm32f0l0g0/stm32l0538-disco/src/CMakeLists.txt
+++ b/boards/arm/stm32l0/common/CMakeLists.txt
@@ -1,5 +1,5 @@
 # 
##############################################################################
-# boards/arm/stm32f0l0g0/stm32l0538-disco/src/CMakeLists.txt
+# boards/arm/stm32l0/common/CMakeLists.txt
 #
 # SPDX-License-Identifier: Apache-2.0
 #
@@ -20,18 +20,6 @@
 #
 # 
##############################################################################
 
-set(SRCS stm32_boot.c stm32_bringup.c)
-
-if(CONFIG_ARCH_LEDS)
-  list(APPEND SRCS stm32_autoleds.c)
-else()
-  list(APPEND SRCS stm32_userleds.c)
-endif()
-
-if(CONFIG_ARCH_BUTTONS)
-  list(APPEND SRCS stm32_buttons.c)
+if(CONFIG_ARCH_BOARD_COMMON)
+  add_subdirectory(${NUTTX_DIR}/boards/arm/common/stm32 stm32_common)
 endif()
-
-target_sources(board PRIVATE ${SRCS})
-
-set_property(GLOBAL PROPERTY LD_SCRIPT "${NUTTX_BOARD_DIR}/scripts/ld.script")
diff --git a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/Kconfig 
b/boards/arm/stm32l0/common/Kconfig
similarity index 76%
rename from boards/arm/stm32f0l0g0/b-l072z-lrwan1/Kconfig
rename to boards/arm/stm32l0/common/Kconfig
index 7946b2eca38..5c48f62a025 100644
--- a/boards/arm/stm32f0l0g0/b-l072z-lrwan1/Kconfig
+++ b/boards/arm/stm32l0/common/Kconfig
@@ -3,6 +3,4 @@
 # see the file kconfig-language.txt in the NuttX tools repository.
 #
 
-if ARCH_BOARD_B_L072Z_LRWAN1
-
-endif
+source "boards/arm/common/stm32/Kconfig"
diff --git a/boards/arm/stm32f0l0g0/stm32l0538-disco/src/Make.defs 
b/boards/arm/stm32l0/common/Makefile
similarity index 60%
copy from boards/arm/stm32f0l0g0/stm32l0538-disco/src/Make.defs
copy to boards/arm/stm32l0/common/Makefile
index 502d059a105..56d7a1f9086 100644
--- a/boards/arm/stm32f0l0g0/stm32l0538-disco/src/Make.defs
+++ b/boards/arm/stm32l0/common/Makefile
@@ -1,5 +1,5 @@
-############################################################################
-# boards/arm/stm32f0l0g0/stm32l0538-disco/src/Make.defs
+#############################################################################
+# boards/arm/stm32l0/common/Makefile
 #
 # SPDX-License-Identifier: Apache-2.0
 #
@@ -10,7 +10,7 @@
 # "License"); you may not use this file except in compliance with the
 # License.  You may obtain a copy of the License at
 #
-#  http://www.apache.org/licenses/LICENSE-2.0
+#   http://www.apache.org/licenses/LICENSE-2.0
 #
 # Unless required by applicable law or agreed to in writing, software
 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
@@ -18,22 +18,21 @@
 # License for the specific language governing permissions and limitations
 # under the License.
 #
-############################################################################
+#############################################################################
 
 include $(TOPDIR)/Make.defs
 
-CSRCS = stm32_boot.c stm32_bringup.c
+STM32_BOARD_COMMON_DIR := 
$(TOPDIR)$(DELIM)boards$(DELIM)arm$(DELIM)common$(DELIM)stm32
+STM32_COMMON_SRCDIR := 
$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)common$(DELIM)stm32
 
-ifeq ($(CONFIG_ARCH_LEDS),y)
-CSRCS += stm32_autoleds.c
-else
-CSRCS += stm32_userleds.c
-endif
-
-ifeq ($(CONFIG_ARCH_BUTTONS),y)
-CSRCS += stm32_buttons.c
-endif
+include board/Make.defs
+include $(STM32_BOARD_COMMON_DIR)$(DELIM)src$(DELIM)Make.defs
 
 DEPPATH += --dep-path board
-VPATH += :board
-CFLAGS += 
${INCDIR_PREFIX}$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)board
+
+include $(TOPDIR)/boards/Board.mk
+
+ARCHSRCDIR = $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src
+BOARDDIR = $(ARCHSRCDIR)$(DELIM)board
+CFLAGS += ${INCDIR_PREFIX}$(BOARDDIR)$(DELIM)include
+CFLAGS += ${INCDIR_PREFIX}$(STM32_COMMON_SRCDIR)
diff --git a/boards/arm/stm32f0l0g0/stm32l0538-disco/src/CMakeLists.txt 
b/boards/arm/stm32l0/nucleo-l073rz/CMakeLists.txt
similarity index 71%
copy from boards/arm/stm32f0l0g0/stm32l0538-disco/src/CMakeLists.txt
copy to boards/arm/stm32l0/nucleo-l073rz/CMakeLists.txt
index 2d3a59a01db..d660ec8525f 100644
--- a/boards/arm/stm32f0l0g0/stm32l0538-disco/src/CMakeLists.txt
+++ b/boards/arm/stm32l0/nucleo-l073rz/CMakeLists.txt
@@ -1,5 +1,5 @@
 # 
##############################################################################
-# boards/arm/stm32f0l0g0/stm32l0538-disco/src/CMakeLists.txt
+# boards/arm/stm32l0/nucleo-l073rz/CMakeLists.txt
 #
 # SPDX-License-Identifier: Apache-2.0
 #
@@ -20,18 +20,4 @@
 #
 # 
##############################################################################
 
-set(SRCS stm32_boot.c stm32_bringup.c)
-
-if(CONFIG_ARCH_LEDS)
-  list(APPEND SRCS stm32_autoleds.c)
-else()
-  list(APPEND SRCS stm32_userleds.c)
-endif()
-
-if(CONFIG_ARCH_BUTTONS)
-  list(APPEND SRCS stm32_buttons.c)
-endif()
-
-target_sources(board PRIVATE ${SRCS})
-
-set_property(GLOBAL PROPERTY LD_SCRIPT "${NUTTX_BOARD_DIR}/scripts/ld.script")
+add_subdirectory(src)
diff --git a/boards/arm/stm32f0l0g0/nucleo-l073rz/Kconfig 
b/boards/arm/stm32l0/nucleo-l073rz/Kconfig
similarity index 100%
rename from boards/arm/stm32f0l0g0/nucleo-l073rz/Kconfig
rename to boards/arm/stm32l0/nucleo-l073rz/Kconfig
diff --git a/boards/arm/stm32f0l0g0/nucleo-l073rz/configs/nsh/defconfig 
b/boards/arm/stm32l0/nucleo-l073rz/configs/nsh/defconfig
similarity index 97%
rename from boards/arm/stm32f0l0g0/nucleo-l073rz/configs/nsh/defconfig
rename to boards/arm/stm32l0/nucleo-l073rz/configs/nsh/defconfig
index 9633c3b48c0..d4ddb1d55dd 100644
--- a/boards/arm/stm32f0l0g0/nucleo-l073rz/configs/nsh/defconfig
+++ b/boards/arm/stm32l0/nucleo-l073rz/configs/nsh/defconfig
@@ -9,7 +9,7 @@
 CONFIG_ARCH="arm"
 CONFIG_ARCH_BOARD="nucleo-l073rz"
 CONFIG_ARCH_BOARD_NUCLEO_L073RZ=y
-CONFIG_ARCH_CHIP="stm32f0l0g0"
+CONFIG_ARCH_CHIP="stm32l0"
 CONFIG_ARCH_CHIP_STM32=y
 CONFIG_ARCH_CHIP_STM32L073RZ=y
 CONFIG_ARCH_CHIP_STM32L073XX=y
diff --git a/boards/arm/stm32f0l0g0/nucleo-l073rz/configs/sx127x/defconfig 
b/boards/arm/stm32l0/nucleo-l073rz/configs/sx127x/defconfig
similarity index 98%
rename from boards/arm/stm32f0l0g0/nucleo-l073rz/configs/sx127x/defconfig
rename to boards/arm/stm32l0/nucleo-l073rz/configs/sx127x/defconfig
index 38cc3a0d14e..32220b19127 100644
--- a/boards/arm/stm32f0l0g0/nucleo-l073rz/configs/sx127x/defconfig
+++ b/boards/arm/stm32l0/nucleo-l073rz/configs/sx127x/defconfig
@@ -10,7 +10,7 @@ CONFIG_ARCH="arm"
 CONFIG_ARCH_BOARD="nucleo-l073rz"
 CONFIG_ARCH_BOARD_NUCLEO_L073RZ=y
 CONFIG_ARCH_BUTTONS=y
-CONFIG_ARCH_CHIP="stm32f0l0g0"
+CONFIG_ARCH_CHIP="stm32l0"
 CONFIG_ARCH_CHIP_STM32=y
 CONFIG_ARCH_CHIP_STM32L073RZ=y
 CONFIG_ARCH_CHIP_STM32L073XX=y
diff --git a/boards/arm/stm32f0l0g0/nucleo-l073rz/include/board.h 
b/boards/arm/stm32l0/nucleo-l073rz/include/board.h
similarity index 99%
rename from boards/arm/stm32f0l0g0/nucleo-l073rz/include/board.h
rename to boards/arm/stm32l0/nucleo-l073rz/include/board.h
index d24c64eaaf4..af284ca168e 100644
--- a/boards/arm/stm32f0l0g0/nucleo-l073rz/include/board.h
+++ b/boards/arm/stm32l0/nucleo-l073rz/include/board.h
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/arm/stm32f0l0g0/nucleo-l073rz/include/board.h
+ * boards/arm/stm32l0/nucleo-l073rz/include/board.h
  *
  * SPDX-License-Identifier: Apache-2.0
  *
diff --git a/boards/arm/stm32f0l0g0/stm32l0538-disco/scripts/Make.defs 
b/boards/arm/stm32l0/nucleo-l073rz/scripts/Make.defs
similarity index 79%
copy from boards/arm/stm32f0l0g0/stm32l0538-disco/scripts/Make.defs
copy to boards/arm/stm32l0/nucleo-l073rz/scripts/Make.defs
index 5417678c0ce..596e9665da7 100644
--- a/boards/arm/stm32f0l0g0/stm32l0538-disco/scripts/Make.defs
+++ b/boards/arm/stm32l0/nucleo-l073rz/scripts/Make.defs
@@ -1,5 +1,5 @@
 ############################################################################
-# boards/arm/stm32f0l0g0/stm32l0538-disco/scripts/Make.defs
+# boards/arm/stm32l0/nucleo-l073rz/scripts/Make.defs
 #
 # SPDX-License-Identifier: Apache-2.0
 #
@@ -27,13 +27,11 @@ include $(TOPDIR)/arch/arm/src/armv6-m/Toolchain.defs
 LDSCRIPT = ld.script
 ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)$(LDSCRIPT)
 
-ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
-ARCHWARNINGSXX = -Wall -Wshadow -Wundef
 ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10
 
-CFLAGS := $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) 
$(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
+CFLAGS := $(ARCHCFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) 
$(ARCHDEFINES) $(EXTRAFLAGS)
 CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
-CXXFLAGS := $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) 
$(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
+CXXFLAGS := $(ARCHCXXFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) 
$(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
 CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
 CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
 AFLAGS := $(CFLAGS) -D__ASSEMBLY__
diff --git a/boards/arm/stm32f0l0g0/nucleo-l073rz/scripts/ld.script 
b/boards/arm/stm32l0/nucleo-l073rz/scripts/ld.script
similarity index 98%
rename from boards/arm/stm32f0l0g0/nucleo-l073rz/scripts/ld.script
rename to boards/arm/stm32l0/nucleo-l073rz/scripts/ld.script
index e0da80b38d5..2156f68042f 100644
--- a/boards/arm/stm32f0l0g0/nucleo-l073rz/scripts/ld.script
+++ b/boards/arm/stm32l0/nucleo-l073rz/scripts/ld.script
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/arm/stm32f0l0g0/nucleo-l073rz/scripts/ld.script
+ * boards/arm/stm32l0/nucleo-l073rz/scripts/ld.script
  *
  * SPDX-License-Identifier: Apache-2.0
  *
diff --git a/boards/arm/stm32f0l0g0/nucleo-l073rz/src/CMakeLists.txt 
b/boards/arm/stm32l0/nucleo-l073rz/src/CMakeLists.txt
similarity index 96%
rename from boards/arm/stm32f0l0g0/nucleo-l073rz/src/CMakeLists.txt
rename to boards/arm/stm32l0/nucleo-l073rz/src/CMakeLists.txt
index ac95ed5c073..b70c2615c82 100644
--- a/boards/arm/stm32f0l0g0/nucleo-l073rz/src/CMakeLists.txt
+++ b/boards/arm/stm32l0/nucleo-l073rz/src/CMakeLists.txt
@@ -1,5 +1,5 @@
 # 
##############################################################################
-# boards/arm/stm32f0l0g0/nucleo-l073rz/src/CMakeLists.txt
+# boards/arm/stm32l0/nucleo-l073rz/src/CMakeLists.txt
 #
 # SPDX-License-Identifier: Apache-2.0
 #
diff --git a/boards/arm/stm32f0l0g0/nucleo-l073rz/src/Make.defs 
b/boards/arm/stm32l0/nucleo-l073rz/src/Make.defs
similarity index 96%
rename from boards/arm/stm32f0l0g0/nucleo-l073rz/src/Make.defs
rename to boards/arm/stm32l0/nucleo-l073rz/src/Make.defs
index ff5d2d230eb..f2967390346 100644
--- a/boards/arm/stm32f0l0g0/nucleo-l073rz/src/Make.defs
+++ b/boards/arm/stm32l0/nucleo-l073rz/src/Make.defs
@@ -1,5 +1,5 @@
 ############################################################################
-# boards/arm/stm32f0l0g0/nucleo-l073rz/src/Make.defs
+# boards/arm/stm32l0/nucleo-l073rz/src/Make.defs
 #
 # SPDX-License-Identifier: Apache-2.0
 #
diff --git a/boards/arm/stm32f0l0g0/nucleo-l073rz/src/nucleo-l073rz.h 
b/boards/arm/stm32l0/nucleo-l073rz/src/nucleo-l073rz.h
similarity index 99%
rename from boards/arm/stm32f0l0g0/nucleo-l073rz/src/nucleo-l073rz.h
rename to boards/arm/stm32l0/nucleo-l073rz/src/nucleo-l073rz.h
index 90410fded75..f72a20312f5 100644
--- a/boards/arm/stm32f0l0g0/nucleo-l073rz/src/nucleo-l073rz.h
+++ b/boards/arm/stm32l0/nucleo-l073rz/src/nucleo-l073rz.h
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/arm/stm32f0l0g0/nucleo-l073rz/src/nucleo-l073rz.h
+ * boards/arm/stm32l0/nucleo-l073rz/src/nucleo-l073rz.h
  *
  * SPDX-License-Identifier: Apache-2.0
  *
diff --git a/boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_autoleds.c 
b/boards/arm/stm32l0/nucleo-l073rz/src/stm32_autoleds.c
similarity index 97%
rename from boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_autoleds.c
rename to boards/arm/stm32l0/nucleo-l073rz/src/stm32_autoleds.c
index 2f06c37702f..ffe74f73f87 100644
--- a/boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_autoleds.c
+++ b/boards/arm/stm32l0/nucleo-l073rz/src/stm32_autoleds.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_autoleds.c
+ * boards/arm/stm32l0/nucleo-l073rz/src/stm32_autoleds.c
  *
  * SPDX-License-Identifier: Apache-2.0
  *
diff --git a/boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_boot.c 
b/boards/arm/stm32l0/nucleo-l073rz/src/stm32_boot.c
similarity index 98%
rename from boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_boot.c
rename to boards/arm/stm32l0/nucleo-l073rz/src/stm32_boot.c
index a08ebff3930..8ee936849c3 100644
--- a/boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_boot.c
+++ b/boards/arm/stm32l0/nucleo-l073rz/src/stm32_boot.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_boot.c
+ * boards/arm/stm32l0/nucleo-l073rz/src/stm32_boot.c
  *
  * SPDX-License-Identifier: Apache-2.0
  *
diff --git a/boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_bringup.c 
b/boards/arm/stm32l0/nucleo-l073rz/src/stm32_bringup.c
similarity index 98%
rename from boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_bringup.c
rename to boards/arm/stm32l0/nucleo-l073rz/src/stm32_bringup.c
index 35e5ae85e28..3a573ba1c8d 100644
--- a/boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_bringup.c
+++ b/boards/arm/stm32l0/nucleo-l073rz/src/stm32_bringup.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_bringup.c
+ * boards/arm/stm32l0/nucleo-l073rz/src/stm32_bringup.c
  *
  * SPDX-License-Identifier: Apache-2.0
  *
diff --git a/boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_buttons.c 
b/boards/arm/stm32l0/nucleo-l073rz/src/stm32_buttons.c
similarity index 98%
rename from boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_buttons.c
rename to boards/arm/stm32l0/nucleo-l073rz/src/stm32_buttons.c
index 6fee37bc6e0..5f59392762a 100644
--- a/boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_buttons.c
+++ b/boards/arm/stm32l0/nucleo-l073rz/src/stm32_buttons.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_buttons.c
+ * boards/arm/stm32l0/nucleo-l073rz/src/stm32_buttons.c
  *
  * SPDX-License-Identifier: Apache-2.0
  *
diff --git a/boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_mfrc522.c 
b/boards/arm/stm32l0/nucleo-l073rz/src/stm32_mfrc522.c
similarity index 97%
rename from boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_mfrc522.c
rename to boards/arm/stm32l0/nucleo-l073rz/src/stm32_mfrc522.c
index 2481cdfb428..4cbc3ee003c 100644
--- a/boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_mfrc522.c
+++ b/boards/arm/stm32l0/nucleo-l073rz/src/stm32_mfrc522.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_mfrc522.c
+ * boards/arm/stm32l0/nucleo-l073rz/src/stm32_mfrc522.c
  *
  * SPDX-License-Identifier: Apache-2.0
  *
diff --git a/boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_nrf24l01.c 
b/boards/arm/stm32l0/nucleo-l073rz/src/stm32_nrf24l01.c
similarity index 98%
rename from boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_nrf24l01.c
rename to boards/arm/stm32l0/nucleo-l073rz/src/stm32_nrf24l01.c
index b8bb669ff79..4b3e1311e58 100644
--- a/boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_nrf24l01.c
+++ b/boards/arm/stm32l0/nucleo-l073rz/src/stm32_nrf24l01.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_nrf24l01.c
+ * boards/arm/stm32l0/nucleo-l073rz/src/stm32_nrf24l01.c
  *
  * SPDX-License-Identifier: Apache-2.0
  *
diff --git a/boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_spi.c 
b/boards/arm/stm32l0/nucleo-l073rz/src/stm32_spi.c
similarity index 99%
rename from boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_spi.c
rename to boards/arm/stm32l0/nucleo-l073rz/src/stm32_spi.c
index a9495e3544c..3daa7531191 100644
--- a/boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_spi.c
+++ b/boards/arm/stm32l0/nucleo-l073rz/src/stm32_spi.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_spi.c
+ * boards/arm/stm32l0/nucleo-l073rz/src/stm32_spi.c
  *
  * SPDX-License-Identifier: Apache-2.0
  *
diff --git a/boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_sx127x.c 
b/boards/arm/stm32l0/nucleo-l073rz/src/stm32_sx127x.c
similarity index 98%
rename from boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_sx127x.c
rename to boards/arm/stm32l0/nucleo-l073rz/src/stm32_sx127x.c
index a5786872108..1893e179735 100644
--- a/boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_sx127x.c
+++ b/boards/arm/stm32l0/nucleo-l073rz/src/stm32_sx127x.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/arm/stm32f0l0g0/nucleo-l073rz/src/stm32_sx127x.c
+ * boards/arm/stm32l0/nucleo-l073rz/src/stm32_sx127x.c
  *
  * SPDX-License-Identifier: Apache-2.0
  *
diff --git a/boards/arm/stm32f0l0g0/stm32l0538-disco/src/CMakeLists.txt 
b/boards/arm/stm32l0/stm32l0538-disco/CMakeLists.txt
similarity index 71%
copy from boards/arm/stm32f0l0g0/stm32l0538-disco/src/CMakeLists.txt
copy to boards/arm/stm32l0/stm32l0538-disco/CMakeLists.txt
index 2d3a59a01db..32e681f9f1b 100644
--- a/boards/arm/stm32f0l0g0/stm32l0538-disco/src/CMakeLists.txt
+++ b/boards/arm/stm32l0/stm32l0538-disco/CMakeLists.txt
@@ -1,5 +1,5 @@
 # 
##############################################################################
-# boards/arm/stm32f0l0g0/stm32l0538-disco/src/CMakeLists.txt
+# boards/arm/stm32l0/stm32l0538-disco/CMakeLists.txt
 #
 # SPDX-License-Identifier: Apache-2.0
 #
@@ -20,18 +20,4 @@
 #
 # 
##############################################################################
 
-set(SRCS stm32_boot.c stm32_bringup.c)
-
-if(CONFIG_ARCH_LEDS)
-  list(APPEND SRCS stm32_autoleds.c)
-else()
-  list(APPEND SRCS stm32_userleds.c)
-endif()
-
-if(CONFIG_ARCH_BUTTONS)
-  list(APPEND SRCS stm32_buttons.c)
-endif()
-
-target_sources(board PRIVATE ${SRCS})
-
-set_property(GLOBAL PROPERTY LD_SCRIPT "${NUTTX_BOARD_DIR}/scripts/ld.script")
+add_subdirectory(src)
diff --git a/boards/arm/stm32f0l0g0/stm32l0538-disco/Kconfig 
b/boards/arm/stm32l0/stm32l0538-disco/Kconfig
similarity index 100%
rename from boards/arm/stm32f0l0g0/stm32l0538-disco/Kconfig
rename to boards/arm/stm32l0/stm32l0538-disco/Kconfig
diff --git a/boards/arm/stm32f0l0g0/stm32l0538-disco/configs/nsh/defconfig 
b/boards/arm/stm32l0/stm32l0538-disco/configs/nsh/defconfig
similarity index 97%
rename from boards/arm/stm32f0l0g0/stm32l0538-disco/configs/nsh/defconfig
rename to boards/arm/stm32l0/stm32l0538-disco/configs/nsh/defconfig
index ce9e752caa6..7a823b72968 100644
--- a/boards/arm/stm32f0l0g0/stm32l0538-disco/configs/nsh/defconfig
+++ b/boards/arm/stm32l0/stm32l0538-disco/configs/nsh/defconfig
@@ -9,7 +9,7 @@
 CONFIG_ARCH="arm"
 CONFIG_ARCH_BOARD="stm32l0538-disco"
 CONFIG_ARCH_BOARD_STM32L0538_DISCO=y
-CONFIG_ARCH_CHIP="stm32f0l0g0"
+CONFIG_ARCH_CHIP="stm32l0"
 CONFIG_ARCH_CHIP_STM32=y
 CONFIG_ARCH_CHIP_STM32L053C8=y
 CONFIG_ARCH_CHIP_STM32L053XX=y
diff --git a/boards/arm/stm32f0l0g0/stm32l0538-disco/include/board.h 
b/boards/arm/stm32l0/stm32l0538-disco/include/board.h
similarity index 99%
rename from boards/arm/stm32f0l0g0/stm32l0538-disco/include/board.h
rename to boards/arm/stm32l0/stm32l0538-disco/include/board.h
index 5cc344752dc..f1ba04878c6 100644
--- a/boards/arm/stm32f0l0g0/stm32l0538-disco/include/board.h
+++ b/boards/arm/stm32l0/stm32l0538-disco/include/board.h
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/arm/stm32f0l0g0/stm32l0538-disco/include/board.h
+ * boards/arm/stm32l0/stm32l0538-disco/include/board.h
  *
  * SPDX-License-Identifier: Apache-2.0
  *
diff --git a/boards/arm/stm32f0l0g0/stm32l0538-disco/scripts/Make.defs 
b/boards/arm/stm32l0/stm32l0538-disco/scripts/Make.defs
similarity index 96%
rename from boards/arm/stm32f0l0g0/stm32l0538-disco/scripts/Make.defs
rename to boards/arm/stm32l0/stm32l0538-disco/scripts/Make.defs
index 5417678c0ce..5a209945f33 100644
--- a/boards/arm/stm32f0l0g0/stm32l0538-disco/scripts/Make.defs
+++ b/boards/arm/stm32l0/stm32l0538-disco/scripts/Make.defs
@@ -1,5 +1,5 @@
 ############################################################################
-# boards/arm/stm32f0l0g0/stm32l0538-disco/scripts/Make.defs
+# boards/arm/stm32l0/stm32l0538-disco/scripts/Make.defs
 #
 # SPDX-License-Identifier: Apache-2.0
 #
diff --git a/boards/arm/stm32f0l0g0/stm32l0538-disco/scripts/ld.script 
b/boards/arm/stm32l0/stm32l0538-disco/scripts/ld.script
similarity index 98%
rename from boards/arm/stm32f0l0g0/stm32l0538-disco/scripts/ld.script
rename to boards/arm/stm32l0/stm32l0538-disco/scripts/ld.script
index 3ab8df515ea..9eb309a0097 100644
--- a/boards/arm/stm32f0l0g0/stm32l0538-disco/scripts/ld.script
+++ b/boards/arm/stm32l0/stm32l0538-disco/scripts/ld.script
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/arm/stm32f0l0g0/stm32l0538-disco/scripts/ld.script
+ * boards/arm/stm32l0/stm32l0538-disco/scripts/ld.script
  *
  * SPDX-License-Identifier: Apache-2.0
  *
diff --git a/boards/arm/stm32f0l0g0/stm32l0538-disco/src/CMakeLists.txt 
b/boards/arm/stm32l0/stm32l0538-disco/src/CMakeLists.txt
similarity index 95%
rename from boards/arm/stm32f0l0g0/stm32l0538-disco/src/CMakeLists.txt
rename to boards/arm/stm32l0/stm32l0538-disco/src/CMakeLists.txt
index 2d3a59a01db..7819e8f7226 100644
--- a/boards/arm/stm32f0l0g0/stm32l0538-disco/src/CMakeLists.txt
+++ b/boards/arm/stm32l0/stm32l0538-disco/src/CMakeLists.txt
@@ -1,5 +1,5 @@
 # 
##############################################################################
-# boards/arm/stm32f0l0g0/stm32l0538-disco/src/CMakeLists.txt
+# boards/arm/stm32l0/stm32l0538-disco/src/CMakeLists.txt
 #
 # SPDX-License-Identifier: Apache-2.0
 #
diff --git a/boards/arm/stm32f0l0g0/stm32l0538-disco/src/Make.defs 
b/boards/arm/stm32l0/stm32l0538-disco/src/Make.defs
similarity index 96%
rename from boards/arm/stm32f0l0g0/stm32l0538-disco/src/Make.defs
rename to boards/arm/stm32l0/stm32l0538-disco/src/Make.defs
index 502d059a105..6d6fb20db57 100644
--- a/boards/arm/stm32f0l0g0/stm32l0538-disco/src/Make.defs
+++ b/boards/arm/stm32l0/stm32l0538-disco/src/Make.defs
@@ -1,5 +1,5 @@
 ############################################################################
-# boards/arm/stm32f0l0g0/stm32l0538-disco/src/Make.defs
+# boards/arm/stm32l0/stm32l0538-disco/src/Make.defs
 #
 # SPDX-License-Identifier: Apache-2.0
 #
diff --git a/boards/arm/stm32f0l0g0/stm32l0538-disco/src/stm32_autoleds.c 
b/boards/arm/stm32l0/stm32l0538-disco/src/stm32_autoleds.c
similarity index 97%
rename from boards/arm/stm32f0l0g0/stm32l0538-disco/src/stm32_autoleds.c
rename to boards/arm/stm32l0/stm32l0538-disco/src/stm32_autoleds.c
index b7564b91312..9e28a2427ef 100644
--- a/boards/arm/stm32f0l0g0/stm32l0538-disco/src/stm32_autoleds.c
+++ b/boards/arm/stm32l0/stm32l0538-disco/src/stm32_autoleds.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/arm/stm32f0l0g0/stm32l0538-disco/src/stm32_autoleds.c
+ * boards/arm/stm32l0/stm32l0538-disco/src/stm32_autoleds.c
  *
  * SPDX-License-Identifier: Apache-2.0
  *
diff --git a/boards/arm/stm32f0l0g0/stm32l0538-disco/src/stm32_boot.c 
b/boards/arm/stm32l0/stm32l0538-disco/src/stm32_boot.c
similarity index 97%
rename from boards/arm/stm32f0l0g0/stm32l0538-disco/src/stm32_boot.c
rename to boards/arm/stm32l0/stm32l0538-disco/src/stm32_boot.c
index b760b793943..b3a0d820c48 100644
--- a/boards/arm/stm32f0l0g0/stm32l0538-disco/src/stm32_boot.c
+++ b/boards/arm/stm32l0/stm32l0538-disco/src/stm32_boot.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/arm/stm32f0l0g0/stm32l0538-disco/src/stm32_boot.c
+ * boards/arm/stm32l0/stm32l0538-disco/src/stm32_boot.c
  *
  * SPDX-License-Identifier: Apache-2.0
  *
diff --git a/boards/arm/stm32f0l0g0/stm32l0538-disco/src/stm32_bringup.c 
b/boards/arm/stm32l0/stm32l0538-disco/src/stm32_bringup.c
similarity index 97%
rename from boards/arm/stm32f0l0g0/stm32l0538-disco/src/stm32_bringup.c
rename to boards/arm/stm32l0/stm32l0538-disco/src/stm32_bringup.c
index c4907ef7ac8..1bc7e9a74e6 100644
--- a/boards/arm/stm32f0l0g0/stm32l0538-disco/src/stm32_bringup.c
+++ b/boards/arm/stm32l0/stm32l0538-disco/src/stm32_bringup.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/arm/stm32f0l0g0/stm32l0538-disco/src/stm32_bringup.c
+ * boards/arm/stm32l0/stm32l0538-disco/src/stm32_bringup.c
  *
  * SPDX-License-Identifier: Apache-2.0
  *
diff --git a/boards/arm/stm32f0l0g0/stm32l0538-disco/src/stm32_buttons.c 
b/boards/arm/stm32l0/stm32l0538-disco/src/stm32_buttons.c
similarity index 98%
rename from boards/arm/stm32f0l0g0/stm32l0538-disco/src/stm32_buttons.c
rename to boards/arm/stm32l0/stm32l0538-disco/src/stm32_buttons.c
index f6cff70cb19..73295823d91 100644
--- a/boards/arm/stm32f0l0g0/stm32l0538-disco/src/stm32_buttons.c
+++ b/boards/arm/stm32l0/stm32l0538-disco/src/stm32_buttons.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/arm/stm32f0l0g0/stm32l0538-disco/src/stm32_buttons.c
+ * boards/arm/stm32l0/stm32l0538-disco/src/stm32_buttons.c
  *
  * SPDX-License-Identifier: Apache-2.0
  *
diff --git a/boards/arm/stm32f0l0g0/stm32l0538-disco/src/stm32l0538-disco.h 
b/boards/arm/stm32l0/stm32l0538-disco/src/stm32l0538-disco.h
similarity index 98%
rename from boards/arm/stm32f0l0g0/stm32l0538-disco/src/stm32l0538-disco.h
rename to boards/arm/stm32l0/stm32l0538-disco/src/stm32l0538-disco.h
index 34b45f2a994..38e14d22f82 100644
--- a/boards/arm/stm32f0l0g0/stm32l0538-disco/src/stm32l0538-disco.h
+++ b/boards/arm/stm32l0/stm32l0538-disco/src/stm32l0538-disco.h
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/arm/stm32f0l0g0/stm32l0538-disco/src/stm32l0538-disco.h
+ * boards/arm/stm32l0/stm32l0538-disco/src/stm32l0538-disco.h
  *
  * SPDX-License-Identifier: Apache-2.0
  *

Reply via email to