Skip to content

Commit

Permalink
stm32/boards/NUCLEO_G0B1RE: Add config for USB and mboot.
Browse files Browse the repository at this point in the history
But leave these disabled.

Signed-off-by: Damien George <[email protected]>
  • Loading branch information
dpgeorge committed Mar 22, 2023
1 parent 3163847 commit 31e7a05
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ports/stm32/boards/NUCLEO_G0B1RE/mpconfigboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
6 changes: 6 additions & 0 deletions ports/stm32/boards/NUCLEO_G0B1RE/mpconfigboard.mk
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 31e7a05

Please sign in to comment.