Skip to content

Commit

Permalink
Makefile cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
hierophect committed Jul 18, 2019
1 parent 755b86e commit 734012a
Show file tree
Hide file tree
Showing 8 changed files with 483 additions and 476 deletions.
40 changes: 22 additions & 18 deletions ports/stm32f4/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,22 @@ else
### CFLAGS += -flto
endif

# C defines
#C_DEFS = \
#-DUSE_FULL_LL_DRIVER \
#-DUSE_HAL_DRIVER \
#-DSTM32F412Zx \
# C defines and other board specifics
ifeq ($(MCU_SUB_VARIANT), stm32f412zx)
C_DEFS = \
-DUSE_FULL_LL_DRIVER \
-DUSE_HAL_DRIVER \
-DSTM32F412Zx
endif

# C defines
ifeq ($(MCU_SUB_VARIANT), stm32f411xe)
C_DEFS = \
-DUSE_HAL_DRIVER \
-DSTM32F411xE \
-DSTM32F411xE
CIRCUITPY_BOARD = 0
CIRCUITPY_DIGITALIO = 0
CIRCUITPY_MICROCONTROLLER = 0
endif

#TODO: Add ASM Flags? -Werror
CFLAGS += $(INC) -Wall -std=gnu11 -nostdlib $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT)
Expand All @@ -118,8 +124,6 @@ CFLAGS += \
# TODO: check this
CFLAGS += -D__START=main

#TODO: add LD file?

LDFLAGS = $(CFLAGS) -fshort-enums -Wl,-nostdlib -Wl,-T,$(LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs
LIBS := -lgcc -lc

Expand All @@ -131,7 +135,6 @@ LIBS += -lm
endif

# TinyUSB defines
# TODO: make this stm32
CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_STM32F4 -DCFG_TUD_CDC_RX_BUFSIZE=1024 -DCFG_TUD_CDC_TX_BUFSIZE=1024 -DCFG_TUD_MSC_BUFSIZE=4096 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128


Expand Down Expand Up @@ -194,18 +197,19 @@ SRC_C += \
lib/utils/pyexec.c \
lib/utils/stdout_helpers.c \
lib/utils/sys_stdio_mphal.c \
supervisor/shared/memory.c \
lib/tinyusb/src/portable/st/stm32f4/dcd_stm32f4.c
supervisor/shared/memory.c

ifneq ($(USB),FALSE)
SRC_C += lib/tinyusb/src/portable/st/stm32f4/dcd_stm32f4.c
endif

# peripherals/stm32f4/stm32f412zg/pins.c \
ifeq ($(MCU_SUB_VARIANT), stm32f412zx)
SRC_C += peripherals/stm32f4/stm32f412zg/pins.c
endif

SRC_S = \
supervisor/cpu.s \
boards/startup_stm32f411xe.s
# boards/startup_stm32f412zx.s
# boards/startup_stm32f411xe.s

#boards/startup_stm32f412zx.s
boards/startup_$(MCU_SUB_VARIANT).s

SRC_COMMON_HAL_EXPANDED = $(addprefix shared-bindings/, $(SRC_COMMON_HAL)) \
$(addprefix shared-bindings/, $(SRC_BINDINGS_ENUMS)) \
Expand Down
4 changes: 3 additions & 1 deletion ports/stm32f4/boards/stm32f411_disco/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ USB_PID = 0x802A
USB_PRODUCT = "A glorious potato"
USB_MANUFACTURER = "Adafruit Industries LLC"

MCU_SERIES = f4
MCU_SERIES = m4
MCU_VARIANT = stm32f4
MCU_SUB_VARIANT = stm32f411xe
CMSIS_MCU = STM32F411xE
LD_FILE = boards/STM32F411VETx_FLASH.ld
TEXT0_ADDR = 0x08000000
Expand Down
4 changes: 3 additions & 1 deletion ports/stm32f4/boards/stm32f412g_disco/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ USB_MANUFACTURER = "Adafruit Industries LLC"
#USB_PRODUCT = "STM32 Human Interface Potato"
#USB_MANUFACTURER = "STMicroelectronics"

MCU_SERIES = f4
MCU_SERIES = m4
MCU_VARIANT = stm32f4
MCU_SUB_VARIANT = stm32f412zx
CMSIS_MCU = STM32F412xG
LD_FILE = boards/STM32F412ZGTx_FLASH.ld
TEXT0_ADDR = 0x08000000
Expand Down
6 changes: 3 additions & 3 deletions ports/stm32f4/mpconfigport.mk
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ CIRCUITPY_AUDIOBUSIO = 0
CIRCUITPY_AUDIOIO = 0
CIRCUITPY_BITBANGIO = 0
CIRCUITPY_BLEIO = 0
CIRCUITPY_BOARD = 0
CIRCUITPY_BOARD = 1
CIRCUITPY_BUSIO = 0
CIRCUITPY_DIGITALIO = 0
CIRCUITPY_DIGITALIO = 1
CIRCUITPY_DISPLAYIO = 0
CIRCUITPY_FREQUENCYIO = 0
CIRCUITPY_GAMEPAD = 0
CIRCUITPY_GAMEPADSHIFT = 0
CIRCUITPY_I2CSLAVE = 0
CIRCUITPY_MATH = 0
CIRCUITPY_MICROCONTROLLER = 0
CIRCUITPY_MICROCONTROLLER = 1
CIRCUITPY_NEOPIXEL_WRITE = 0
CIRCUITPY_NETWORK = 0
CIRCUITPY_NVM = 0
Expand Down
Loading

0 comments on commit 734012a

Please sign in to comment.