You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2022/07/11 00:02:28 UTC

[incubator-nuttx] branch master updated (76ccbc9a73 -> 2192b8df2b)

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

acassis pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


    from 76ccbc9a73 Fix warning: (NET_TCP_NO_STACK && NET_USRSOCK_TCP) selects NET_TCP which has unmet direct dependencies (NET && SCHED_WORKQUEUE)
     new 5c1c18af03 stm32g0: add support for USART3 and USART4
     new 2192b8df2b boards: add initial support for stm32g071b-disco board

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 arch/arm/src/stm32f0l0g0/Kconfig                   |   2 +
 arch/arm/src/stm32f0l0g0/hardware/stm32g0_pinmap.h |  63 ++++-
 arch/arm/src/stm32f0l0g0/stm32_serial_v2.c         | 115 +++++++-
 boards/Kconfig                                     |   9 +
 boards/arm/stm32f0l0g0/stm32g071b-disco/Kconfig    |   8 +
 boards/arm/stm32f0l0g0/stm32g071b-disco/README.txt |  15 ++
 .../stm32g071b-disco/configs/nsh/defconfig         |  59 +++++
 .../stm32f0l0g0/stm32g071b-disco/include/board.h   | 178 +++++++++++++
 .../stm32f0l0g0/stm32g071b-disco/scripts/Make.defs |  39 +++
 .../stm32f0l0g0/stm32g071b-disco/scripts/ld.script | 112 ++++++++
 .../arm/stm32f0l0g0/stm32g071b-disco/src/Makefile  |  38 +++
 .../stm32g071b-disco/src/stm32_appinit.c           |  71 +++++
 .../stm32f0l0g0/stm32g071b-disco/src/stm32_boot.c  |  83 ++++++
 .../stm32g071b-disco/src/stm32_bringup.c           |  88 ++++++
 .../stm32g071b-disco/src/stm32_djoystick.c         | 294 +++++++++++++++++++++
 .../stm32g071b-disco/src/stm32_userleds.c          |  90 +++++++
 .../stm32g071b-disco/src/stm32g071b-disco.h        |  96 +++++++
 17 files changed, 1347 insertions(+), 13 deletions(-)
 create mode 100644 boards/arm/stm32f0l0g0/stm32g071b-disco/Kconfig
 create mode 100644 boards/arm/stm32f0l0g0/stm32g071b-disco/README.txt
 create mode 100644 boards/arm/stm32f0l0g0/stm32g071b-disco/configs/nsh/defconfig
 create mode 100644 boards/arm/stm32f0l0g0/stm32g071b-disco/include/board.h
 create mode 100644 boards/arm/stm32f0l0g0/stm32g071b-disco/scripts/Make.defs
 create mode 100644 boards/arm/stm32f0l0g0/stm32g071b-disco/scripts/ld.script
 create mode 100644 boards/arm/stm32f0l0g0/stm32g071b-disco/src/Makefile
 create mode 100644 boards/arm/stm32f0l0g0/stm32g071b-disco/src/stm32_appinit.c
 create mode 100644 boards/arm/stm32f0l0g0/stm32g071b-disco/src/stm32_boot.c
 create mode 100644 boards/arm/stm32f0l0g0/stm32g071b-disco/src/stm32_bringup.c
 create mode 100644 boards/arm/stm32f0l0g0/stm32g071b-disco/src/stm32_djoystick.c
 create mode 100644 boards/arm/stm32f0l0g0/stm32g071b-disco/src/stm32_userleds.c
 create mode 100644 boards/arm/stm32f0l0g0/stm32g071b-disco/src/stm32g071b-disco.h


[incubator-nuttx] 01/02: stm32g0: add support for USART3 and USART4

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 5c1c18af03a22dd35d1e938d98d3c1b56b8da20e
Author: raiden00pl <ra...@railab.me>
AuthorDate: Thu Jul 7 19:04:11 2022 +0200

    stm32g0: add support for USART3 and USART4
---
 arch/arm/src/stm32f0l0g0/Kconfig                   |   2 +
 arch/arm/src/stm32f0l0g0/hardware/stm32g0_pinmap.h |  63 ++++++++++-
 arch/arm/src/stm32f0l0g0/stm32_serial_v2.c         | 115 +++++++++++++++++++--
 3 files changed, 167 insertions(+), 13 deletions(-)

diff --git a/arch/arm/src/stm32f0l0g0/Kconfig b/arch/arm/src/stm32f0l0g0/Kconfig
index 9e18961dd1..15912ca3a2 100644
--- a/arch/arm/src/stm32f0l0g0/Kconfig
+++ b/arch/arm/src/stm32f0l0g0/Kconfig
@@ -803,6 +803,8 @@ config STM32F0L0G0_STM32F0
 config STM32F0L0G0_STM32G0
 	bool
 	default n
+	select STM32F0L0G0_HAVE_USART3
+	select STM32F0L0G0_HAVE_USART4
 	select STM32F0L0G0_HAVE_DMAMUX
 	select STM32F0L0G0_HAVE_IP_USART_V2
 	select STM32F0L0G0_HAVE_IP_EXTI_V2
diff --git a/arch/arm/src/stm32f0l0g0/hardware/stm32g0_pinmap.h b/arch/arm/src/stm32f0l0g0/hardware/stm32g0_pinmap.h
index 6884a25a5a..bf053662ba 100644
--- a/arch/arm/src/stm32f0l0g0/hardware/stm32g0_pinmap.h
+++ b/arch/arm/src/stm32f0l0g0/hardware/stm32g0_pinmap.h
@@ -96,7 +96,41 @@
 
 /* TODO: RTC */
 
