Move modified ElfToBin builder to ESP-IDF build script

This commit is contained in:
valeros
2020-03-19 12:07:58 +02:00
parent d3bbd633f7
commit f923797a30
2 changed files with 10 additions and 14 deletions
+10 -1
View File
@@ -20,6 +20,7 @@ Espressif IoT Development Framework for ESP32 MCU
https://github.com/espressif/esp-idf
"""
import copy
import json
import subprocess
import sys
@@ -718,7 +719,6 @@ partition_table = env.Command(
),
)
env.Depends("$BUILD_DIR/$PROGNAME$PROGSUFFIX", partition_table)
#
@@ -882,6 +882,15 @@ env.Prepend(
],
)
#
# To embed firmware checksum a special argument for esptool.py is required
#
action = copy.deepcopy(env["BUILDERS"]["ElfToBin"].action)
action.cmd_list = env["BUILDERS"]["ElfToBin"].action.cmd_list.replace(
"-o", "--elf-sha256-offset 0xb0 -o")
env["BUILDERS"]["ElfToBin"].action = action
#
# Compile ULP sources in 'ulp' folder
#
-13
View File
@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import copy
import re
import sys
from os.path import isfile, join
@@ -128,17 +127,6 @@ def __fetch_spiffs_size(target, source, env):
return (target, source)
def append_elf_hash(target, source, env):
if "__BOOTLOADER_BUILD" not in env["CPPDEFINES"]:
if "--elf-sha256-offset" not in env["BUILDERS"]["ElfToBin"].action.cmd_list:
action = copy.deepcopy(env["BUILDERS"]["ElfToBin"].action)
action.cmd_list = env["BUILDERS"]["ElfToBin"].action.cmd_list.replace(
"-o", "--elf-sha256-offset 0xb0 -o")
env["BUILDERS"]["ElfToBin"].action = action
return (target, source)
env = DefaultEnvironment()
platform = env.PioPlatform()
board = env.BoardConfig()
@@ -194,7 +182,6 @@ env.Append(
"--flash_size", board.get("upload.flash_size", "detect"),
"-o", "$TARGET", "$SOURCES"
]), "Building $TARGET"),
emitter=append_elf_hash,
suffix=".bin"
),
DataToBin=Builder(