hc32.ini 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #
  2. # Marlin Firmware
  3. # PlatformIO Configuration File
  4. #
  5. #################################
  6. #
  7. # HC32F460 Architecture with unified HC32 HAL
  8. #
  9. # Naming Example: HC32F460JEUA
  10. #
  11. # |- Xiaohua Semiconductor
  12. # | |- CPU bit width (32: 32-bit)
  13. # | | |- Product Type (F: Universal MCU)
  14. # | | | |- Core Type (4: Cortex-M4)
  15. # | | | | |- Performance (6: High Performance)
  16. # | | | | | |- Configuration (0: Configuration 1)
  17. # | | | | | | |- Pin Count (J: 48, K: 60/64, P: 100)
  18. # | | | | | | | |- Flash Capacity (C: 256KB, E: 512KB)
  19. # | | | | | | | | |- Package (T: LQFP, U: QFN, H:VFBGA)
  20. # | | | | | | | | | |- Temperature range (A: -40-85°C, B: -40-105°C)
  21. # HC 32 F 4 6 0 J E U A
  22. #
  23. #################################
  24. #
  25. # Base Environment for all HC32F460 variants
  26. #
  27. [HC32F460_base]
  28. platform = https://github.com/shadow578/platform-hc32f46x/archive/1.0.0.zip
  29. board = generic_hc32f460
  30. build_src_filter = ${common.default_src_filter} +<src/HAL/HC32> +<src/HAL/shared/backtrace>
  31. build_type = release
  32. build_flags =
  33. -D ARDUINO_ARCH_HC32
  34. -D REDIRECT_PRINTF_TO_SERIAL # Redirect core-provided printf to host serial
  35. -D F_CPU=SYSTEM_CLOCK_FREQUENCIES.pclk1 # Override F_CPU to PCLK1, as marlin freaks out otherwise...
  36. -D PLATFORM_M997_SUPPORT # Enable M997 command
  37. # DDL / Arduino Configuration
  38. -D DISABLE_SERIAL_GLOBALS # Disable global Serial objects, we use our own
  39. -D CORE_DISABLE_FAULT_HANDLER # Disable arduino core fault handler (we use our own)
  40. # DDL / Arduino Debug Options
  41. #-D __DEBUG # DDL debug mode
  42. #-D __CORE_DEBUG # Arduino core debug mode
  43. -D PANIC_ENABLE # enable custom panic handlers (in MinSerial)
  44. # options to reduce debug mode footprint (-16K; messages are less verbose)
  45. -D __DEBUG_SHORT_FILENAMES # Use short filenames in DDL debug output
  46. -D __PANIC_SHORT_FILENAMES # Use short filenames in core panic output
  47. -D __OMIT_PANIC_MESSAGE # Omit panic messages in core panic output
  48. # Drivers and Middleware required by the HC32 HAL
  49. board_build.ddl.ots = true
  50. board_build.ddl.sdioc = true
  51. board_build.ddl.wdt = true
  52. board_build.ddl.timer0 = true
  53. board_build.ddl.timera = true
  54. board_build.mw.sd_card = true
  55. # Additional flags to reduce binary size
  56. board_build.flags.cpp =
  57. -fno-threadsafe-statics # Disable thread-safe statics (only one core anyway)
  58. -fno-exceptions # Disable exceptions (not used by marlin)
  59. -fno-rtti # Disable RTTI (not used by marlin)
  60. #
  61. # Base HC32F460xCxx (256K Flash)
  62. #
  63. [HC32F460C_base]
  64. extends = HC32F460_base
  65. board_build.ld_args.flash_size = 256K
  66. #
  67. # Base HC32F460xExx (512K Flash)
  68. #
  69. [HC32F460E_base]
  70. extends = HC32F460_base
  71. board_build.ld_args.flash_size = 512K
  72. #
  73. # Voxelab Aquila V1.0.0/V1.0.1/V1.0.2/V1.0.3 as found in the Voxelab Aquila X2 & C2
  74. #
  75. [env:HC32F460C_aquila_101]
  76. extends = HC32F460C_base
  77. board_build.ld_args.flash_start = 0xC000 # Bootloader start address, as logged by the bootloader on boot
  78. board_build.ld_args.boot_mode = secondary # Save ~1.4k of flash by compiling as secondary firmware