-/* TODO: SPI */
+/* SPI */
+
+#define GPIO_SPI1_SCK_1          (GPIO_ALT | GPIO_AF0 | GPIO_PORTA | GPIO_PIN1)
+#define GPIO_SPI1_SCK_2          (GPIO_ALT | GPIO_AF0 | GPIO_PORTA | GPIO_PIN5)
+#define GPIO_SPI1_SCK_3          (GPIO_ALT | GPIO_AF0 | GPIO_PORTB | GPIO_PIN3)
+#define GPIO_SPI1_SCK_4          (GPIO_ALT | GPIO_AF1 | GPIO_PORTD | GPIO_PIN8)
+#define GPIO_SPI1_MISO_1         (GPIO_ALT | GPIO_AF0 | GPIO_PORTA | GPIO_PIN6)
+#define GPIO_SPI1_MISO_2         (GPIO_ALT | GPIO_AF0 | GPIO_PORTA | GPIO_PIN11)
+#define GPIO_SPI1_MISO_3         (GPIO_ALT | GPIO_AF0 | GPIO_PORTB | GPIO_PIN4)
+#define GPIO_SPI1_MISO_4         (GPIO_ALT | GPIO_AF1 | GPIO_PORTD | GPIO_PIN5)
+#define GPIO_SPI1_MOSI_1         (GPIO_ALT | GPIO_AF0 | GPIO_PORTA | GPIO_PIN2)
+#define GPIO_SPI1_MOSI_2         (GPIO_ALT | GPIO_AF0 | GPIO_PORTA | GPIO_PIN7)
+#define GPIO_SPI1_MOSI_3         (GPIO_ALT | GPIO_AF0 | GPIO_PORTA | GPIO_PIN12)
+#define GPIO_SPI1_MOSI_4         (GPIO_ALT | GPIO_AF0 | GPIO_PORTB | GPIO_PIN5)
+#define GPIO_SPI1_MOSI_5         (GPIO_ALT | GPIO_AF1 | GPIO_PORTD | GPIO_PIN6)
+
+#define GPIO_SPI2_SCK_1          (GPIO_ALT | GPIO_AF0 | GPIO_PORTA | GPIO_PIN0)
+#define GPIO_SPI2_SCK_2          (GPIO_ALT | GPIO_AF0 | GPIO_PORTB | GPIO_PIN13)
+#define GPIO_SPI2_SCK_3          (GPIO_ALT | GPIO_AF1 | GPIO_PORTB | GPIO_PIN13)
+#define GPIO_SPI2_SCK_4          (GPIO_ALT | GPIO_AF1 | GPIO_PORTD | GPIO_PIN1)
+#define GPIO_SPI2_SCK_5          (GPIO_ALT | GPIO_AF5 | GPIO_PORTB | GPIO_PIN10)
+#define GPIO_SPI2_MISO_1         (GPIO_ALT | GPIO_AF0 | GPIO_PORTA | GPIO_PIN3)
+#define GPIO_SPI2_MISO_2         (GPIO_ALT | GPIO_AF4 | GPIO_PORTA | GPIO_PIN9)
+#define GPIO_SPI2_MISO_3         (GPIO_ALT | GPIO_AF1 | GPIO_PORTB | GPIO_PIN2)
+#define GPIO_SPI2_MISO_4         (GPIO_ALT | GPIO_AF4 | GPIO_PORTB | GPIO_PIN6)
+#define GPIO_SPI2_MISO_5         (GPIO_ALT | GPIO_AF0 | GPIO_PORTB | GPIO_PIN14)
+#define GPIO_SPI2_MISO_6         (GPIO_ALT | GPIO_AF1 | GPIO_PORTC | GPIO_PIN2)
+#define GPIO_SPI2_MISO_7         (GPIO_ALT | GPIO_AF1 | GPIO_PORTD | GPIO_PIN3)
+#define GPIO_SPI2_MOSI_1         (GPIO_ALT | GPIO_AF1 | GPIO_PORTA | GPIO_PIN4)
+#define GPIO_SPI2_MOSI_2         (GPIO_ALT | GPIO_AF0 | GPIO_PORTA | GPIO_PIN10)
+#define GPIO_SPI2_MOSI_3         (GPIO_ALT | GPIO_AF1 | GPIO_PORTB | GPIO_PIN7)
+#define GPIO_SPI2_MOSI_4         (GPIO_ALT | GPIO_AF1 | GPIO_PORTB | GPIO_PIN11)
+#define GPIO_SPI2_MOSI_5         (GPIO_ALT | GPIO_AF0 | GPIO_PORTB | GPIO_PIN15)
+#define GPIO_SPI2_MOSI_6         (GPIO_ALT | GPIO_AF1 | GPIO_PORTC | GPIO_PIN3)
+#define GPIO_SPI2_MOSI_7         (GPIO_ALT | GPIO_AF1 | GPIO_PORTD | GPIO_PIN4)
 
 /* Timers */
 
@@ -192,9 +226,30 @@
 #define GPIO_USART2_TX_2    (GPIO_ALT | GPIO_PULLUP | GPIO_AF1 | GPIO_SPEED_HIGH | GPIO_PUSHPULL | GPIO_PORTA | GPIO_PIN14)
 #define GPIO_USART2_TX_3    (GPIO_ALT | GPIO_PULLUP | GPIO_AF0 | GPIO_SPEED_HIGH | GPIO_PUSHPULL | GPIO_PORTD | GPIO_PIN6)
 
-/* TODO: USART3 */
-
-/* TODO: USART4 */
+#define GPIO_USART3_CTS_1   (GPIO_ALT | GPIO_AF4 | GPIO_PORTA | GPIO_PIN6)
+#define GPIO_USART3_CTS_2   (GPIO_ALT | GPIO_AF4 | GPIO_PORTB | GPIO_PIN13)
+#define GPIO_USART3_RX_1    (GPIO_ALT | GPIO_PULLUP | GPIO_AF4 | GPIO_SPEED_HIGH | GPIO_PUSHPULL | GPIO_PORTA | GPIO_PIN3)
+#define GPIO_USART3_RX_2    (GPIO_ALT | GPIO_PULLUP | GPIO_AF4 | GPIO_SPEED_HIGH | GPIO_PUSHPULL | GPIO_PORTB | GPIO_PIN0)
+#define GPIO_USART3_RX_3    (GPIO_ALT | GPIO_PULLUP | GPIO_AF4 | GPIO_SPEED_HIGH | GPIO_PUSHPULL | GPIO_PORTB | GPIO_PIN9)
+#define GPIO_USART3_RX_4    (GPIO_ALT | GPIO_PULLUP | GPIO_AF4 | GPIO_SPEED_HIGH | GPIO_PUSHPULL | GPIO_PORTB | GPIO_PIN11)
+#define GPIO_USART3_RX_5    (GPIO_ALT | GPIO_PULLUP | GPIO_AF0 | GPIO_SPEED_HIGH | GPIO_PUSHPULL | GPIO_PORTC | GPIO_PIN5)
+#define GPIO_USART3_RX_6    (GPIO_ALT | GPIO_PULLUP | GPIO_AF0 | GPIO_SPEED_HIGH | GPIO_PUSHPULL | GPIO_PORTC | GPIO_PIN11)
+#define GPIO_USART3_TX_1    (GPIO_ALT | GPIO_PULLUP | GPIO_AF4 | GPIO_SPEED_HIGH | GPIO_PUSHPULL | GPIO_PORTA | GPIO_PIN5)
+#define GPIO_USART3_TX_2    (GPIO_ALT | GPIO_PULLUP | GPIO_AF4 | GPIO_SPEED_HIGH | GPIO_PUSHPULL | GPIO_PORTB | GPIO_PIN2)
+#define GPIO_USART3_TX_3    (GPIO_ALT | GPIO_PULLUP | GPIO_AF4 | GPIO_SPEED_HIGH | GPIO_PUSHPULL | GPIO_PORTB | GPIO_PIN8)
+#define GPIO_USART3_TX_4    (GPIO_ALT | GPIO_PULLUP | GPIO_AF4 | GPIO_SPEED_HIGH | GPIO_PUSHPULL | GPIO_PORTB | GPIO_PIN10)
+#define GPIO_USART3_TX_5    (GPIO_ALT | GPIO_PULLUP | GPIO_AF0 | GPIO_SPEED_HIGH | GPIO_PUSHPULL | GPIO_PORTC | GPIO_PIN4)
+#define GPIO_USART3_TX_6    (GPIO_ALT | GPIO_PULLUP | GPIO_AF0 | GPIO_SPEED_HIGH | GPIO_PUSHPULL | GPIO_PORTC | GPIO_PIN10)
+#define GPIO_USART3_RTS_1   (GPIO_ALT | GPIO_AF5 | GPIO_PORTA | GPIO_PIN15)
+#define GPIO_USART3_RTS_2   (GPIO_ALT | GPIO_AF4 | GPIO_PORTB | GPIO_PIN1)
+#define GPIO_USART3_RTS_3   (GPIO_ALT | GPIO_AF4 | GPIO_PORTB | GPIO_PIN14)
+
+#define GPIO_USART4_CTS_1   (GPIO_ALT | GPIO_AF4 | GPIO_PORTB | GPIO_PIN7)
+#define GPIO_USART4_RX_1    (GPIO_ALT | GPIO_PULLUP | GPIO_AF4 | GPIO_SPEED_HIGH | GPIO_PUSHPULL | GPIO_PORTA | GPIO_PIN1)
+#define GPIO_USART4_RX_2    (GPIO_ALT | GPIO_PULLUP | GPIO_AF1 | GPIO_SPEED_HIGH | GPIO_PUSHPULL | GPIO_PORTC | GPIO_PIN11)
+#define GPIO_USART4_TX_1    (GPIO_ALT | GPIO_PULLUP | GPIO_AF4 | GPIO_SPEED_HIGH | GPIO_PUSHPULL | GPIO_PORTA | GPIO_PIN0)
+#define GPIO_USART4_TX_2    (GPIO_ALT | GPIO_PULLUP | GPIO_AF1 | GPIO_SPEED_HIGH | GPIO_PUSHPULL | GPIO_PORTC | GPIO_PIN10)
+#define GPIO_USART4_RTS_1   (GPIO_ALT | GPIO_AF4 | GPIO_PORTA | GPIO_PIN15)
 
 /* TODO: LPTIM */
 
