You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2019/04/01 20:33:21 UTC

[mynewt-core] branch master updated: openocd: Fix openocd_load for Windows

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

jerzy 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 1598362  openocd: Fix openocd_load for Windows
1598362 is described below

commit 1598362630d360474e4fff3506ae75512513dd3b
Author: Jerzy Kasenberg <je...@gmail.com>
AuthorDate: Sun Mar 31 23:37:45 2019 +0200

    openocd: Fix openocd_load for Windows
    
    openocd expects unix style file names even on Windows.
    
    Before pathc:
    $ newt load hifive1-boot
    Loading bootloader
    Error:
    Downloading bin\targets\hifive1-boot\app\apps\boot\boot.elf.bin to 0x20000000
    GNU MCU Eclipse 64-bit Open On-Chip Debugger 0.10.0+dev-00462-gdd1d90111 (2019-01-18-11:42)
    Licensed under GNU GPL v2
    ...
    ...
    auto erase enabled
    Error: couldn't open bin        argetshifive1-bootppppoooot.elf.bin
    
    Windows style path was passed and \ was treated as escape \t - tab
    
    After patch is applied flashing of hifive1 and bluepill works
---
 hw/scripts/openocd.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/scripts/openocd.sh b/hw/scripts/openocd.sh
index 1a9e68a..babf773 100755
--- a/hw/scripts/openocd.sh
+++ b/hw/scripts/openocd.sh
@@ -27,8 +27,12 @@ GDB=arm-none-eabi-gdb
 openocd_load () {
     OCD_CMD_FILE=.openocd_cmds
 
+    windows_detect
     parse_extra_jtag_cmd $EXTRA_JTAG_CMD
 
+    if [ $WINDOWS -eq 1 ] ; then
+        FILE_NAME=`cygpath -u $FILE_NAME`
+    fi
     echo "$EXTRA_JTAG_CMD" > $OCD_CMD_FILE
     echo "init" >> $OCD_CMD_FILE
     echo "$CFG_RESET" >> $OCD_CMD_FILE