You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ma...@apache.org on 2016/11/04 04:38:10 UTC

[12/13] incubator-mynewt-core git commit: MYNEWT-418; frdm-k64f - update debug/download to use environment variables. Use common function to figure out what file to load.

MYNEWT-418; frdm-k64f - update debug/download to use environment
variables. Use common function to figure out what file to load.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/f453bd29
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/f453bd29
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/f453bd29

Branch: refs/heads/develop
Commit: f453bd2916b407d76709cdf09e039012408b0bfe
Parents: f971e8a
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Thu Nov 3 21:27:34 2016 -0700
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Thu Nov 3 21:32:01 2016 -0700

----------------------------------------------------------------------
 hw/bsp/frdm-k64f/frdm-k64_debug.sh    | 21 ++++++++++---------
 hw/bsp/frdm-k64f/frdm-k64_download.sh | 33 +++++++-----------------------
 2 files changed, 18 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/f453bd29/hw/bsp/frdm-k64f/frdm-k64_debug.sh
----------------------------------------------------------------------
diff --git a/hw/bsp/frdm-k64f/frdm-k64_debug.sh b/hw/bsp/frdm-k64f/frdm-k64_debug.sh
index b387d9c..5d8159b 100755
--- a/hw/bsp/frdm-k64f/frdm-k64_debug.sh
+++ b/hw/bsp/frdm-k64f/frdm-k64_debug.sh
@@ -16,18 +16,19 @@
 # specific language governing permissions and limitations
 # under the License.
 #
-# Called: $0 <bsp_directory_path> <binary> [features...]
-#  - bsp_directory_path is absolute path to hw/bsp/bsp_name
-#  - binary is the path to prefix to target binary, .elf appended to name is
-#    the ELF file
-#  - identities is the project identities string.
+
+# Called with following variables set:
+#  - CORE_PATH is absolute path to @apache-mynewt-core
+#  - BSP_PATH is absolute path to hw/bsp/bsp_name
+#  - BIN_BASENAME is the path to prefix to target binary,
+#    .elf appended to name is the ELF file
+#  - FEATURES holds the target features string
+#  - EXTRA_JTAG_CMD holds extra parameters to pass to jtag software
+#  - RESET set if target should be reset when attaching
+#  - NO_GDB set if we should not start gdb to debug
 #
-if [ $# -lt 1 ]; then
-    echo "Need binary to debug"
-    exit 1
-fi
 
-FILE_NAME=$2.elf
+FILE_NAME=$BIN_BASENAME.elf
 GDB_CMD_FILE=.gdb_cmds
 
 echo "Debugging" $FILE_NAME

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/f453bd29/hw/bsp/frdm-k64f/frdm-k64_download.sh
----------------------------------------------------------------------
diff --git a/hw/bsp/frdm-k64f/frdm-k64_download.sh b/hw/bsp/frdm-k64f/frdm-k64_download.sh
index fccd7e0..84d1dbc 100755
--- a/hw/bsp/frdm-k64f/frdm-k64_download.sh
+++ b/hw/bsp/frdm-k64f/frdm-k64_download.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -17,6 +17,7 @@
 # under the License.
 
 # Called with following variables set:
+#  - CORE_PATH is absolute path to @apache-mynewt-core
 #  - BSP_PATH is absolute path to hw/bsp/bsp_name
 #  - BIN_BASENAME is the path to prefix to target binary,
 #    .elf appended to name is the ELF file
@@ -24,35 +25,15 @@
 #  - FEATURES holds the target features string
 #  - EXTRA_JTAG_CMD holds extra parameters to pass to jtag software
 #  - MFG_IMAGE is "1" if this is a manufacturing image
+#  - FLASH_OFFSET contains the flash offset to download to
+#  - BOOT_LOADER is set if downloading a bootloader
 
-if [ -z "${BIN_BASENAME}" ]; then
-    echo "Need binary to download"
-    exit 1
-fi
-
-IS_BOOTLOADER=0
-USE_OPENOCD=0
-GDB_CMD_FILE=.gdb_cmds
+. $CORE_PATH/hw/scripts/openocd.sh
 
-# Look for 'bootloader' in FEATURES
-for feature in ${FEATURES}; do
-    if [ ${feature} == "BOOT_LOADER" ]; then
-        IS_BOOTLOADER=1
-    fi
-    if [ ${feature} = "openocd_debug" ]; then
-        USE_OPENOCD=1
-    fi
-done
+common_file_to_load
 
 if [ "$MFG_IMAGE" ]; then
-    FLASH_OFFSET=0x0
-    FILE_NAME=$BIN_BASENAME.bin
-elif [ $IS_BOOTLOADER -eq 1 ]; then
-    FLASH_OFFSET=0x00000000
-    FILE_NAME=${BIN_BASENAME}.elf.bin
-else
-    FLASH_OFFSET=0x00008000
-    FILE_NAME=${BIN_BASENAME}.elf.bin
+    FLASH_OFFSET=0
 fi
 
 echo "Downloading" ${FILE_NAME} "to" ${FLASH_OFFSET}