Skip to content

Commit e0ff3a5

Browse files
punitvaraAnas Nashif
authored andcommitted
boards: arduino_due: Add make flash support
This patch automates flashing process for arduino_due board. Just make flash will able to flash binary file on the board. Bossa tool(http://www.shumatech.com/web/products/bossa) manual flashing process is automated through shell script and currently this binary is only available for x86_64 architecture. JIRA : ZEP-145 Change-Id: Ib7b525466239d0437e449c56827f8a9b3e5a96a1 Signed-off-by: Punit Vara <[email protected]>
1 parent fc65d6d commit e0ff3a5

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FLASH_SCRIPT = bossa-flash.sh

scripts/Makefile.toolchain.zephyr

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ DTC = ${TOOLCHAIN_HOME}/usr/bin/dtc
113113
OPENOCD ?= ${TOOLCHAIN_HOME}/usr/bin/openocd
114114
OPENOCD_DEFAULT_PATH ?= ${TOOLCHAIN_HOME}/usr/share/openocd/scripts
115115

116-
export LIB_INCLUDE_DIR CROSS_COMPILE TOOLCHAIN_LIBS QEMU_BIN_PATH QEMU TOOLCHAIN_CFLAGS OPENOCD OPENOCD_DEFAULT_PATH DTC
116+
BOSSAC ?= ${TOOLCHAIN_HOME}/usr/bin/bossac
117+
118+
export LIB_INCLUDE_DIR CROSS_COMPILE TOOLCHAIN_LIBS QEMU_BIN_PATH QEMU TOOLCHAIN_CFLAGS OPENOCD OPENOCD_DEFAULT_PATH DTC BOSSAC
117119

118120
ifndef MAKEFILE_TOOLCHAIN_DO_PASS2
119121
MAKEFILE_TOOLCHAIN_DO_PASS2=true

scripts/support/bossa-flash.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/sh
2+
3+
# This script is loosly based on a script with same purpose provided
4+
# by RIOT-OS (https://github.com/RIOT-OS/RIOT)
5+
6+
BOSSAC_CMD="${BOSSAC:-bossac}"
7+
if [ `uname` = "Linux" ]; then
8+
stty -F /dev/ttyACM0 raw ispeed 1200 ospeed 1200 cs8 \
9+
-cstopb ignpar eol 255 eof 255
10+
${BOSSAC} -R -e -w -v -b "${O}/${KERNEL_BIN_NAME}"
11+
else
12+
echo "CAUTION: No flash tool for your host system found!"
13+
fi
14+

0 commit comments

Comments
 (0)