Arduino OpenOCD 命令在 IDE 中有效,但在 CMD 提示符下无效。我错过了什么? (NRF)

Arduino OpenOCD command works in IDE but not from CMD prompt. What am I missing? (NRF)

Arduino 成功完成了以下操作。但是当我从命令行尝试它时,它失败了。这是为什么?

C:\Users\???\AppData\Local\Arduino15\packages\sandeepmistry\tools\openocd[=11=].10.0-dev.nrf5/bin/openocd.exe -d2 
-f interface/jlink.cfg 
-c transport select swd; 
-f target/nrf52.cfg 
-c program {{C:\???\EddystoneURL.ino.hex}} verify reset; shutdown; 

结果:

Open On-Chip Debugger 0.10.0-dev-00254-g696fc0a (2016-04-10-10:13)
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
debug_level: 2
swd
adapter speed: 10000 kHz
cortex_m reset_config sysresetreq
jaylink: Failed to open device: LIBUSB_ERROR_NOT_SUPPORTED.
Info : No device selected, using first device.
Info : J-Link OB-SAM3U128-V2-NordicSemi compiled Jan 21 2016 17:58:20
Info : Hardware version: 1.00
Info : VTarget = 3.300 V
Info : Reduced speed from 10000 kHz to 1000 kHz (maximum).
Info : Reduced speed from 10000 kHz to 1000 kHz (maximum).
Info : clock speed 10000 kHz
Info : SWD IDCODE 0x2ba01477
Info : nrf52.cpu: hardware has 6 breakpoints, 4 watchpoints
nrf52.cpu: target state: halted
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x000008e4 msp: 0x20000400
** Programming Started **
auto erase enabled
Info : nRF51822-QFN48(build code: B00) 512kB Flash
Warn : using fast async flash loader. This is currently supported
Warn : only with ST-Link and CMSIS-DAP. If you have issues, add
Warn : "set WORKAREASIZE 0" before sourcing nrf51.cfg to disable it
wrote 28672 bytes from file C:\???\EddystoneURL.ino.hex in 0.835260s (33.522 KiB/s)
** Programming Finished **
** Verify Started **
verified 26768 bytes in 0.144835s (180.486 KiB/s)
** Verified OK **
** Resetting Target **
shutdown command invoked

当我从命令行尝试上述操作时,我得到以下信息:

C:\WINDOWS\system32>C:\Users\???\AppData\Local\Arduino15\packages\sandeepmistry\tools\openocd[=13=].10.0-dev.nrf5/bin/openocd.exe -d2 -f interface/jlink.cfg -c transport select swd; -f target/nrf52.cfg -c program {{C:\???\EddystoneURL.ino.hex}} verify reset; shutdown;
Open On-Chip Debugger 0.10.0-dev-00254-g696fc0a (2016-04-10-10:13)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
debug_level: 2
interface_transports transport ...
transport
  transport init
  transport list
  transport select [transport_name]
transport : command requires more arguments
in procedure 'transport'

我已经替换了十六进制文件的完整路径以使其更易于阅读。

我正在尝试使用 Arduino 作为我的工具链来上传预构建的二进制文件。从 IDE 我可以做到,但只能使用 Arduino Built 代码。

我错过了什么?

我想通了!!!

命令参数需要用引号引起来,否则Windows会认为它们是下一个参数,因为其中有空格。

我感觉 folder/file 带空格的名称也会有同样的问题。

C:\Users\???\AppData\Local\Arduino15\packages\sandeepmistry\tools\openocd[=10=].10.0-dev.nrf5/bin/openocd.exe -d2 
-f interface/jlink.cfg 
-c "transport select swd;" 
-f target/nrf52.cfg 
-c "program {{C:\???\EddystoneURL.ino.hex}} verify reset; shutdown;"