0

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

C:\Users\???\AppData\Local\Arduino15\packages\sandeepmistry\tools\openocd\0.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\0.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 代码。

我错过了什么?

4

1 回答 1

1

我想到了!!!

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

我觉得带空格的文件夹/文件名会有同样的问题。

C:\Users\???\AppData\Local\Arduino15\packages\sandeepmistry\tools\openocd\0.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;" 
于 2016-11-30T05:15:47.117 回答