From a156cf69cb7050330a3861c8517daae49980313f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 3 Jul 2022 20:05:27 -0500 Subject: [PATCH] combine shared ini fields --- buildroot/share/PlatformIO/scripts/openblt.py | 6 +-- ini/stm32f4.ini | 49 +++++++++---------- 2 files changed, 27 insertions(+), 28 deletions(-) diff --git a/buildroot/share/PlatformIO/scripts/openblt.py b/buildroot/share/PlatformIO/scripts/openblt.py index bbe4757d7f74..33e82898f7b4 100644 --- a/buildroot/share/PlatformIO/scripts/openblt.py +++ b/buildroot/share/PlatformIO/scripts/openblt.py @@ -10,11 +10,11 @@ board = env.BoardConfig() board_keys = board.get("build").keys() - if 'encode_openblt' in board_keys: + if 'encode' in board_keys: env.AddPostAction( join("$BUILD_DIR", "${PROGNAME}.bin"), env.VerboseAction(" ".join([ "$OBJCOPY", "-O", "srec", - "\"$BUILD_DIR/${PROGNAME}.elf\"", "\"" + join("$BUILD_DIR", board.get("build.encode_openblt")) + "\"" - ]), "Building " + board.get("build.encode_openblt")) + "\"$BUILD_DIR/${PROGNAME}.elf\"", "\"" + join("$BUILD_DIR", board.get("build.encode")) + "\"" + ]), "Building " + board.get("build.encode")) ) diff --git a/ini/stm32f4.ini b/ini/stm32f4.ini index 7bbf6fe91bc6..ddb944e80f61 100644 --- a/ini/stm32f4.ini +++ b/ini/stm32f4.ini @@ -106,37 +106,35 @@ extra_scripts = ${stm32_variant.extra_scripts} # # Anet ET4-MB_V1.x/ET4P-MB_V1.x (STM32F407VGT6 ARM Cortex-M4) -# using davidtgbe's build of OpenBLT bootloader https://github.com/davidtgbe/openblt/releases # -[env:Anet_ET4_OpenBLT] +[Anet_ET4] extends = stm32_variant board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_F4x7Vx -board_build.encode_openblt = firmware.srec -board_build.offset = 0x10000 -board_upload.offset_address = 0x08010000 build_flags = ${stm32_variant.build_flags} -DHAL_SD_MODULE_ENABLED -DHAL_SRAM_MODULE_ENABLED build_unflags = ${stm32_variant.build_unflags} -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 -extra_scripts = ${stm32_variant.extra_scripts} - buildroot/share/PlatformIO/scripts/openblt.py # -# Anet ET4-MB_V1.x/ET4P-MB_V1.x (STM32F407VGT6 ARM Cortex-M4) -# using direct flashing with st-link +# Anet ET4 directly flashed via ST-Link # [env:Anet_ET4_no_bootloader] -extends = stm32_variant -board = marlin_STM32F407VGT6_CCM -board_build.variant = MARLIN_F4x7Vx -build_flags = ${stm32_variant.build_flags} - -DHAL_SD_MODULE_ENABLED -DHAL_SRAM_MODULE_ENABLED -build_unflags = ${stm32_variant.build_unflags} - -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 +extends = Anet_ET4 debug_tool = stlink upload_protocol = stlink +# +# Anet ET4 with OpenBLT from https://github.com/davidtgbe/openblt/releases +# +[env:Anet_ET4_OpenBLT] +extends = Anet_ET4 +board_build.encode = firmware.srec +board_build.offset = 0x10000 +board_upload.offset_address = 0x08010000 +extra_scripts = ${stm32_variant.extra_scripts} + buildroot/share/PlatformIO/scripts/openblt.py + # # BigTreeTech SKR Pro (STM32F407ZGT6 ARM Cortex-M4) # @@ -557,28 +555,29 @@ build_unflags = -DUSBD_USE_CDC # # TH3D EZBoard v2.0 (STM32F405RGT6 ARM Cortex-M4) -# direct fashing with st-link # -[env:TH3D_EZBoard_V2_no_bootloader] +[TH3D_EZBoard_V2] extends = stm32_variant board = genericSTM32F405RG board_build.variant = MARLIN_TH3D_EZBOARD_V2 build_flags = ${stm32_variant.build_flags} -DHSE_VALUE=12000000U -O0 + +# +# TH3D EZBoard v2.0 directly flashed via ST-Link +# +[env:TH3D_EZBoard_V2_no_bootloader] +extends = TH3D_EZBoard_V2 debug_tool = stlink upload_protocol = stlink # -# TH3D EZBoard v2.0 (STM32F405RGT6 ARM Cortex-M4) -# using OpenBLT bootloader from https://github.com/rhapsodyv/OpenBLT-STM32 +# TH3D EZBoard v2.0 with OpenBLT from https://github.com/rhapsodyv/OpenBLT-STM32 # [env:TH3D_EZBoard_V2_OpenBLT] -extends = stm32_variant -board = genericSTM32F405RG -board_build.variant = MARLIN_TH3D_EZBOARD_V2 -board_build.encode_openblt = firmware.bin +extends = TH3D_EZBoard_V2 +board_build.encode = firmware.bin board_build.offset = 0xC000 board_upload.offset_address = 0x0800C000 -build_flags = ${stm32_variant.build_flags} -DHSE_VALUE=12000000U -O0 extra_scripts = ${stm32_variant.extra_scripts} buildroot/share/PlatformIO/scripts/openblt.py