diff --git a/ports/stm32/Makefile b/ports/stm32/Makefile index 7a869d3c04..c3b281650a 100644 --- a/ports/stm32/Makefile +++ b/ports/stm32/Makefile @@ -422,6 +422,11 @@ HAL_SRC_C += $(addprefix $(HAL_DIR)/Src/stm32$(MCU_SERIES)xx_,\ hal_dma_ex.c \ hal_dcmi.c \ ) +ifeq ($(MCU_SERIES),$(filter $(MCU_SERIES),f4)) +# HAL F4-1.16.0 has a bug with missing parentheses in HAL_MMC_Erase. +# This function is unused so let the error go by as a warning. +$(BUILD)/$(HAL_DIR)/Src/stm32$(MCU_SERIES)xx_hal_mmc.o: CFLAGS += -Wno-error=parentheses +endif endif ifeq ($(CMSIS_MCU),$(filter $(CMSIS_MCU),STM32H743xx STM32H750xx STM32H7A3xx STM32H7A3xxQ STM32H7B3xx STM32H7B3xxQ)) diff --git a/ports/stm32/boards/stm32f4xx_hal_conf_base.h b/ports/stm32/boards/stm32f4xx_hal_conf_base.h index f09990fd95..d42f3ba19f 100644 --- a/ports/stm32/boards/stm32f4xx_hal_conf_base.h +++ b/ports/stm32/boards/stm32f4xx_hal_conf_base.h @@ -42,6 +42,7 @@ #include "stm32f4xx_hal_i2c.h" #include "stm32f4xx_hal_i2s.h" #include "stm32f4xx_hal_iwdg.h" +#include "stm32f4xx_hal_mmc.h" #include "stm32f4xx_hal_pcd.h" #include "stm32f4xx_hal_pwr.h" #include "stm32f4xx_hal_rcc.h" @@ -74,6 +75,7 @@ #define HAL_I2C_MODULE_ENABLED #define HAL_I2S_MODULE_ENABLED #define HAL_IWDG_MODULE_ENABLED +#define HAL_MMC_MODULE_ENABLED #define HAL_PCD_MODULE_ENABLED #define HAL_PWR_MODULE_ENABLED #define HAL_RCC_MODULE_ENABLED