This is an automated email from the ASF dual-hosted git repository.

andk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 2168301f0 hw/scripts: set JLink executable based on operating system
2168301f0 is described below

commit 2168301f08d5dc2f87ffe4e261d9195dd33b5ed2
Author: Piotr Narajowski <[email protected]>
AuthorDate: Wed Jun 5 09:36:59 2024 +0200

    hw/scripts: set JLink executable based on operating system
    
    When using Windows, check_downloader should look for JLink.exe
    instead of JLinkExe.
---
 hw/scripts/download.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/hw/scripts/download.sh b/hw/scripts/download.sh
index 6b27c6fe1..e9fc3113b 100644
--- a/hw/scripts/download.sh
+++ b/hw/scripts/download.sh
@@ -28,6 +28,11 @@
 #  - 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 [ "$OS" = "Windows_NT" ]; then
+    JLINKEXE=JLink.exe
+else
+    JLINKEXE=JLinkExe
+fi
 
 check_downloader() {
   if ! command -v $1 &> /dev/null; then
@@ -52,7 +57,7 @@ case "${MYNEWT_VAL_MYNEWT_DOWNLOADER}" in
     ezflashcli_load
     ;;
   "jlink")
-    check_downloader JLinkExe
+    check_downloader $JLINKEXE
     . $CORE_PATH/hw/scripts/jlink.sh
     if [ -z "${MYNEWT_VAL_JLINK_TARGET}" ] ; then
       >&2 echo -e "\n\nSyscfg value MYNEWT_DOWNLOADER set to 'jlink' but 
JLINK_TARGET not set in syscfg."

Reply via email to