From b3dd0a113adefd1493dbd1417ece346528951b1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Berger?= Date: Fri, 26 Dec 2025 17:25:25 +0100 Subject: [PATCH 1/2] Do not randomly include stm32h7xx.h Enable D-Cache unless we're compiling for the M4 core of a dual-core H7 mcu by directly testing CORE_CM4 --- src/common/tusb_mcu.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/common/tusb_mcu.h b/src/common/tusb_mcu.h index 55f7e0b7c..ebe486e40 100644 --- a/src/common/tusb_mcu.h +++ b/src/common/tusb_mcu.h @@ -245,13 +245,12 @@ #define CFG_TUSB_MEM_DCACHE_LINE_SIZE_DEFAULT 32 #elif TU_CHECK_MCU(OPT_MCU_STM32H7) - #include "stm32h7xx.h" #define TUP_USBIP_DWC2 #define TUP_USBIP_DWC2_STM32 #define TUP_DCD_ENDPOINT_MAX 9 - #if __CORTEX_M == 7 + #ifndef CORE_CM4 // Enable dcache if DMA is enabled #define CFG_TUD_MEM_DCACHE_ENABLE_DEFAULT CFG_TUD_DWC2_DMA_ENABLE #define CFG_TUH_MEM_DCACHE_ENABLE_DEFAULT CFG_TUH_DWC2_DMA_ENABLE From d77f1e8eb6f53cdb55987165b36e301daf1f9828 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Berger?= Date: Fri, 26 Dec 2025 17:27:05 +0100 Subject: [PATCH 2/2] Prevent unused-variable warning in dcd_host.c 'idx' is not used if CFG_TUH_CDC_LINE_CODING_ON_ENUM is not defined. --- src/class/cdc/cdc_host.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/class/cdc/cdc_host.c b/src/class/cdc/cdc_host.c index 32f6827b0..f19c4a327 100644 --- a/src/class/cdc/cdc_host.c +++ b/src/class/cdc/cdc_host.c @@ -828,7 +828,9 @@ static bool set_line_state_on_enum(cdch_interface_t *p_cdc, tuh_xfer_t *xfer) { ENUM_SET_LINE_CONTROL, ENUM_SET_LINE_COMPLETE, }; + #ifdef CFG_TUH_CDC_LINE_CODING_ON_ENUM const uint8_t idx = get_idx_by_ptr(p_cdc); + #endif const uintptr_t state = xfer->user_data; switch (state) {