2019-02-28 18:42:02 +00:00
|
|
|
#
|
|
|
|
# Copyright (c) 2018 Arm Limited
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
#
|
|
|
|
|
|
|
|
import os
|
2019-03-06 14:22:12 +00:00
|
|
|
from os.path import abspath, dirname
|
2019-02-28 18:42:02 +00:00
|
|
|
from os.path import join as path_join
|
|
|
|
|
2019-03-06 14:22:12 +00:00
|
|
|
from intelhex import IntelHex
|
2019-02-28 18:42:02 +00:00
|
|
|
|
|
|
|
SCRIPT_DIR = dirname(abspath(__file__))
|
|
|
|
MBED_OS_ROOT = abspath(path_join(SCRIPT_DIR, os.pardir, os.pardir))
|
|
|
|
LPC55S69_BASE = path_join(MBED_OS_ROOT, 'targets', 'TARGET_NXP', 'TARGET_MCUXpresso_MCUS', 'TARGET_LPC55S69')
|
|
|
|
|
|
|
|
|
2019-03-06 14:22:12 +00:00
|
|
|
def lpc55s69_complete(t_self, non_secure_bin, secure_bin):
|
2019-03-07 16:00:20 +00:00
|
|
|
if secure_bin is None:
|
|
|
|
return None
|
|
|
|
|
2019-03-03 16:25:03 +00:00
|
|
|
assert os.path.isfile(secure_bin)
|
|
|
|
assert os.path.isfile(non_secure_bin)
|
|
|
|
|
2019-03-06 14:22:12 +00:00
|
|
|
ns_hex = IntelHex(non_secure_bin)
|
|
|
|
s_hex = IntelHex()
|
|
|
|
s_hex.loadbin(secure_bin)
|
2019-02-28 18:42:02 +00:00
|
|
|
|
2019-03-06 14:22:12 +00:00
|
|
|
s_hex.merge(ns_hex, overlap='ignore')
|
|
|
|
s_hex.tofile(non_secure_bin, 'hex')
|