summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2023-03-21 17:43:20 +1100
committerDamien George <damien@micropython.org>2023-03-22 16:38:03 +1100
commit31e7a0587d7eabe668101d26b26a0190120465c8 (patch)
treeaf99617bedb125e5e0f4e7524b70b84072e3a19f
parent31638473b7205b37fe0095ae9181e37da28fe6d7 (diff)
stm32/boards/NUCLEO_G0B1RE: Add config for USB and mboot.
But leave these disabled. Signed-off-by: Damien George <damien@micropython.org>
-rw-r--r--ports/stm32/boards/NUCLEO_G0B1RE/mpconfigboard.h7
-rw-r--r--ports/stm32/boards/NUCLEO_G0B1RE/mpconfigboard.mk6
2 files changed, 13 insertions, 0 deletions
diff --git a/ports/stm32/boards/NUCLEO_G0B1RE/mpconfigboard.h b/ports/stm32/boards/NUCLEO_G0B1RE/mpconfigboard.h
index 6ba3e0115..092ee1779 100644
--- a/ports/stm32/boards/NUCLEO_G0B1RE/mpconfigboard.h
+++ b/ports/stm32/boards/NUCLEO_G0B1RE/mpconfigboard.h
@@ -6,6 +6,7 @@
#define MICROPY_HW_ENABLE_RNG (0)
#define MICROPY_HW_ENABLE_RTC (1)
#define MICROPY_HW_ENABLE_DAC (0)
+#define MICROPY_HW_ENABLE_USB (0) // can be enabled if USB cable connected to PA11/PA12
#define MICROPY_PY_PYB_LEGACY (0)
#define MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE (1)
@@ -87,3 +88,9 @@
#define MICROPY_HW_LED1 (pin_A5) // Green LD2 LED on Nucleo
#define MICROPY_HW_LED_ON(pin) (mp_hal_pin_high(pin))
#define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_low(pin))
+
+// USB config
+#define MICROPY_HW_USB_FS (1)
+#define MICROPY_HW_USB_MAIN_DEV (USB_PHY_FS_ID)
+#define MICROPY_HW_USB_MSC (0)
+#define MICROPY_HW_USB_HID (0)
diff --git a/ports/stm32/boards/NUCLEO_G0B1RE/mpconfigboard.mk b/ports/stm32/boards/NUCLEO_G0B1RE/mpconfigboard.mk
index b8bbfb453..abc9b43ef 100644
--- a/ports/stm32/boards/NUCLEO_G0B1RE/mpconfigboard.mk
+++ b/ports/stm32/boards/NUCLEO_G0B1RE/mpconfigboard.mk
@@ -1,7 +1,13 @@
MCU_SERIES = g0
CMSIS_MCU = STM32G0B1xx
AF_FILE = boards/stm32g0b1_af.csv
+
+ifeq ($(USE_MBOOT),1)
+LD_FILES = boards/stm32g0b1xe.ld boards/common_bl.ld
+TEXT0_ADDR = 0x08008000
+else
LD_FILES = boards/stm32g0b1xe.ld boards/common_basic.ld
+endif
# LTO reduces final binary size, may be slower to build depending on gcc version and hardware
LTO ?= 1