diff --git a/arch/arm/src/stm32f0l0g0/stm32_serial_v2.c b/arch/arm/src/stm32f0l0g0/stm32_serial_v2.c
index ff607e46ea..a9e836bbc3 100644
--- a/arch/arm/src/stm32f0l0g0/stm32_serial_v2.c
+++ b/arch/arm/src/stm32f0l0g0/stm32_serial_v2.c
@@ -52,13 +52,6 @@
 
 #include <arch/board/board.h>
 
-#ifdef CONFIG_STM32F0L0G0_USART3
-#  error not supported yet
-#endif
-#ifdef CONFIG_STM32F0L0G0_USART4
-#  error not supported yet
-#endif
-
 /****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
@@ -349,9 +342,113 @@ static struct up_dev_s g_usart2priv =
 };
 #endif
 
-/* TODO: USART3 */
+/* This describes the state of the STM32 USART3 port. */
+
+#ifdef CONFIG_STM32F0L0G0_USART3
+static struct up_dev_s g_usart3priv =
+{
+  .dev =
+    {
+#if CONSOLE_USART == 3
+      .isconsole = true,
+#endif
+      .recv      =
+      {
+        .size    = CONFIG_USART3_RXBUFSIZE,
+        .buffer  = g_usart3rxbuffer,
+      },
+      .xmit      =
+      {
+        .size    = CONFIG_USART3_TXBUFSIZE,
+        .buffer  = g_usart3txbuffer,
+      },
+      .ops       = &g_uart_ops,
+      .priv      = &g_usart3priv,
+    },
+
+  .irq           = STM32_IRQ_USART3,
+  .rxftcfg       = 0,           /* No FIFO */
+  .parity        = CONFIG_USART3_PARITY,
+  .bits          = CONFIG_USART3_BITS,
+  .stopbits2     = CONFIG_USART3_2STOP,
+  .baud          = CONFIG_USART3_BAUD,
+  .apbclock      = STM32_PCLK1_FREQUENCY,
+  .usartbase     = STM32_USART3_BASE,
+  .tx_gpio       = GPIO_USART3_TX,
+  .rx_gpio       = GPIO_USART3_RX,
+#if defined(CONFIG_SERIAL_OFLOWCONTROL) && defined(CONFIG_USART3_OFLOWCONTROL)
+  .oflow         = true,
+  .cts_gpio      = GPIO_USART3_CTS,
+#endif
+#if defined(CONFIG_SERIAL_IFLOWCONTROL) && defined(CONFIG_USART3_IFLOWCONTROL)
+  .iflow         = true,
+  .rts_gpio      = GPIO_USART3_RTS,
+#endif
 
-/* TODO: USART4 */
+#ifdef CONFIG_USART3_RS485
+  .rs485_dir_gpio = GPIO_USART3_RS485_DIR,
+#  if (CONFIG_USART3_RS485_DIR_POLARITY == 0)
+  .rs485_dir_polarity = false,
+#  else
+  .rs485_dir_polarity = true,
+#  endif
+#endif
+};
+#endif
+
+/* This describes the state of the STM32 USART4 port. */
+
+#ifdef CONFIG_STM32F0L0G0_USART4
+static struct up_dev_s g_usart4priv =
+{
+  .dev =
+    {
+#if CONSOLE_USART == 4
+      .isconsole = true,
+#endif
+      .recv      =
+      {
+        .size    = CONFIG_USART4_RXBUFSIZE,
+        .buffer  = g_usart4rxbuffer,
+      },
+      .xmit      =
+      {
+        .size    = CONFIG_USART4_TXBUFSIZE,
+        .buffer  = g_usart4txbuffer,
+      },
+      .ops       = &g_uart_ops,
+      .priv      = &g_usart4priv,
+    },
+
+  .irq           = STM32_IRQ_USART4,
+  .rxftcfg       = 0,           /* No FIFO */
+  .parity        = CONFIG_USART4_PARITY,
+  .bits          = CONFIG_USART4_BITS,
+  .stopbits2     = CONFIG_USART4_2STOP,
+  .baud          = CONFIG_USART4_BAUD,
+  .apbclock      = STM32_PCLK1_FREQUENCY,
+  .usartbase     = STM32_USART4_BASE,
+  .tx_gpio       = GPIO_USART4_TX,
+  .rx_gpio       = GPIO_USART4_RX,
+#if defined(CONFIG_SERIAL_OFLOWCONTROL) && defined(CONFIG_USART4_OFLOWCONTROL)
+  .oflow         = true,
+  .cts_gpio      = GPIO_USART4_CTS,
+#endif
+#if defined(CONFIG_SERIAL_IFLOWCONTROL) && defined(CONFIG_USART4_IFLOWCONTROL)
+  .iflow         = true,
+  .rts_gpio      = GPIO_USART4_RTS,
+#endif
+
+#ifdef CONFIG_USART4_RS485
+  .rs485_dir_gpio = GPIO_USART4_RS485_DIR,
+#  if (CONFIG_USART4_RS485_DIR_POLARITY == 0)
+  .rs485_dir_polarity = false,
+#  else
+  .rs485_dir_polarity = true,
+#  endif
+#endif
+};
+#endif
 
 /* This table lets us iterate over the configured USARTs */
 


[incubator-nuttx] 02/02: boards: add initial support for stm32g071b-disco board

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 2192b8df2bf8813bc8d276e492eb26089e8e6821
Author: raiden00pl <ra...@railab.me>
AuthorDate: Thu Jul 7 19:06:22 2022 +0200

    boards: add initial support for stm32g071b-disco board
---
 boards/Kconfig                                     |   9 +
 boards/arm/stm32f0l0g0/stm32g071b-disco/Kconfig    |   8 +
 boards/arm/stm32f0l0g0/stm32g071b-disco/README.txt |  15 ++
 .../stm32g071b-disco/configs/nsh/defconfig         |  59 +++++
 .../stm32f0l0g0/stm32g071b-disco/include/board.h   | 178 +++++++++++++
 .../stm32f0l0g0/stm32g071b-disco/scripts/Make.defs |  39 +++
 .../stm32f0l0g0/stm32g071b-disco/scripts/ld.script | 112 ++++++++
 .../arm/stm32f0l0g0/stm32g071b-disco/src/Makefile  |  38 +++
 .../stm32g071b-disco/src/stm32_appinit.c           |  71 +++++
 .../stm32f0l0g0/stm32g071b-disco/src/stm32_boot.c  |  83 ++++++
 .../stm32g071b-disco/src/stm32_bringup.c           |  88 ++++++
 .../stm32g071b-disco/src/stm32_djoystick.c         | 294 +++++++++++++++++++++
 .../stm32g071b-disco/src/stm32_userleds.c          |  90 +++++++
 .../stm32g071b-disco/src/stm32g071b-disco.h        |  96 +++++++
 14 files changed, 1180 insertions(+)

diff --git a/boards/Kconfig b/boards/Kconfig
index ce75222761..e69d9f0888 100644
--- a/boards/Kconfig
+++ b/boards/Kconfig
@@ -1344,6 +1344,14 @@ config ARCH_BOARD_NUCLEO_F446RE
 		This is a minimal configuration that supports low-level test of the
 		Nucleo F446RE in the NuttX source tree.
 
