mkiiskila commented on code in PR #2997:
URL: https://github.com/apache/mynewt-core/pull/2997#discussion_r1205353035


##########
hw/bsp/nordic_pca10095_net/bsp.yml:
##########
@@ -29,7 +29,7 @@ bsp.linkerscript.BOOT_LOADER.OVERWRITE:
     - "hw/bsp/nordic_pca10095_net/boot-nrf5340_net.ld"
     - "@apache-mynewt-core/hw/mcu/nordic/nrf5340_net/nrf5340_net.ld"
 bsp.part2linkerscript: 
"hw/bsp/nordic_pca10095_net/split-nordic_pca10095_net.ld"
-bsp.downloadscript: 
"hw/bsp/nordic_pca10095_net/nordic_pca10095_net_download.sh"
+bsp.downloadscript: "@apache-mynewt-core/hw/scripts/download.sh"

Review Comment:
   Is the repo name needed in the location for this BSP for some reason?



##########
hw/scripts/download.sh:
##########
@@ -0,0 +1,88 @@
+#!/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
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# 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
+#  - IMAGE_SLOT is the image slot to download to (for non-mfg-image, non-boot)
+#  - 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 [ "$MFG_IMAGE" ]; then
+  if [ -z "$MYNEWT_VAL_MYNEWT_DOWNLOADER_MFG_IMAGE_FLASH_OFFSET"] ; then
+    >&2 echo "Syscfg value MYNEWT_DOWNLOADER_MFG_IMAGE_FLASH_OFFSET not set"
+    exit -1
+  fi
+  FLASH_OFFSET=${MYNEWT_VAL_MYNEWT_DOWNLOADER_MFG_IMAGE_FLASH_OFFSET}
+fi
+
+case "${MYNEWT_VAL_MYNEWT_DOWNLOADER}" in
+  "ezflashcli")
+    . $CORE_PATH/hw/scripts/ezflashcli.sh
+    common_file_to_load
+    ezflashcli_load
+    ;;
+  "jlink")
+    . $CORE_PATH/hw/scripts/jlink.sh
+    JLINK_DEV=${MYNEWT_VAL_JLINK_TARGET}

Review Comment:
   Should we complain if the required variable is not set? The same applies to 
openocd case.
   
   This might save users some debug time...



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to