Skip to content

Commit

Permalink
add pio environments for OpenHC32Boot
Browse files Browse the repository at this point in the history
  • Loading branch information
shadow578 authored May 15, 2024
1 parent f56952c commit bd64e94
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Marlin/src/pins/pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -904,9 +904,9 @@
//

#elif MB(AQUILA_V101)
#include "hc32f4/pins_AQUILA_101.h" // HC32F460 env:HC32F460C_aquila_101
#include "hc32f4/pins_AQUILA_101.h" // HC32F460 env:HC32F460C_aquila_101 env:HC32F460C_openhc32boot_full env:HC32F460C_openhc32boot_small
#elif MB(CREALITY_ENDER2P_V24S4)
#include "hc32f4/pins_CREALITY_ENDER2P_V24S4.h" // HC32F460 env:HC32F460C_e2p24s4
#include "hc32f4/pins_CREALITY_ENDER2P_V24S4.h" // HC32F460 env:HC32F460C_e2p24s4 env:HC32F460C_openhc32boot_full env:HC32F460C_openhc32boot_small

//
// Custom board (with custom PIO env)
Expand Down
37 changes: 37 additions & 0 deletions ini/hc32.ini
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,40 @@ board_build.ld_args.boot_mode = secondary # Save ~1.4k of flash by compiling a
[env:HC32F460C_e2p24s4]
extends = HC32F460C_base
board_build.ld_args.flash_start = 0x8000

#
# Generic OpenHC32Boot Configuration (SMALL Profile, 256K Flash)
# see https://github.com/shadow578/OpenHC32Boot for more information
#
[env:HC32F460C_openhc32boot_small]
extends = HC32F460C_base
board_build.ld_args.flash_start = 0x4000
board_build.ld_args.boot_mode = secondary
build_flags =
${HC32F460C_base.build_flags}
-D CORE_DONT_RESTORE_DEFAULT_CLOCKS=1 # OpenHC32Boot doesn't mess with the clock settings, so we can skip clock restore

#
# Generic OpenHC32Boot Configuration (FULL Profile, 256K Flash)
#
[env:HC32F460C_openhc32boot_full]
extends = env:HC32F460C_openhc32boot_small
board_build.ld_args.flash_start = 0x6000

#
# Generic OpenHC32Boot Configuration (SMALL Profile, 512K Flash)
#
[env:HC32F460E_openhc32boot_small]
extends = HC32F460E_base
board_build.ld_args.flash_start = 0x4000
board_build.ld_args.boot_mode = secondary
build_flags =
${HC32F460E_base.build_flags}
-D CORE_DONT_RESTORE_DEFAULT_CLOCKS=1

#
# Generic OpenHC32Boot Configuration (FULL Profile, 512K Flash)
#
[env:HC32F460E_openhc32boot_full]
extends = env:HC32F460E_openhc32boot_small
board_build.ld_args.flash_start = 0x6000

0 comments on commit bd64e94

Please sign in to comment.