Skip to content

Commit 31e7a05

Browse files
committed
stm32/boards/NUCLEO_G0B1RE: Add config for USB and mboot.
But leave these disabled. Signed-off-by: Damien George <damien@micropython.org>
1 parent 3163847 commit 31e7a05

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

ports/stm32/boards/NUCLEO_G0B1RE/mpconfigboard.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#define MICROPY_HW_ENABLE_RNG (0)
77
#define MICROPY_HW_ENABLE_RTC (1)
88
#define MICROPY_HW_ENABLE_DAC (0)
9+
#define MICROPY_HW_ENABLE_USB (0) // can be enabled if USB cable connected to PA11/PA12
910
#define MICROPY_PY_PYB_LEGACY (0)
1011

1112
#define MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE (1)
@@ -87,3 +88,9 @@
8788
#define MICROPY_HW_LED1 (pin_A5) // Green LD2 LED on Nucleo
8889
#define MICROPY_HW_LED_ON(pin) (mp_hal_pin_high(pin))
8990
#define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_low(pin))
91+
92+
// USB config
93+
#define MICROPY_HW_USB_FS (1)
94+
#define MICROPY_HW_USB_MAIN_DEV (USB_PHY_FS_ID)
95+
#define MICROPY_HW_USB_MSC (0)
96+
#define MICROPY_HW_USB_HID (0)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
MCU_SERIES = g0
22
CMSIS_MCU = STM32G0B1xx
33
AF_FILE = boards/stm32g0b1_af.csv
4+
5+
ifeq ($(USE_MBOOT),1)
6+
LD_FILES = boards/stm32g0b1xe.ld boards/common_bl.ld
7+
TEXT0_ADDR = 0x08008000
8+
else
49
LD_FILES = boards/stm32g0b1xe.ld boards/common_basic.ld
10+
endif
511

612
# LTO reduces final binary size, may be slower to build depending on gcc version and hardware
713
LTO ?= 1

0 commit comments

Comments
 (0)