From f130a80755ff30405ed8b2944e2f75944dad47b6 Mon Sep 17 00:00:00 2001 From: Mihail Stoyanov Date: Thu, 19 Feb 2015 18:08:02 +0200 Subject: [PATCH 1/2] When linking program define the output name based on the OUTPUT_EXT before processing linking the file. This let's any hooks to use the final output file/name. Omit the dot before the extension for OUTPUT_EXT (all Nordic and Teensy boards); --- workspace_tools/targets.py | 4 ++-- workspace_tools/toolchains/__init__.py | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/workspace_tools/targets.py b/workspace_tools/targets.py index a633286f7f..da1fce138b 100644 --- a/workspace_tools/targets.py +++ b/workspace_tools/targets.py @@ -415,7 +415,7 @@ class K20D50M(Target): self.detect_code = ["0230"] class TEENSY3_1(Target): - OUTPUT_EXT = '.hex' + OUTPUT_EXT = 'hex' def __init__(self): Target.__init__(self) @@ -742,7 +742,7 @@ class NRF51822(Target): 'offset' : 0x14000 } ] - OUTPUT_EXT = '.hex' + OUTPUT_EXT = 'hex' MERGE_SOFT_DEVICE = True def __init__(self): diff --git a/workspace_tools/toolchains/__init__.py b/workspace_tools/toolchains/__init__.py index 09d3f577d1..c780042ac8 100644 --- a/workspace_tools/toolchains/__init__.py +++ b/workspace_tools/toolchains/__init__.py @@ -633,6 +633,8 @@ class mbedToolchain: def link_program(self, r, tmp_path, name): ext = 'bin' + if hasattr(self.target, 'OUTPUT_EXT'): + ext = self.target.OUTPUT_EXT if hasattr(self.target, 'OUTPUT_NAMING'): self.var("binary_naming", self.target.OUTPUT_NAMING) @@ -641,7 +643,6 @@ class mbedToolchain: ext = ext[0:3] filename = name+'.'+ext - elf = join(tmp_path, name + '.elf') bin = join(tmp_path, filename) @@ -657,9 +658,6 @@ class mbedToolchain: self.var("compile_succeded", True) self.var("binary", filename) - if hasattr(self.target, 'OUTPUT_EXT'): - bin = bin.replace('.bin', self.target.OUTPUT_EXT) - return bin def default_cmd(self, command): From 0d4c158505d7d534eaa3597b2e4c509dcb6547b3 Mon Sep 17 00:00:00 2001 From: Mihail Stoyanov Date: Fri, 20 Feb 2015 02:30:01 +0200 Subject: [PATCH 2/2] A minor routine to take care of parasite symbols that may be left over in the serial read buffer. This happens when a program output wasn't terminated with new line. This also does not affect the test results. --- workspace_tools/host_tests/echo.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/workspace_tools/host_tests/echo.py b/workspace_tools/host_tests/echo.py index e855cb4a1c..75e534fb84 100644 --- a/workspace_tools/host_tests/echo.py +++ b/workspace_tools/host_tests/echo.py @@ -37,6 +37,13 @@ class EchoTest(): selftest.mbed.flush() selftest.notify("HOST: Starting the ECHO test") result = True + + """ This ensures that there are no parasites left in the serial buffer. + """ + for i in range(0, 2): + selftest.mbed.serial_write("\n") + c = selftest.mbed.serial_readline() + for i in range(0, self.TEST_LOOP_COUNT): TEST_STRING = str(uuid.uuid4()) + "\n" selftest.mbed.serial_write(TEST_STRING)