This repository has been archived on 2025-12-23. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Marlin_FB4S/buildroot/share/PlatformIO/scripts/openblt.py
Sergey 398bb884ec 2.0.9
2021-07-05 14:01:47 +03:00

19 lines
464 B
Python

#
# Convert the ELF to an SREC file suitable for some bootloaders
#
import os,sys
from os.path import join
Import("env")
board = env.BoardConfig()
board_keys = board.get("build").keys()
if 'encrypt' 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.encrypt")) + "\""
]), "Building $TARGET")
)