🔨 Fix OpenBLT encode; no-bootloader envs (#24446)

This commit is contained in:
EvilGremlin 2022-07-04 04:49:23 +03:00 committed by Scott Lahteine
parent b548e21b65
commit 0ec1cb58c7
3 changed files with 40 additions and 18 deletions

View file

@ -682,9 +682,9 @@
#elif MB(MKS_ROBIN_NANO_V3_1) #elif MB(MKS_ROBIN_NANO_V3_1)
#include "stm32f4/pins_MKS_ROBIN_NANO_V3.h" // STM32F4 env:mks_robin_nano_v3_1 env:mks_robin_nano_v3_1_usb_flash_drive env:mks_robin_nano_v3_1_usb_flash_drive_msc #include "stm32f4/pins_MKS_ROBIN_NANO_V3.h" // STM32F4 env:mks_robin_nano_v3_1 env:mks_robin_nano_v3_1_usb_flash_drive env:mks_robin_nano_v3_1_usb_flash_drive_msc
#elif MB(ANET_ET4) #elif MB(ANET_ET4)
#include "stm32f4/pins_ANET_ET4.h" // STM32F4 env:Anet_ET4_OpenBLT #include "stm32f4/pins_ANET_ET4.h" // STM32F4 env:Anet_ET4_no_bootloader env:Anet_ET4_OpenBLT
#elif MB(ANET_ET4P) #elif MB(ANET_ET4P)
#include "stm32f4/pins_ANET_ET4P.h" // STM32F4 env:Anet_ET4_OpenBLT #include "stm32f4/pins_ANET_ET4P.h" // STM32F4 env:Anet_ET4_no_bootloader env:Anet_ET4_OpenBLT
#elif MB(FYSETC_CHEETAH_V20) #elif MB(FYSETC_CHEETAH_V20)
#include "stm32f4/pins_FYSETC_CHEETAH_V20.h" // STM32F4 env:FYSETC_CHEETAH_V20 #include "stm32f4/pins_FYSETC_CHEETAH_V20.h" // STM32F4 env:FYSETC_CHEETAH_V20
#elif MB(MKS_MONSTER8_V1) #elif MB(MKS_MONSTER8_V1)
@ -692,7 +692,7 @@
#elif MB(MKS_MONSTER8_V2) #elif MB(MKS_MONSTER8_V2)
#include "stm32f4/pins_MKS_MONSTER8_V2.h" // STM32F4 env:mks_monster8 env:mks_monster8_usb_flash_drive env:mks_monster8_usb_flash_drive_msc #include "stm32f4/pins_MKS_MONSTER8_V2.h" // STM32F4 env:mks_monster8 env:mks_monster8_usb_flash_drive env:mks_monster8_usb_flash_drive_msc
#elif MB(TH3D_EZBOARD_V2) #elif MB(TH3D_EZBOARD_V2)
#include "stm32f4/pins_TH3D_EZBOARD_V2.h" // STM32F4 env:TH3D_EZBoard_V2 #include "stm32f4/pins_TH3D_EZBOARD_V2.h" // STM32F4 env:TH3D_EZBoard_V2_no_bootloader env:TH3D_EZBoard_V2_OpenBLT
#elif MB(OPULO_LUMEN_REV3) #elif MB(OPULO_LUMEN_REV3)
#include "stm32f4/pins_OPULO_LUMEN_REV3.h" // STM32F4 env:Opulo_Lumen_REV3 #include "stm32f4/pins_OPULO_LUMEN_REV3.h" // STM32F4 env:Opulo_Lumen_REV3
#elif MB(MKS_ROBIN_NANO_V1_3_F4) #elif MB(MKS_ROBIN_NANO_V1_3_F4)

View file

@ -10,11 +10,11 @@ if pioutil.is_pio_build():
board = env.BoardConfig() board = env.BoardConfig()
board_keys = board.get("build").keys() board_keys = board.get("build").keys()
if 'encrypt' in board_keys: if 'encode' in board_keys:
env.AddPostAction( env.AddPostAction(
join("$BUILD_DIR", "${PROGNAME}.bin"), join("$BUILD_DIR", "${PROGNAME}.bin"),
env.VerboseAction(" ".join([ env.VerboseAction(" ".join([
"$OBJCOPY", "-O", "srec", "$OBJCOPY", "-O", "srec",
"\"$BUILD_DIR/${PROGNAME}.elf\"", "\"" + join("$BUILD_DIR", board.get("build.encrypt")) + "\"" "\"$BUILD_DIR/${PROGNAME}.elf\"", "\"" + join("$BUILD_DIR", board.get("build.encode")) + "\""
]), "Building $TARGET") ]), "Building " + board.get("build.encode"))
) )

View file

@ -106,24 +106,34 @@ extra_scripts = ${stm32_variant.extra_scripts}
# #
# Anet ET4-MB_V1.x/ET4P-MB_V1.x (STM32F407VGT6 ARM Cortex-M4) # Anet ET4-MB_V1.x/ET4P-MB_V1.x (STM32F407VGT6 ARM Cortex-M4)
# For use with with davidtgbe's OpenBLT bootloader https://github.com/davidtgbe/openblt/releases
# Comment out board_build.offset = 0x10000 if you don't plan to use OpenBLT/flashing directly to 0x08000000.
# #
[env:Anet_ET4_OpenBLT] [Anet_ET4]
extends = stm32_variant extends = stm32_variant
board = marlin_STM32F407VGT6_CCM board = marlin_STM32F407VGT6_CCM
board_build.variant = MARLIN_F4x7Vx board_build.variant = MARLIN_F4x7Vx
board_build.encrypt_mks = firmware.srec
board_build.offset = 0x10000
board_upload.offset_address = 0x08010000
build_flags = ${stm32_variant.build_flags} build_flags = ${stm32_variant.build_flags}
-DHAL_SD_MODULE_ENABLED -DHAL_SRAM_MODULE_ENABLED -DHAL_SD_MODULE_ENABLED -DHAL_SRAM_MODULE_ENABLED
build_unflags = ${stm32_variant.build_unflags} build_unflags = ${stm32_variant.build_unflags}
-DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483
#
# Anet ET4 directly flashed via ST-Link
#
[env:Anet_ET4_no_bootloader]
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} extra_scripts = ${stm32_variant.extra_scripts}
buildroot/share/PlatformIO/scripts/openblt.py buildroot/share/PlatformIO/scripts/openblt.py
debug_tool = jlink
upload_protocol = jlink
# #
# BigTreeTech SKR Pro (STM32F407ZGT6 ARM Cortex-M4) # BigTreeTech SKR Pro (STM32F407ZGT6 ARM Cortex-M4)
@ -546,16 +556,28 @@ build_unflags = -DUSBD_USE_CDC
# #
# TH3D EZBoard v2.0 (STM32F405RGT6 ARM Cortex-M4) # TH3D EZBoard v2.0 (STM32F405RGT6 ARM Cortex-M4)
# #
[env:TH3D_EZBoard_V2] [TH3D_EZBoard_V2]
extends = stm32_variant extends = stm32_variant
board = genericSTM32F405RG board = genericSTM32F405RG
board_build.variant = MARLIN_TH3D_EZBOARD_V2 board_build.variant = MARLIN_TH3D_EZBOARD_V2
board_build.encrypt_mks = firmware.bin
board_build.offset = 0xC000
board_upload.offset_address = 0x0800C000
build_flags = ${stm32_variant.build_flags} -DHSE_VALUE=12000000U -O0 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 debug_tool = stlink
upload_protocol = stlink upload_protocol = stlink
#
# TH3D EZBoard v2.0 with OpenBLT from https://github.com/rhapsodyv/OpenBLT-STM32
#
[env:TH3D_EZBoard_V2_OpenBLT]
extends = TH3D_EZBoard_V2
board_build.encode = firmware.bin
board_build.offset = 0xC000
board_upload.offset_address = 0x0800C000
extra_scripts = ${stm32_variant.extra_scripts} extra_scripts = ${stm32_variant.extra_scripts}
buildroot/share/PlatformIO/scripts/openblt.py buildroot/share/PlatformIO/scripts/openblt.py