From 8b2ff285beaed5b294fb8e5a4b033f00f51cb35b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ga=C3=ABtan=20Harter?= <gaetan.harter@fu-berlin.de>
Date: Mon, 26 Mar 2018 18:29:25 +0200
Subject: [PATCH] mbed_lpc1768/flash: get BINFILE from cli

---
 boards/mbed_lpc1768/Makefile.include | 2 +-
 boards/mbed_lpc1768/dist/flash.sh    | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/boards/mbed_lpc1768/Makefile.include b/boards/mbed_lpc1768/Makefile.include
index 3adfc67b21..e5511e48d7 100644
--- a/boards/mbed_lpc1768/Makefile.include
+++ b/boards/mbed_lpc1768/Makefile.include
@@ -6,7 +6,7 @@ export DEBUGGER =
 export DEBUGSERVER =
 
 HEXFILE = $(BINFILE)
-export FFLAGS =
+export FFLAGS = $(HEXFILE)
 export DEBUGGER_FLAGS =
 
 # define the default port depending on the host OS
diff --git a/boards/mbed_lpc1768/dist/flash.sh b/boards/mbed_lpc1768/dist/flash.sh
index 1eaeebec93..4ff2af9845 100755
--- a/boards/mbed_lpc1768/dist/flash.sh
+++ b/boards/mbed_lpc1768/dist/flash.sh
@@ -21,6 +21,8 @@
 OS=`uname`
 DID_MOUNT=false
 
+BINFILE=$1
+
 # set the mount path depending on the OS
 if [ ${OS} = "Linux" ]
 then
@@ -55,7 +57,7 @@ fi
 # remove old binary
 rm -f ${MOUNT}/*.bin
 # copy new binary to device
-cp ${HEXFILE} ${MOUNT}
+cp ${BINFILE} ${MOUNT}
 # make sure hexfile was written
 sync
 
-- 
GitLab