rtl8195am - use TOOLCHAIN_PATHS to locate toolchain

Use TOOLCHAIN_PATHS to locate toolchain binaries for users might set
compiler paths, through mbed_settings.py, env vars, or system path.

Signed-off-by: Tony Wu <tonywu@realtek.com>
pull/5042/head
Tony Wu 2017-09-05 12:00:07 +08:00
parent 943fc32c73
commit 7d6e66db2f
1 changed files with 7 additions and 3 deletions

View File

@ -9,6 +9,7 @@ import hashlib
import shutil
from tools.paths import TOOLS_BOOTLOADERS
from tools.toolchains import TOOLCHAIN_PATHS
from datetime import datetime
# Constant Variables
@ -122,7 +123,8 @@ def parse_load_segment_gcc(image_elf):
# LOAD 0x000034 0x10006000 0x10006000 0x026bc 0x026bc RW 0x8
# LOAD 0x0026f0 0x30000000 0x30000000 0x06338 0x06338 RWE 0x4
segment_list = []
cmd = 'arm-none-eabi-readelf -l ' + image_elf
cmd = os.path.join(TOOLCHAIN_PATHS['GCC_ARM'], 'arm-none-eabi-readelf')
cmd = '"' + cmd + '"' + ' -l ' + image_elf
for line in subprocess.check_output(cmd, shell=True, universal_newlines=True).split("\n"):
if not line.startswith(" LOAD"):
continue
@ -153,7 +155,8 @@ def parse_load_segment_armcc(image_elf):
(offset, addr, size) = (0, 0, 0)
segment_list = []
in_segment = False
cmd = 'fromelf --text -v --only=none ' + image_elf
cmd = os.path.join(TOOLCHAIN_PATHS['ARM'], 'bin', 'fromelf')
cmd = '"' + cmd + '"' + ' --text -v --only=none ' + image_elf
for line in subprocess.check_output(cmd, shell=True, universal_newlines=True).split("\n"):
if line == "":
pass
@ -201,7 +204,8 @@ def parse_load_segment_iar(image_elf):
segment_list = []
in_segment = False
cmd = 'ielfdumparm ' + image_elf
cmd = os.path.join(TOOLCHAIN_PATHS['IAR'], 'bin', 'ielfdumparm')
cmd = '"' + cmd + '"' + ' ' + image_elf
for line in subprocess.check_output(cmd, shell=True, universal_newlines=True).split("\n"):
if line.startswith(" SEGMENTS:"):
in_segment = True