@@ -17,7 +17,7 @@ ifeq ($(PB_MCU_FAMILY),STM32)
1717ifeq ($(PB_MCU_SERIES ) ,)
1818$(error "PB_MCU_SERIES is not specified - add it in <hub>/Makefile)
1919else
20- PB_MCU_SERIES_LCASE = $(subst F,f,$(subst L,l,$(PB_MCU_SERIES ) ) )
20+ PB_MCU_SERIES_LCASE = $(subst H,h, $( subst F,f,$(subst L,l,$(PB_MCU_SERIES ) ) ) )
2121endif
2222ifeq ($(PB_CMSIS_MCU ) ,)
2323$(error "PB_CMSIS_MCU is not specified - add it in <hub>/Makefile")
@@ -190,6 +190,7 @@ ifeq ($(PB_MCU_FAMILY),STM32)
190190CFLAGS_MCU_F0 = -mthumb -mtune=cortex-m0 -mcpu=cortex-m0 -msoft-float
191191CFLAGS_MCU_F4 = -mthumb -mtune=cortex-m4 -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard
192192CFLAGS_MCU_L4 = -mthumb -mtune=cortex-m4 -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard
193+ CFLAGS_MCU_H5 = -mthumb -mtune=cortex-m33 -mcpu=cortex-m33 -mfpu=fpv5-sp-d16 -mfloat-abi=hard
193194CFLAGS_MCU = $(CFLAGS_MCU_$(PB_MCU_SERIES ) )
194195else
195196ifeq ($(PB_MCU_FAMILY ) ,AT91SAM7)
@@ -207,6 +208,9 @@ CFLAGS_WARN = -Wall -Werror -Wextra -Wno-unused-parameter -Wno-maybe-uninitializ
207208CFLAGS += $(INC ) -std=c11 -nostdlib -fshort-enums $(CFLAGS_MCU ) $(CFLAGS_WARN ) $(COPT ) $(CFLAGS_EXTRA )
208209$(BUILD ) /lib/libm/% .o : CFLAGS += -Wno-sign-compare
209210
211+ # assembler flags
212+ AFLAGS += $(filter -mcpu=% ,$(CFLAGS_MCU ) )
213+
210214# linker scripts
211215LD_FILES = $(PBTOP ) /lib/pbio/platform/$(PBIO_PLATFORM ) /platform.ld
212216ifeq ($(PB_MCU_FAMILY ) ,STM32)
@@ -262,6 +266,11 @@ CFLAGS += -D$(PB_CMSIS_MCU)
262266# Required by pbio drivers
263267CFLAGS += -DSTM32_H='<stm32$(PB_MCU_SERIES_LCASE ) xx.h>'
264268CFLAGS += -DSTM32_HAL_H='<stm32$(PB_MCU_SERIES_LCASE ) xx_hal.h>'
269+ ifeq ($(PB_MCU_SERIES ) ,$(filter $(PB_MCU_SERIES ) ,F4 H5) )
270+ CFLAGS += -DSTM32_HAL_PCD_EX_H='<stm32$(PB_MCU_SERIES_LCASE ) xx_hal_pcd_ex.h>'
271+ CFLAGS += -DSTM32_LL_RCC_H='<stm32$(PB_MCU_SERIES_LCASE ) xx_ll_rcc.h>'
272+ CFLAGS += -DSTM32_LL_USART_H='<stm32$(PB_MCU_SERIES_LCASE ) xx_ll_usart.h>'
273+ endif
265274endif
266275
267276LIBS += "$(shell $(CC ) $(CFLAGS ) -print-libgcc-file-name) "
@@ -455,12 +464,14 @@ STM32_HAL_SRC_C = $(addprefix lib/stm32lib/STM32$(PB_MCU_SERIES)xx_HAL_Driver/Sr
455464 stm32$(PB_MCU_SERIES_LCASE ) xx_hal_cortex.c \
456465 stm32$(PB_MCU_SERIES_LCASE ) xx_hal_dac_ex.c \
457466 stm32$(PB_MCU_SERIES_LCASE ) xx_hal_dac.c \
467+ stm32$(PB_MCU_SERIES_LCASE ) xx_hal_dma_ex.c \
458468 stm32$(PB_MCU_SERIES_LCASE ) xx_hal_dma.c \
459469 stm32$(PB_MCU_SERIES_LCASE ) xx_hal_flash_ex.c \
460470 stm32$(PB_MCU_SERIES_LCASE ) xx_hal_flash.c \
461471 stm32$(PB_MCU_SERIES_LCASE ) xx_hal_fmpi2c.c \
462472 stm32$(PB_MCU_SERIES_LCASE ) xx_hal_gpio.c \
463473 stm32$(PB_MCU_SERIES_LCASE ) xx_hal_i2c.c \
474+ stm32$(PB_MCU_SERIES_LCASE ) xx_hal_icache.c \
464475 stm32$(PB_MCU_SERIES_LCASE ) xx_hal_pcd_ex.c \
465476 stm32$(PB_MCU_SERIES_LCASE ) xx_hal_pcd.c \
466477 stm32$(PB_MCU_SERIES_LCASE ) xx_hal_pwr_ex.c \
@@ -472,6 +483,7 @@ STM32_HAL_SRC_C = $(addprefix lib/stm32lib/STM32$(PB_MCU_SERIES)xx_HAL_Driver/Sr
472483 stm32$(PB_MCU_SERIES_LCASE ) xx_hal_tim.c \
473484 stm32$(PB_MCU_SERIES_LCASE ) xx_hal_uart_ex.c \
474485 stm32$(PB_MCU_SERIES_LCASE ) xx_hal_uart.c \
486+ stm32$(PB_MCU_SERIES_LCASE ) xx_hal_xspi.c \
475487 stm32$(PB_MCU_SERIES_LCASE ) xx_hal.c \
476488 stm32$(PB_MCU_SERIES_LCASE ) xx_ll_lpuart.c \
477489 stm32$(PB_MCU_SERIES_LCASE ) xx_ll_rcc.c \
@@ -489,6 +501,11 @@ endif
489501ifneq ($(PB_MCU_SERIES ) ,F4)
490502STM32_HAL_SRC_C := $(filter-out % xx_hal_fmpi2c.c, $(STM32_HAL_SRC_C ) )
491503endif
504+ ifneq ($(PB_MCU_SERIES ) ,H5)
505+ STM32_HAL_SRC_C := $(filter-out % xx_hal_dma_ex.c, $(STM32_HAL_SRC_C ) )
506+ STM32_HAL_SRC_C := $(filter-out % xx_hal_icache.c, $(STM32_HAL_SRC_C ) )
507+ STM32_HAL_SRC_C := $(filter-out % xx_hal_xspi.c, $(STM32_HAL_SRC_C ) )
508+ endif
492509ifneq ($(PB_MCU_SERIES ) ,L4)
493510STM32_HAL_SRC_C := $(filter-out % xx_ll_lpuart.c, $(STM32_HAL_SRC_C ) )
494511endif
@@ -812,7 +829,9 @@ $(BUILD)/firmware-base.bin: $(BUILD)/firmware-obj.bin
812829# Safety requirement for SPIKE Prime
813830ifneq ($(findstring prime_hub,$(PBIO_PLATFORM ) ) ,)
814831 $(Q)od -An -t u1 -j 0x264 -N 1 $< | awk '{if ($$1 >= 15) { print "Error: byte at 0x264 must be < 0xf"; exit 1 } }'
832+ ifeq ($(PBIO_PLATFORM ) ,prime_hub_f4)
815833 $(Q)od -An -t u1 -j 0x1f0 -N 1 $< | awk '{if ($$1 >= 15) { print "Error: byte at 0x1f0 must be < 0xf"; exit 1 } }'
834+ endif
816835endif
817836 $(Q)cp $< $@
818837endif
0 commit comments