# # Marlin Firmware # PlatformIO Configuration File # ################################# # # HC32F460 Architecture with unified HC32 HAL # # Naming Example: HC32F460JEUA # # |- Xiaohua Semiconductor # | |- CPU bit width (32: 32-bit) # | | |- Product Type (F: Universal MCU) # | | | |- Core Type (4: Cortex-M4) # | | | | |- Performance (6: High Performance) # | | | | | |- Configuration (0: Configuration 1) # | | | | | | |- Pin Count (J: 48, K: 60/64, P: 100) # | | | | | | | |- Flash Capacity (C: 256KB, E: 512KB) # | | | | | | | | |- Package (T: LQFP, U: QFN, H:VFBGA) # | | | | | | | | | |- Temperature range (A: -40-85°C, B: -40-105°C) # HC 32 F 4 6 0 J E U A # ################################# # # Base Environment for all HC32F460 variants # [HC32F460_base] platform = https://github.com/shadow578/platform-hc32f46x/archive/main.zip board = generic_hc32f460 build_src_filter = ${common.default_src_filter} + + 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 # 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 # Drivers and Middleware required by the HC32 HAL board_build.ddl.ots = true board_build.ddl.sdioc = true board_build.ddl.wdt = true board_build.ddl.timer0 = true board_build.ddl.timera = true board_build.mw.sd_card = true # Additional flags to reduce binary size board_build.flags.cpp = -fno-threadsafe-statics # Disable thread-safe statics (only one core anyway) -fno-exceptions # Disable exceptions (not used by marlin) -fno-rtti # Disable RTTI (not used by marlin) # # Base HC32F460xCxx (256K Flash) # [HC32F460C_base] extends = HC32F460_base board_build.ld_args.flash_size = 256K # # Base HC32F460xExx (512K Flash) # [HC32F460E_base] extends = HC32F460_base board_build.ld_args.flash_size = 512K # # Voxelab Aquila V1.0.0/V1.0.1/V1.0.2/V1.0.3 as found in the Voxelab Aquila X2 & C2 # [env:HC32F460C_aquila_101] extends = HC32F460C_base board_build.ld_args.flash_start = 0xC000 # Bootloader start address, as logged by the bootloader on boot board_build.ld_args.boot_mode = secondary # Save ~1.4k of flash by compiling as secondary firmware