2016-12-30 134 views
1

當我從我的Olimex STM32-E407主板附帶的舊版Eclipse安裝遷移時,我遇到了OpenOCD安裝的一些困難。OpenOCD和Eclipse,錯誤的設置?

舊的Eclipse設置正常工作;一個Zylin嵌入式調試器具有以下的init腳本:

target remote localhost:3333 
monitor reset halt 
monitor wait_halt 
monitor sleep 100 
monitor poll 
monitor flash write_image erase main.bin 0x08000000 
monitor sleep 200 

而這種運行腳本:

monitor soft_reset_halt 
monitor wait_halt 
monitor poll 
thbreak main 
continue 

因爲我切換到新的Eclipse,我可以選擇不同的調試器Zylin似乎已經過時(最新谷歌的結果在2010年之前)。在Eclipse Neon中,我選擇了GDB OpenOCD Debug,它將從與舊Eclipse相同的OpenOCD實例開始。它不會從Eclipse本身啓動可執行文件。

的OpenOCD的腳本如下所示:

-f ../scripts/interface/ftdi/olimex-arm-usb-tiny-h.cfg 
-f ../scripts/board/olimex_stm32_e407.cfg 

在啓動選項卡我複製了initalization和運行命令按照上面,改變main.bin到Dev.elf並保存設置。

從Eclipse開始調試會在下面的輸出中產生。即使當我使用舊的eclipse中的原始main.bin時 - 以前工作過! - 我似乎無法解決這個問題。

Open On-Chip Debugger 0.10.0-rc1 
Licensed under GNU GPL v2 
For bug reports, read 
    http://openocd.org/doc/doxygen/bugs.html 
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'. 
adapter speed: 2000 kHz 
adapter_nsrst_delay: 100 
jtag_ntrst_delay: 100 
none separate 
cortex_m reset_config sysresetreq 
Info : clock speed 2000 kHz 
Info : JTAG tap: stm32f4x.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4) 
Info : JTAG tap: stm32f4x.bs tap/device found: 0x06413041 (mfg: 0x020 (STMicroelectronics), part: 0x6413, ver: 0x0) 
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints 
Info : accepting 'gdb' connection on tcp/3333 
Info : device id = 0x10076413 
Info : flash size = 1024kbytes 
undefined debug reason 7 - target needs reset 
adapter speed: 2000 kHz 
Info : JTAG tap: stm32f4x.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4) 
Info : JTAG tap: stm32f4x.bs tap/device found: 0x06413041 (mfg: 0x020 (STMicroelectronics), part: 0x6413, ver: 0x0) 
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x080002b8 msp: 0x20020000 
adapter speed: 8000 kHz 
Info : dropped 'gdb' connection 
Info : accepting 'gdb' connection on tcp/3333 
adapter speed: 2000 kHz 
Info : JTAG tap: stm32f4x.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4) 
Info : JTAG tap: stm32f4x.bs tap/device found: 0x06413041 (mfg: 0x020 (STMicroelectronics), part: 0x6413, ver: 0x0) 
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x080002b8 msp: 0x20020000 
background polling: on 
TAP: stm32f4x.cpu (enabled) 
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x080002b8 msp: 0x20020000 
auto erase enabled 
Error: couldn't open Dev.elf 

adapter speed: 2000 kHz 
Info : JTAG tap: stm32f4x.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4) 
Info : JTAG tap: stm32f4x.bs tap/device found: 0x06413041 (mfg: 0x020 (STMicroelectronics), part: 0x6413, ver: 0x0) 
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x080002b8 msp: 0x20020000 
adapter speed: 8000 kHz 
Info : Padding image section 0 with 1 bytes 
adapter speed: 2000 kHz 
Info : JTAG tap: stm32f4x.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4) 
Info : JTAG tap: stm32f4x.bs tap/device found: 0x06413041 (mfg: 0x020 (STMicroelectronics), part: 0x6413, ver: 0x0) 
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x080002b8 msp: 0x20020000 
Info : dropped 'gdb' connection 

讓我感到驚訝的是它如何使GDB重新連接以及適配器速度正在切換。我究竟做錯了什麼?

回答

0

我已找到暫時的解決方案。

  1. 在GDB硬件調試添加調試選項
  2. 用GDB命令 '武裝 - 無 - EABI-gdb' 的 - 你需要在你的PATH環境的可執行文件。
  3. 使用遠程目標的通用TCP/IP「作爲JTAG器件在localhost:3333
  4. 轉到啓動選項卡,選擇默認設置。 Initalization命令:

    monitor reset halt 
    monitor flash write_image erase main.bin 0x08000000 
    monitor sleep 200 
    
  5. 所使用的運行命令是:

    monitor soft_reset_halt 
    monitor wait_halt 
    monitor poll 
    thbreak main 
    continue 
    

這使用從我最初的Eclipse示例項目 '老' main.bin。如果使用.elf文件,則應該使用此文件:

monitor flash write_image erase main.elf 

這是由於.elf包含所有必需的標頭。