🐛 HC32 - Add SERIAL_DMA, fix SDIO and MEATPACK (#26845)

* fix meatpack on hc32

* add support for SERIAL_DMA on HC32

* add additional checks in HC32 HAL

* migrate HC32 HAL to use app_config.h

* fix memory leak in HC32 sdio HAL
https://github.com/MarlinFirmware/Marlin/pull/26845#issuecomment-1980218771

* hc32: fail if both EMERGENCY_PARSER and SERIAL_DMA are enabled
This commit is contained in:
Chris
2024-04-14 20:42:57 +02:00
committed by GitHub
parent 19684f23bc
commit dca6afc26e
9 changed files with 233 additions and 47 deletions

View File

@@ -33,22 +33,14 @@ build_src_filter = ${common.default_src_filter} +<src/HAL/HC32> +<src/HAL/shared
build_type = release
build_flags =
-D ARDUINO_ARCH_HC32
-D REDIRECT_PRINTF_TO_SERIAL # Redirect core-provided printf to host serial
-D F_CPU=SYSTEM_CLOCK_FREQUENCIES.pclk1 # Override F_CPU to PCLK1, as marlin freaks out otherwise...
-D PLATFORM_M997_SUPPORT # Enable M997 command
-D PLATFORM_M997_SUPPORT # Enable M997 command
# note: ddl and arduino debug mode are
# automatically enabled with MARLIN_DEV_MODE
#-D __DEBUG # force DDL debug mode
#-D __CORE_DEBUG # force Arduino core debug mode
# DDL / Arduino Configuration
-D DISABLE_SERIAL_GLOBALS # Disable global Serial objects, we use our own
-D CORE_DISABLE_FAULT_HANDLER # Disable arduino core fault handler (we use our own)
# DDL / Arduino Debug Options
#-D __DEBUG # DDL debug mode
#-D __CORE_DEBUG # Arduino core debug mode
-D PANIC_ENABLE # enable custom panic handlers (in MinSerial)
# options to reduce debug mode footprint (-16K; messages are less verbose)
-D __DEBUG_SHORT_FILENAMES # Use short filenames in DDL debug output
-D __PANIC_SHORT_FILENAMES # Use short filenames in core panic output
-D __OMIT_PANIC_MESSAGE # Omit panic messages in core panic output
# hc32 app configuration file
board_build.app_config = Marlin/src/HAL/HC32/app_config.h
# Drivers and Middleware required by the HC32 HAL
board_build.ddl.ots = true
@@ -58,6 +50,11 @@ board_build.ddl.timer0 = true
board_build.ddl.timera = true
board_build.mw.sd_card = true
# extra build flags
board_build.flags.common =
-g3 # Force emit debug symbols to elf. this does not affect the final binary size
-fno-signed-char # Force unsigned chars. this is required for meatpack to work
# Additional flags to reduce binary size
board_build.flags.cpp =
-fno-threadsafe-statics # Disable thread-safe statics (only one core anyway)