+
+config ARCH_BOARD_STM32G071B_DISCO
+	bool "STM32G071 STM32G071B-DISO "
+	depends on ARCH_CHIP_STM32G071RB
+	select ARCH_HAVE_LEDS
+	---help---
+		The STM32G071B-DISCO board based on the STM32G071RB MCU
+
 config ARCH_BOARD_NUCLEO_G070RB
 	bool "STM32G070 Nucleo G070RB"
 	depends on ARCH_CHIP_STM32G070RB
@@ -2586,6 +2594,7 @@ config ARCH_BOARD
 	default "nucleo-f446re"            if ARCH_BOARD_NUCLEO_F446RE
 	default "nucleo-f410rb"            if ARCH_BOARD_NUCLEO_F410RB
 	default "nucleo-f412zg"            if ARCH_BOARD_NUCLEO_F412ZG
+	default "stm32g071b-disco"         if ARCH_BOARD_STM32G071B_DISCO
 	default "nucleo-g070rb"            if ARCH_BOARD_NUCLEO_G070RB
 	default "nucleo-g071rb"            if ARCH_BOARD_NUCLEO_G071RB
 	default "nucleo-h743zi"            if ARCH_BOARD_NUCLEO_H743ZI
diff --git a/boards/arm/stm32f0l0g0/stm32g071b-disco/Kconfig b/boards/arm/stm32f0l0g0/stm32g071b-disco/Kconfig
new file mode 100644
index 0000000000..956053ae2f
--- /dev/null
+++ b/boards/arm/stm32f0l0g0/stm32g071b-disco/Kconfig
@@ -0,0 +1,8 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+if ARCH_BOARD_STM32G071B_DISCO
+
+endif
diff --git a/boards/arm/stm32f0l0g0/stm32g071b-disco/README.txt b/boards/arm/stm32f0l0g0/stm32g071b-disco/README.txt
new file mode 100644
index 0000000000..65b4bf12e1
--- /dev/null
+++ b/boards/arm/stm32f0l0g0/stm32g071b-disco/README.txt
@@ -0,0 +1,15 @@
+README
+======
+
+  This README discusses issues unique to NuttX configurations for the
+  STMicro STM32G071B-DISCO development board.  The STM32G071B-DISCO board
+  is based on the STM32G071RB MCU (128Kbytes FLASH and 32Kbytes of SRAM).
+
+  The boards features:
+
+    - An ST-LINK/V2-1 embedded debug tool interface,
+    - 128 x 64 pixels OLED display (SSD1315Z)
+    - LEDs,
+    - 4-way joystick
+    - USB Type-C current sensing based on the INA230 I2C
+      current-shunt and power monitor
diff --git a/boards/arm/stm32f0l0g0/stm32g071b-disco/configs/nsh/defconfig b/boards/arm/stm32f0l0g0/stm32g071b-disco/configs/nsh/defconfig
new file mode 100644
index 0000000000..29ea257999
--- /dev/null
+++ b/boards/arm/stm32f0l0g0/stm32g071b-disco/configs/nsh/defconfig
@@ -0,0 +1,59 @@
+#
+# This file is autogenerated: PLEASE DO NOT EDIT IT.
+#
+# You can use "make menuconfig" to make any modifications to the installed .config file.
+# You can then do "make savedefconfig" to generate a new defconfig file that includes your
+# modifications.
+#
+# CONFIG_ARCH_LEDS is not set
+# CONFIG_LIBC_LONG_LONG is not set
+# CONFIG_NSH_ARGCAT is not set
+CONFIG_ARCH="arm"
+CONFIG_ARCH_BOARD="stm32g071b-disco"
+CONFIG_ARCH_BOARD_STM32G071B_DISCO=y
+CONFIG_ARCH_CHIP="stm32f0l0g0"
+CONFIG_ARCH_CHIP_STM32G071RB=y
+CONFIG_ARCH_CHIP_STM32G0=y
+CONFIG_ARCH_STACKDUMP=y
+CONFIG_BOARD_LOOPSPERMSEC=2796
+CONFIG_BUILTIN=y
+CONFIG_DISABLE_ENVIRON=y
+CONFIG_DISABLE_MOUNTPOINT=y
+CONFIG_DISABLE_MQUEUE=y
+CONFIG_DISABLE_POSIX_TIMERS=y
+CONFIG_DISABLE_PSEUDOFS_OPERATIONS=y
+CONFIG_EXAMPLES_DJOYSTICK=y
+CONFIG_EXAMPLES_HELLO=y
+CONFIG_INIT_ENTRYPOINT="nsh_main"
+CONFIG_INIT_STACKSIZE=1536
+CONFIG_INPUT=y
+CONFIG_INPUT_DJOYSTICK=y
+CONFIG_INTELHEX_BINARY=y
+CONFIG_MM_SMALL=y
+CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=6
+CONFIG_NSH_BUILTIN_APPS=y
+CONFIG_NSH_FILEIOSIZE=64
+CONFIG_NSH_LINELEN=64
+CONFIG_NSH_READLINE=y
+CONFIG_NUNGET_CHARS=0
+CONFIG_PREALLOC_TIMERS=0
+CONFIG_PTHREAD_MUTEX_UNSAFE=y
+CONFIG_PTHREAD_STACK_DEFAULT=1536
+CONFIG_RAM_SIZE=32760
+CONFIG_RAM_START=0x20000000
+CONFIG_RAW_BINARY=y
+CONFIG_RR_INTERVAL=200
+CONFIG_SCHED_WAITPID=y
+CONFIG_START_DAY=19
+CONFIG_START_MONTH=5
+CONFIG_START_YEAR=2013
+CONFIG_STDIO_DISABLE_BUFFERING=y
+CONFIG_STM32F0L0G0_PWR=y
+CONFIG_STM32F0L0G0_USART3=y
+CONFIG_SYSTEM_NSH=y
+CONFIG_TASK_NAME_SIZE=0
+CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=1536
+CONFIG_TLS_NELEM=0
+CONFIG_USART3_SERIAL_CONSOLE=y
+CONFIG_USERLED=y
+CONFIG_USERLED_LOWER=y
diff --git a/boards/arm/stm32f0l0g0/stm32g071b-disco/include/board.h b/boards/arm/stm32f0l0g0/stm32g071b-disco/include/board.h
new file mode 100644
index 0000000000..092d288eb9
--- /dev/null
+++ b/boards/arm/stm32f0l0g0/stm32g071b-disco/include/board.h
@@ -0,0 +1,178 @@
+/****************************************************************************
+ * boards/arm/stm32f0l0g0/stm32g071b-disco/include/board.h
+ *
+ * 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 __BOARDS_ARM_STM32F0L0G0_STM32G071B_DISCO_INCLUDE_BOARD_H
+#define __BOARDS_ARM_STM32F0L0G0_STM32G071B_DISCO_INCLUDE_BOARD_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Clocking *****************************************************************/
+
+/* HSI - Internal 16 MHz RC Oscillator
+ * LSI - 32 KHz RC
+ * HSE - 8 MHz from MCO output of ST-LINK
+ * LSE - 32.768 kHz
+ */
+
+#define STM32_BOARD_XTAL        8000000ul
+
+#define STM32_HSI_FREQUENCY     16000000ul
+#define STM32_LSI_FREQUENCY     32000            /* Between 30kHz and 60kHz */
+#define STM32_HSE_FREQUENCY     STM32_BOARD_XTAL
+#define STM32_LSE_FREQUENCY     32768            /* X2 on board */
+
+/* Main PLL Configuration.
+ *
+ * PLL source is HSI = 16,000,000
+ *
+ * PLL_VCOx = (STM32_HSE_FREQUENCY / PLLM) * PLLN
+ * Subject to:
+ *
+ *   1 <= PLLM <= 8
+ *   8 <= PLLN <= 86
+ *   4 MHz <= PLL_IN <= 16MHz
+ *   64 MHz <= PLL_VCO <= 344MHz
+ *   SYSCLK  = PLLRCLK = PLL_VCO / PLLR
+ *
+ */
+
+/* PLL source is HSI, PLLN=50, PLLM=4
+ * PLLP enable, PLLQ enable, PLLR enable
+ *
+ *   2 <= PLLP <= 32
+ *   2 <= PLLQ <= 8
+ *   2 <= PLLR <= 8
+ *
+ *   PLLR <= 64MHz
+ *   PLLQ <= 128MHz
+ *   PLLP <= 128MHz
+ *
+ *   PLL_VCO = (16,000,000 / 4) * 50 = 200 MHz
+ *
+ *   PLLP = PLL_VCO/4 = 200 MHz / 4 = 40 MHz
+ *   PLLQ = PLL_VCO/4 = 200 MHz / 4 = 40 MHz
+ *   PLLR = PLL_VCO/4 = 200 MHz / 4 = 40 MHz
+ */
+
+#define STM32_PLLCFG_PLLSRC     RCC_PLLCFG_PLLSRC_HSI
+#define STM32_PLLCFG_PLLCFG     (RCC_PLLCFG_PLLPEN | \
+                                 RCC_PLLCFG_PLLQEN | \
+                                 RCC_PLLCFG_PLLREN)
+
+#define STM32_PLLCFG_PLLM       RCC_PLLCFG_PLLM(4)
+#define STM32_PLLCFG_PLLN       RCC_PLLCFG_PLLN(50)
+#define STM32_PLLCFG_PLLP       RCC_PLLCFG_PLLP(4)
+#define STM32_PLLCFG_PLLQ       RCC_PLLCFG_PLLQ(4)
+#define STM32_PLLCFG_PLLR       RCC_PLLCFG_PLLR(4)
+
+#define STM32_VCO_FREQUENCY     ((STM32_HSE_FREQUENCY / 2) * 50)
+#define STM32_PLLP_FREQUENCY    (STM32_VCO_FREQUENCY / 4)
+#define STM32_PLLQ_FREQUENCY    (STM32_VCO_FREQUENCY / 4)
+#define STM32_PLLR_FREQUENCY    (STM32_VCO_FREQUENCY / 4)
+
+/* Use the PLL and set the SYSCLK source to be the PLLR (40MHz) */
+
+#define STM32_SYSCLK_SW         RCC_CFGR_SW_PLL
+#define STM32_SYSCLK_SWS        RCC_CFGR_SWS_PLL
+#define STM32_SYSCLK_FREQUENCY  (STM32_PLLR_FREQUENCY)
+#define STM32_SYSCLK_FREQUENCY  (STM32_PLLR_FREQUENCY)
+
+/* AHB clock (HCLK) is SYSCLK (40MHz) */
+
+#define STM32_RCC_CFGR_HPRE     RCC_CFGR_HPRE_SYSCLK
+#define STM32_HCLK_FREQUENCY    STM32_SYSCLK_FREQUENCY
+
+/* APB1 clock (PCLK1) is HCLK/2 (20MHz) */
+
+#define STM32_RCC_CFGR_PPRE1    RCC_CFGR_PPRE1_HCLKd2
+#define STM32_PCLK1_FREQUENCY   (STM32_HCLK_FREQUENCY/2)
+
+/* LED definitions **********************************************************/
+
+/* LED index values for use with board_userled() */
+
+#define BOARD_LEDSINK   0 /* LD4: SINK mode LED */
+#define BOARD_LEDSOURCE 1 /* LD5: SOURCE mode LED */
+#define BOARD_LEDSPY    2 /* LD6: SPY mode LED */
+#define BOARD_LEDCC     3 /* LD7: CC mode LED */
+#define BOARD_NLEDS     4
+
+/* LED bits for use with board_userled_all() */
+
+#define BOARD_LEDSINK_BIT   (1 << BOARD_LEDSINK)
+#define BOARD_LEDSOURCE_BIT (1 << BOARD_LEDSOURCE)
+#define BOARD_LEDSPY_BIT    (1 << BOARD_LEDSPY)
+#define BOARD_LEDCC_BIT     (1 << BOARD_LEDCC)
+
+/* Button definitions *******************************************************/
+
+/* The STM32G071B-DISO supports one buttons:
+ *
+ *   B1 RESET: push button connected to NRST is used to RESET the
+ *             STM32G071RB.
+ *
+ * and a Joystick:
+ *
+ *   Joystick center - PC0
+ *   Joystick down   - PC2
+ *   Joystick left   - PC1
+ *   Joystick right  - PC3
+ *   Joystick up     - PC4
+ */
+
+/* Alternate function pin selections ****************************************/
+
+/* USART */
+
+/* By default the USART3 is connected to STLINK Virtual COM Port:
+ * USART3_RX - PC11
+ * USART3_TX - PC10
+ */
+
+#define GPIO_USART3_RX GPIO_USART3_RX_6 /* PC11 */
+#define GPIO_USART3_TX GPIO_USART3_TX_6 /* PC10 */
+
+/* I2C1
+ *   I2C1_SCL - PB6
+ *   I2C1_SDA - PB7
+ */
+
+#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 /* PB6 */
+#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 /* PB7 */
+
+/* SPI1 - OLED display
+ *   SPI1_MISO - not used
+ *   SPI1_MOSI - PA2
+ *   SPI1_SCK  - PA1
+ */
+
+#undef  GPIO_SPI1_MISO                  /* Not used */
+#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1 /* PA2 */
+#define GPIO_SPI1_SCK  GPIO_SPI1_SCK_1  /* PA1 */
+
+#endif /* __BOARDS_ARM_STM32F0L0G0_STM32G071B_DISCO_INCLUDE_BOARD_H */
diff --git a/boards/arm/stm32f0l0g0/stm32g071b-disco/scripts/Make.defs b/boards/arm/stm32f0l0g0/stm32g071b-disco/scripts/Make.defs
new file mode 100644
index 0000000000..0d892e32cb
--- /dev/null
+++ b/boards/arm/stm32f0l0g0/stm32g071b-disco/scripts/Make.defs
@@ -0,0 +1,39 @@
+############################################################################
+# boards/arm/stm32f0l0g0/stm32g071b-disco/scripts/Make.defs
+#
+# 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.
+#
+############################################################################
+
+include $(TOPDIR)/.config
+include $(TOPDIR)/tools/Config.mk
+include $(TOPDIR)/arch/arm/src/armv6-m/Toolchain.defs
+
+LDSCRIPT = ld.script
+ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)$(LDSCRIPT)
+
+ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10
+
+CFLAGS := $(ARCHCFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe
+CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
+CXXFLAGS := $(ARCHCXXFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe
+CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
+CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
+AFLAGS := $(CFLAGS) -D__ASSEMBLY__
+
+NXFLATLDFLAGS1 = -r -d -warn-common
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
+LDNXFLATFLAGS = -e main -s 2048
diff --git a/boards/arm/stm32f0l0g0/stm32g071b-disco/scripts/ld.script b/boards/arm/stm32f0l0g0/stm32g071b-disco/scripts/ld.script
new file mode 100644
index 0000000000..beb5b1237c
--- /dev/null
+++ b/boards/arm/stm32f0l0g0/stm32g071b-disco/scripts/ld.script
@@ -0,0 +1,112 @@
+/****************************************************************************
+* boards/arm/stm32f0l0g0/stm32g071b-disco/scripts/ld.script
+ *
+ * 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.
+ *
+ ****************************************************************************/
+
+/* The STM32GO71RB has 128Kb of FLASH beginning at address 0x0800:0000.
+ * 32Kb of SRAM
+ *
+ * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000
+ * where the code expects to begin execution by jumping to the entry point in
+ * the 0x0800:0000 address range.
+ */
+
+MEMORY
+{
+  flash (rx) : ORIGIN = 0x08000000, LENGTH = 128K
+  sram (rwx) : ORIGIN = 0x20000000, LENGTH = 32K
+}
+
+OUTPUT_ARCH(arm)
+EXTERN(_vectors)
+ENTRY(_stext)
+SECTIONS
+{
+    .text : {
+        _stext = ABSOLUTE(.);
+        *(.vectors)
+        *(.text .text.*)
+        *(.fixup)
+        *(.gnu.warning)
+        *(.rodata .rodata.*)
+        *(.gnu.linkonce.t.*)
+        *(.glue_7)
+        *(.glue_7t)
+        *(.got)
+        *(.gcc_except_table)
+        *(.gnu.linkonce.r.*)
+        _etext = ABSOLUTE(.);
+    } > flash
+
+    .init_section : ALIGN(4) {
+        _sinit = ABSOLUTE(.);
+        *(.init_array .init_array.*)
+        _einit = ABSOLUTE(.);
+    } > flash
+
+    .ARM.extab : ALIGN(4) {
+        *(.ARM.extab*)
+    } > flash
+
+    .ARM.exidx : ALIGN(4) {
+        __exidx_start = ABSOLUTE(.);
+        *(.ARM.exidx*)
+        __exidx_end = ABSOLUTE(.);
+    } > flash
+
+    _eronly = ABSOLUTE(.);
+
+    /* The RAM vector table (if present) should lie at the beginning of SRAM */
+
+    .ram_vectors : {
+        *(.ram_vectors)
+    } > sram
+
+    .data : ALIGN(4) {
+        _sdata = ABSOLUTE(.);
+        *(.data .data.*)
+        *(.gnu.linkonce.d.*)
+        CONSTRUCTORS
+        . = ALIGN(4);
+        _edata = ABSOLUTE(.);
+    } > sram AT > flash
+
+    .bss : ALIGN(4) {
+        _sbss = ABSOLUTE(.);
+        *(.bss .bss.*)
+        *(.gnu.linkonce.b.*)
+        *(COMMON)
+        . = ALIGN(4);
+        _ebss = ABSOLUTE(.);
+    } > sram
+
+    /* Stabs debugging sections. */
+
+    .stab 0 : { *(.stab) }
+    .stabstr 0 : { *(.stabstr) }
+    .stab.excl 0 : { *(.stab.excl) }
+    .stab.exclstr 0 : { *(.stab.exclstr) }
+    .stab.index 0 : { *(.stab.index) }
+    .stab.indexstr 0 : { *(.stab.indexstr) }
+    .comment 0 : { *(.comment) }
+    .debug_abbrev 0 : { *(.debug_abbrev) }
+    .debug_info 0 : { *(.debug_info) }
+    .debug_line 0 : { *(.debug_line) }
+    .debug_pubnames 0 : { *(.debug_pubnames) }
+    .debug_aranges 0 : { *(.debug_aranges) }
+}
diff --git a/boards/arm/stm32f0l0g0/stm32g071b-disco/src/Makefile b/boards/arm/stm32f0l0g0/stm32g071b-disco/src/Makefile
new file mode 100644
index 0000000000..76f9124adf
--- /dev/null
+++ b/boards/arm/stm32f0l0g0/stm32g071b-disco/src/Makefile
@@ -0,0 +1,38 @@
+############################################################################
+# boards/arm/stm32f0l0g0/stm32g071b-disco/src/Makefile
+#
+# 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.
+#
+############################################################################
+
+include $(TOPDIR)/Make.defs
+
+CSRCS = stm32_boot.c stm32_bringup.c
+
+# no auto leds
+ifeq ($(CONFIG_USERLED),y)
+CSRCS += stm32_userleds.c
+endif
+
+ifeq ($(CONFIG_BOARDCTL),y)
+CSRCS += stm32_appinit.c
+endif
+
+ifeq ($(CONFIG_INPUT_DJOYSTICK),y)
+CSRCS += stm32_djoystick.c
+endif
+
+include $(TOPDIR)/boards/Board.mk
diff --git a/boards/arm/stm32f0l0g0/stm32g071b-disco/src/stm32_appinit.c b/boards/arm/stm32f0l0g0/stm32g071b-disco/src/stm32_appinit.c
new file mode 100644
index 0000000000..f03c6fb054
--- /dev/null
+++ b/boards/arm/stm32f0l0g0/stm32g071b-disco/src/stm32_appinit.c
@@ -0,0 +1,71 @@
+/****************************************************************************
+ * boards/arm/stm32f0l0g0/stm32g071b-disco/src/stm32_appinit.c
+ *
+ * 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 <sys/types.h>
+
+#include "stm32g071b-disco.h"
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: board_app_initialize
+ *
+ * Description:
+ *   Perform application specific initialization.  This function is never
+ *   called directly from application code, but only indirectly via the
+ *   (non-standard) boardctl() interface using the command BOARDIOC_INIT.
+ *
+ * Input Parameters:
+ *   arg - The boardctl() argument is passed to the board_app_initialize()
+ *         implementation without modification.  The argument has no
+ *         meaning to NuttX; the meaning of the argument is a contract
+ *         between the board-specific initialization logic and the
+ *         matching application logic.  The value could be such things as a
+ *         mode enumeration value, a set of DIP switch switch settings, a
+ *         pointer to configuration data read from a file or serial FLASH,
+ *         or whatever you would like to do with it.  Every implementation
+ *         should accept zero/NULL as a default configuration.
+ *
+ * Returned Value:
+ *   Zero (OK) is returned on success; a negated errno value is returned on
+ *   any failure to indicate the nature of the failure.
+ *
+ ****************************************************************************/
+
+int board_app_initialize(uintptr_t arg)
+{
+#ifdef CONFIG_BOARD_LATE_INITIALIZE
+  /* Board initialization already performed by board_late_initialize() */
+
+  return OK;
+#else
+  /* Perform board-specific initialization */
+
+  return stm32_bringup();
+#endif
+}
diff --git a/boards/arm/stm32f0l0g0/stm32g071b-disco/src/stm32_boot.c b/boards/arm/stm32f0l0g0/stm32g071b-disco/src/stm32_boot.c
new file mode 100644
index 0000000000..2124827276
--- /dev/null
+++ b/boards/arm/stm32f0l0g0/stm32g071b-disco/src/stm32_boot.c
@@ -0,0 +1,83 @@
+/****************************************************************************
+ * boards/arm/stm32f0l0g0/stm32g071b-disco/src/stm32_boot.c
+ *
+ * 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 <nuttx/board.h>
+#include <arch/board/board.h>
+
+#include "stm32g071b-disco.h"
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: stm32_boardinitialize
+ *
+ * Description:
+ *   All STM32 architectures must provide the following entry point.  This
+ *   entry point is called early in the initialization -- after all memory
+ *   has been configured and mapped but before any devices have been
+ *   initialized.
+ *
+ ****************************************************************************/
+
+void stm32_boardinitialize(void)
+{
+#ifdef CONFIG_ARCH_LEDS
+  /* Configure on-board LEDs if LED support has been selected. */
+
+  board_autoled_initialize();
+#endif
+
+#ifdef CONFIG_STM32F0L0G0_SPI
+  /* Configure SPI chip selects */
+
+  stm32_spidev_initialize();
+#endif
+}
+
+/****************************************************************************
+ * Name: board_late_initialize
+ *
+ * Description:
+ *   If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional
+ *   initialization call will be performed in the boot-up sequence to a
+ *   function called board_late_initialize().  board_late_initialize() will
+ *   be called immediately after up_initialize() is called and just before
+ *   the initial application is started.  This additional initialization
+ *   phase may be used, for example, to initialize board-specific device
+ *   drivers.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_BOARD_LATE_INITIALIZE
+void board_late_initialize(void)
+{
+  /* Perform board-specific initialization */
+
+  stm32_bringup();
+}
+#endif
diff --git a/boards/arm/stm32f0l0g0/stm32g071b-disco/src/stm32_bringup.c b/boards/arm/stm32f0l0g0/stm32g071b-disco/src/stm32_bringup.c
new file mode 100644
index 0000000000..91787c9f25
--- /dev/null
+++ b/boards/arm/stm32f0l0g0/stm32g071b-disco/src/stm32_bringup.c
@@ -0,0 +1,88 @@
+/****************************************************************************
+ * boards/arm/stm32f0l0g0/stm32g071b-disco/src/stm32_bringup.c
+ *
+ * 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 <sys/types.h>
+#include <syslog.h>
+
+#include <nuttx/board.h>
+
+#include "stm32g071b-disco.h"
+
+#ifdef CONFIG_USERLED
+#  include <nuttx/leds/userled.h>
+#endif
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: stm32_bringup
+ *
+ * Description:
+ *   Perform architecture-specific initialization
+ *
+ *   CONFIG_BOARD_LATE_INITIALIZE=y :
+ *     Called from board_late_initialize().
+ *
+ *   CONFIG_BOARD_LATE_INITIALIZE=n && CONFIG_BOARDCTL=y :
+ *     Called from the NSH library
+ *
+ ****************************************************************************/
+
+int stm32_bringup(void)
+{
+  int ret;
+
+#ifdef CONFIG_USERLED
+  /* Register the LED driver */
+
+  ret = userled_lower_initialize(LED_DRIVER_PATH);
+  if (ret < 0)
+    {
+      syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n",
+             ret);
+      return ret;
+    }
+#endif
+
+#ifdef CONFIG_INPUT_DJOYSTICK
+  /* Initialize and register the joystick driver */
+
+  ret = stm32_djoy_initialization();
+  if (ret != OK)
+    {
+      syslog(LOG_ERR,
+             "ERROR: Failed to register the joystick driver: %d\n", ret);
+      return ret;
+    }
+
+  syslog(LOG_INFO, "Successfully registered the joystick driver\n");
+#endif
+
+  UNUSED(ret);
+  return OK;
+}
diff --git a/boards/arm/stm32f0l0g0/stm32g071b-disco/src/stm32_djoystick.c b/boards/arm/stm32f0l0g0/stm32g071b-disco/src/stm32_djoystick.c
new file mode 100644
index 0000000000..bcfd9455ac
--- /dev/null
+++ b/boards/arm/stm32f0l0g0/stm32g071b-disco/src/stm32_djoystick.c
@@ -0,0 +1,294 @@
+/****************************************************************************
+ * boards/arm/stm32f0l0g0/stm32g071b-disco/src/stm32_djoystick.c
+ *
+ * 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 <assert.h>
+#include <debug.h>
+
+#include <nuttx/irq.h>
+#include <nuttx/arch.h>
+#include <nuttx/input/djoystick.h>
+
+#include "stm32_gpio.h"
+#include "stm32g071b-disco.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Number of Joystick discretes */
+
+#define DJOY_NGPIOS  5
+
+/* Bitset of supported Joystick discretes */
+
+#define DJOY_SUPPORTED (DJOY_UP_BIT | DJOY_DOWN_BIT | DJOY_LEFT_BIT | \
+                        DJOY_RIGHT_BIT | DJOY_BUTTON_SELECT_BIT)
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+static djoy_buttonset_t
+djoy_supported(const struct djoy_lowerhalf_s *lower);
+static djoy_buttonset_t
+djoy_sample(const struct djoy_lowerhalf_s *lower);
+static void djoy_enable(const struct djoy_lowerhalf_s *lower,
+                        djoy_buttonset_t press, djoy_buttonset_t release,
+                        djoy_interrupt_t handler, void *arg);
+
+static void djoy_disable(void);
+static int djoy_interrupt(int irq, void *context, void *arg);
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/* Pin configuration for each stm32g071b-disco joystick "button."
+ * Index using DJOY_* definitions in include/nuttx/input/djoystick.h.
+ */
+
+static const uint32_t g_joygpio[DJOY_NGPIOS] =
+{
+  GPIO_JOY_UP, GPIO_JOY_DOWN, GPIO_JOY_LEFT, GPIO_JOY_RIGHT, GPIO_JOY_SEL
+};
+
+/* Current interrupt handler and argument */
+
+static djoy_interrupt_t g_djoyhandler;
+static void *g_djoyarg;
+
+/* This is the discrete joystick lower half driver interface */
+
+static const struct djoy_lowerhalf_s g_djoylower =
+{
+  .dl_supported  = djoy_supported,
+  .dl_sample     = djoy_sample,
+  .dl_enable     = djoy_enable,
+};
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: djoy_supported
+ *
+ * Description:
+ *   Return the set of buttons supported on the discrete joystick device
+ *
+ ****************************************************************************/
+
+static djoy_buttonset_t
+djoy_supported(const struct djoy_lowerhalf_s *lower)
+{
+  iinfo("Supported: %02x\n", DJOY_SUPPORTED);
+  return (djoy_buttonset_t)DJOY_SUPPORTED;
+}
+
+/****************************************************************************
+ * Name: djoy_sample
+ *
+ * Description:
+ *   Return the current state of all discrete joystick buttons
+ *
+ ****************************************************************************/
+
+static djoy_buttonset_t djoy_sample(const struct djoy_lowerhalf_s *lower)
+{
+  djoy_buttonset_t ret = 0;
+  int i;
+  bool released;
+
+  /* Read each joystick GPIO value */
+
+  for (i = 0; i < DJOY_NGPIOS; i++)
+    {
+      released = stm32_gpioread(g_joygpio[i]);
+      if (!released)
+        {
+          ret |= (1 << i);
+        }
+    }
+
+  iinfo("Retuning: %02x\n", DJOY_SUPPORTED);
+  return ret;
+}
+
+/****************************************************************************
+ * Name: djoy_enable
+ *
+ * Description:
+ *   Enable interrupts on the selected set of joystick buttons.  And empty
+ *   set will disable all interrupts.
+ *
+ ****************************************************************************/
+
+static void djoy_enable(const struct djoy_lowerhalf_s *lower,
+                        djoy_buttonset_t press, djoy_buttonset_t release,
+                        djoy_interrupt_t handler, void *arg)
+{
+  irqstate_t flags;
+  djoy_buttonset_t either = press | release;
+  djoy_buttonset_t bit;
+  bool rising;
+  bool falling;
+  int i;
+
+  /* Start with all interrupts disabled */
+
+  flags = enter_critical_section();
+  djoy_disable();
+
+  iinfo("press: %02x release: %02x handler: %p arg: %p\n",
+        press, release, handler, arg);
+
+  /* If no events are indicated or if no handler is provided, then this
+   * must really be a request to disable interrupts.
+   */
+
+  if (either && handler)
+    {
+      /* Save the new the handler and argument */
+
+      g_djoyhandler = handler;
+      g_djoyarg     = arg;
+
+      /* Check each GPIO. */
+
+      for (i = 0; i < DJOY_NGPIOS; i++)
+        {
+          /* Enable interrupts on each pin that has either a press or
+           * release event associated with it.
+           */
+
+          bit = (1 << i);
+          if ((either & bit) != 0)
+            {
+              /* Active low so a press corresponds to a falling edge and
+               * a release corresponds to a rising edge.
+               */
+
+              falling = ((press & bit) != 0);
+              rising  = ((release & bit) != 0);
+
+              iinfo("GPIO %d: rising: %d falling: %d\n",
+                      i, rising, falling);
+
+              stm32_gpiosetevent(g_joygpio[i], rising, falling,
+                                  true, djoy_interrupt, NULL);
+            }
+        }
+    }
+
+  leave_critical_section(flags);
+}
+
+/****************************************************************************
+ * Name: djoy_disable
+ *
+ * Description:
+ *   Disable all joystick interrupts
+ *
+ ****************************************************************************/
+
+static void djoy_disable(void)
+{
+  irqstate_t flags;
+  int i;
+
+  /* Disable each joystick interrupt */
+
+  flags = enter_critical_section();
+  for (i = 0; i < DJOY_NGPIOS; i++)
+    {
+      stm32_gpiosetevent(g_joygpio[i], false, false, false, NULL, NULL);
+    }
+
+  leave_critical_section(flags);
+
+  /* Nullify the handler and argument */
+
+  g_djoyhandler = NULL;
+  g_djoyarg     = NULL;
+}
+
+/****************************************************************************
+ * Name: djoy_interrupt
+ *
+ * Description:
+ *   Discrete joystick interrupt handler
+ *
+ ****************************************************************************/
+
+static int djoy_interrupt(int irq, void *context, void *arg)
+{
+  DEBUGASSERT(g_djoyhandler);
+  if (g_djoyhandler)
+    {
+      g_djoyhandler(&g_djoylower, g_djoyarg);
+    }
+
+  return OK;
+}
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: stm32_djoy_initialization
+ *
+ * Description:
+ *   Initialize and register the discrete joystick driver
+ *
+ ****************************************************************************/
+
+int stm32_djoy_initialization(void)
+{
+  int i;
+
+  /* Configure the GPIO pins as inputs.    NOTE: This is unnecessary for
+   * interrupting pins since it will also be done by stm32_gpiosetevent().
+   */
+
+  for (i = 0; i < DJOY_NGPIOS; i++)
+    {
+      stm32_configgpio(g_joygpio[i]);
+    }
+
+  /* Make sure that all interrupts are disabled */
+
+  djoy_disable();
+
+  /* Register the joystick device as /dev/djoy0 */
+
+  return djoy_register("/dev/djoy0", &g_djoylower);
+}
diff --git a/boards/arm/stm32f0l0g0/stm32g071b-disco/src/stm32_userleds.c b/boards/arm/stm32f0l0g0/stm32g071b-disco/src/stm32_userleds.c
new file mode 100644
index 0000000000..d97bb11a00
--- /dev/null
+++ b/boards/arm/stm32f0l0g0/stm32g071b-disco/src/stm32_userleds.c
@@ -0,0 +1,90 @@
+/****************************************************************************
+ * boards/arm/stm32f0l0g0/stm32g071b-disco/src/stm32_userleds.c
+ *
+ * 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 <stdbool.h>
+
+#include <nuttx/board.h>
+
+#include "stm32_gpio.h"
+#include "stm32g071b-disco.h"
+
+#include <arch/board/board.h>
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/* This array maps an LED number to GPIO pin configuration */
+
+static uint32_t g_ledcfg[BOARD_NLEDS] =
+{
+  GPIO_LEDSINK, GPIO_LEDSOURCE, GPIO_LEDSPY, GPIO_LEDCC
+};
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: board_userled_initialize
+ ****************************************************************************/
+
+uint32_t board_userled_initialize(void)
+{
+  /* Configure LED GPIOs for output */
+
+  stm32_configgpio(GPIO_LEDSINK);
+  stm32_configgpio(GPIO_LEDSOURCE);
+  stm32_configgpio(GPIO_LEDSPY);
+  stm32_configgpio(GPIO_LEDCC);
+
+  return BOARD_NLEDS;
+}
+
+/****************************************************************************
+ * Name: board_userled
+ ****************************************************************************/
+
+void board_userled(int led, bool ledon)
+{
+  if ((unsigned)led < BOARD_NLEDS)
+    {
+      stm32_gpiowrite(g_ledcfg[led], !ledon);
+    }
+}
+
+/****************************************************************************
+ * Name: board_userled_all
+ ****************************************************************************/
+
+void board_userled_all(uint32_t ledset)
+{
+  stm32_gpiowrite(GPIO_LEDSINK, (ledset & BOARD_LEDSINK_BIT) != 0);
+  stm32_gpiowrite(GPIO_LEDSOURCE, (ledset & BOARD_LEDSOURCE_BIT) != 0);
+  stm32_gpiowrite(GPIO_LEDSPY, (ledset & BOARD_LEDSPY_BIT) != 0);
+  stm32_gpiowrite(GPIO_LEDCC, (ledset & BOARD_LEDCC_BIT) != 0);
+}
diff --git a/boards/arm/stm32f0l0g0/stm32g071b-disco/src/stm32g071b-disco.h b/boards/arm/stm32f0l0g0/stm32g071b-disco/src/stm32g071b-disco.h
new file mode 100644
index 0000000000..f3ee8e7680
--- /dev/null
+++ b/boards/arm/stm32f0l0g0/stm32g071b-disco/src/stm32g071b-disco.h
@@ -0,0 +1,96 @@
+/****************************************************************************
+ * boards/arm/stm32f0l0g0/stm32g071b-disco/src/stm32g071b-disco.h
+ *
+ * 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 __BOARDS_ARM_STM32F0L0G0_STM32G071B_DISCO_SRC_STM32G071B_DISCO_H
+#define __BOARDS_ARM_STM32F0L0G0_STM32G071B_DISCO_SRC_STM32G071B_DISCO_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* LED definitions **********************************************************/
+
+#define GPIO_LEDSINK      (GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_SPEED_HIGH | \
+                           GPIO_OUTPUT_CLEAR | GPIO_PORTD | GPIO_PIN9)
+#define GPIO_LEDSOURCE    (GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_SPEED_HIGH | \
+                           GPIO_OUTPUT_CLEAR | GPIO_PORTD | GPIO_PIN8)
+#define GPIO_LEDSPY       (GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_SPEED_HIGH | \
+                           GPIO_OUTPUT_CLEAR | GPIO_PORTC | GPIO_PIN12)
+#define GPIO_LEDCC        (GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_SPEED_HIGH | \
+                           GPIO_OUTPUT_CLEAR | GPIO_PORTD | GPIO_PIN5)
+
+#define LED_DRIVER_PATH "/dev/userleds"
+
+/* Joystic definitions ******************************************************/
+
+#define GPIO_JOY_SEL     (GPIO_INPUT | GPIO_PULLDOWN | GPIO_EXTI | \
+                          GPIO_PORTC | GPIO_PIN0)
+#define GPIO_JOY_DOWN    (GPIO_INPUT | GPIO_PULLDOWN | GPIO_EXTI | \
+                          GPIO_PORTC | GPIO_PIN2)
+#define GPIO_JOY_LEFT    (GPIO_INPUT | GPIO_PULLDOWN | GPIO_EXTI | \
+                          GPIO_PORTC | GPIO_PIN1)
+#define GPIO_JOY_RIGHT   (GPIO_INPUT | GPIO_PULLDOWN | GPIO_EXTI | \
+                          GPIO_PORTC | GPIO_PIN3)
+#define GPIO_JOY_UP      (GPIO_INPUT | GPIO_PULLDOWN | GPIO_EXTI | \
+                          GPIO_PORTC | GPIO_PIN4)
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Function Prototypes
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: stm32_bringup
+ *
+ * Description:
+ *   Perform architecture-specific initialization
+ *
+ *   CONFIG_BOARD_LATE_INITIALIZE=y :
+ *     Called from board_late_initialize().
+ *
+ *   CONFIG_BOARD_LATE_INITIALIZE=y && CONFIG_BOARDCTL=y :
+ *     Called from the NSH library
+ *
+ ****************************************************************************/
+
+int stm32_bringup(void);
+
+/****************************************************************************
+ * Name: stm32_djoy_initialization
+ *
+ * Description:
+ *   Initialize and register the discrete joystick driver
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_INPUT_DJOYSTICK
+int stm32_djoy_initialization(void);
+#endif
+
+#endif /* __BOARDS_ARM_STM32F0L0G0_STM32G071B_DISCO_SRC_STM32G071B_DISCO_H */