mirror of https://github.com/ARMmbed/mbed-os.git
Removed import of version specific python modules, improved imports organization in PSOC6.py, fixed per PR comments
parent
d289b967f7
commit
bfe1d04ba2
|
|
@ -28,4 +28,3 @@ wmi==1.4.9;platform_system=='Windows'
|
||||||
psutil==5.6.2
|
psutil==5.6.2
|
||||||
cryptography>=2.4.x,<2.5
|
cryptography>=2.4.x,<2.5
|
||||||
Click>=7.0,<7.1
|
Click>=7.0,<7.1
|
||||||
pathlib>=1.0.1
|
|
||||||
|
|
|
||||||
|
|
@ -17,21 +17,15 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import platform
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import errno
|
|
||||||
from array import array
|
from array import array
|
||||||
from struct import (pack, unpack)
|
from struct import (pack, unpack)
|
||||||
from shutil import copy2
|
from shutil import copy2
|
||||||
|
import json
|
||||||
from intelhex import IntelHex, hex2bin, bin2hex
|
from intelhex import IntelHex, hex2bin, bin2hex
|
||||||
from intelhex.compat import asbytes
|
|
||||||
|
|
||||||
from ..config import ConfigException
|
from ..config import ConfigException
|
||||||
|
|
||||||
from pathlib import Path, PurePath
|
|
||||||
import json
|
|
||||||
|
|
||||||
# The size of the program data in Cypress HEX files is limited to 0x80000000
|
# The size of the program data in Cypress HEX files is limited to 0x80000000
|
||||||
# Higher addresses contain additional metadata (chip protection, eFuse data, etc..)
|
# Higher addresses contain additional metadata (chip protection, eFuse data, etc..)
|
||||||
CY_PROGRAM_SIZE = 0x80000000
|
CY_PROGRAM_SIZE = 0x80000000
|
||||||
|
|
@ -286,6 +280,8 @@ def process_target(toolchain, target):
|
||||||
:param target: Name of target being built
|
:param target: Name of target being built
|
||||||
:return: List with all data needed for adding signature
|
:return: List with all data needed for adding signature
|
||||||
"""
|
"""
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
targets_json = Path("targets/targets.json")
|
targets_json = Path("targets/targets.json")
|
||||||
cy_targets = Path("targets/TARGET_Cypress/TARGET_PSOC6/")
|
cy_targets = Path("targets/TARGET_Cypress/TARGET_PSOC6/")
|
||||||
sb_params_file_name = Path("secure_image_parameters.json")
|
sb_params_file_name = Path("secure_image_parameters.json")
|
||||||
|
|
@ -395,6 +391,8 @@ def sign_image(toolchain, binf):
|
||||||
:param toolchain: Toolchain object of current build session
|
:param toolchain: Toolchain object of current build session
|
||||||
:param binf: Binary file created for target
|
:param binf: Binary file created for target
|
||||||
"""
|
"""
|
||||||
|
from pathlib import PurePath
|
||||||
|
|
||||||
target_sig_data = None
|
target_sig_data = None
|
||||||
# reserve name for separate NSPE image
|
# reserve name for separate NSPE image
|
||||||
out_cm4_hex = binf[:-4] + "_cm4.hex"
|
out_cm4_hex = binf[:-4] + "_cm4.hex"
|
||||||
|
|
@ -446,10 +444,10 @@ def sign_image(toolchain, binf):
|
||||||
else:
|
else:
|
||||||
if slot["slot_data"]["type"] == "UPGRADE":
|
if slot["slot_data"]["type"] == "UPGRADE":
|
||||||
out_hex_name = binf[:-4] + "_upgrade.hex"
|
out_hex_name = binf[:-4] + "_upgrade.hex"
|
||||||
out_bin_name = out_hex_name[:-4] + "_signed.bin"
|
|
||||||
else:
|
else:
|
||||||
out_hex_name = binf
|
out_hex_name = binf
|
||||||
out_bin_name = out_hex_name[:-4] + "_signed.bin"
|
|
||||||
|
out_bin_name = out_hex_name[:-4] + "_signed.bin"
|
||||||
|
|
||||||
# call imgtool for signature
|
# call imgtool for signature
|
||||||
args = [sys.executable, str(slot["sdk_path"] / "imgtool/imgtool.py"),
|
args = [sys.executable, str(slot["sdk_path"] / "imgtool/imgtool.py"),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue