【问题标题】:Arduino OpenOCD command works in IDE but not from CMD prompt. What am I missing? (NRF)Arduino OpenOCD 命令在 IDE 中有效,但在 CMD 提示符下无效。我错过了什么? (NRF)
【发布时间】:2016-11-29 09:20:03
【问题描述】:

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 代码。

我错过了什么?

【问题讨论】:

  • 使用 Linux。 Windows 终端无法正常工作
  • 如果 interface/jlink.cfg ad target/nrf52.cfg 是相对路径,那么您可能是在不同的文件夹中启动 openocd.exe 并且找不到这些文件。

标签: arduino openocd nrf51


【解决方案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;" 

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-09-10
    • 1970-01-01
    • 2014-11-29
    • 2013-08-14
    • 1970-01-01
    • 2020-12-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多