Соединение OpenOCD с STM32F1x и ST-Link - PullRequest
1 голос
/ 10 апреля 2020

Я использую STM32F103. Я хочу использовать OpenOCD для fla sh STM32. Я использовал keil, но я хочу перейти на компилятор arm-g cc. Я могу скомпилировать код для контроллера. Но теперь я хочу использовать его sh, используя OpenOCD. Я был в состоянии управлять его конфигурациями.

Вот журналы соединения openocd.

X:\Work\OToggle>openocd -f led_Debug.cfg
Open On-Chip Debugger 0.10.0+dev-00021-g524e8c8 (2019-04-12-08:48)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 1000 kHz
adapter_nsrst_delay: 100
srst_only separate srst_nogate srst_open_drain connect_assert_srst
none separate
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 1000 kHz
Info : STLINK v2 JTAG v17 API v2 SWIM v4 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 3.245003
Error: BUG: can't assert SRST
Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : Listening on port 3333 for gdb connections
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f1x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 100ms
Info : Previous state query failed, trying to reconnect
Polling target stm32f1x.cpu failed, trying to reexamine
Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f1x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 100ms
Info : Previous state query failed, trying to reconnect
Polling target stm32f1x.cpu failed, trying to reexamine
Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f1x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 100ms
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f1x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 300ms
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f1x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 700ms
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f1x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 1500ms
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f1x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 3100ms
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f1x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 6300ms
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f1x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 6300ms
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f1x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 6300ms
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f1x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 6300ms
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f1x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 6300ms
Info : Previous state query failed, trying to reconnect
Polling target stm32f1x.cpu failed, trying to reexamine
Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f1x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 100ms
Info : Previous state query failed, trying to reconnect
Polling target stm32f1x.cpu failed, trying to reexamine
Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f1x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 100ms
Info : Previous state query failed, trying to reconnect
Polling target stm32f1x.cpu failed, trying to reexamine
Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f1x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 100ms
Info : Previous state query failed, trying to reconnect
Polling target stm32f1x.cpu failed, trying to reexamine
Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f1x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 100ms
Info : Previous state query failed, trying to reconnect
Polling target stm32f1x.cpu failed, trying to reexamine
Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f1x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 100ms
Info : Previous state query failed, trying to reconnect
Polling target stm32f1x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 100ms
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f1x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 300ms
Info : Previous state query failed, trying to reconnect
Polling target stm32f1x.cpu failed, trying to reexamine
Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f1x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 100ms
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f1x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 300ms
Info : Previous state query failed, trying to reconnect
Polling target stm32f1x.cpu failed, trying to reexamine
Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f1x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 100ms
Info : Previous state query failed, trying to reconnect
Polling target stm32f1x.cpu failed, trying to reexamine
Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f1x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 100ms
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f1x.cpu failed, trying to reexamine
Info : stm32f1x.cpu: hardware has 6 breakpoints, 0 watchpoints
Error: mem2array: Read @ 0xe0042004, w=4, cnt=1, failed
mem_helper.tcl:6: Error:
in procedure 'mmw'
in procedure 'mrw' called at file "mem_helper.tcl", line 16
at file "mem_helper.tcl", line 6

Info : Previous state query failed, trying to reconnect
Info : accepting 'gdb' connection on tcp/3333
Error: TRST/SRST error
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0800115c msp: 0x20005000
Info : device id = 0x20036410
Info : flash size = 64kbytes
Warn : ignoring character 0xffffffff
Warn : ignoring character 0xfffffffb
Warn : ignoring character 0x1f
Warn : ignoring character 0xffffffff
Warn : ignoring character 0xfffffffb
Warn : ignoring character 0x20
Warn : ignoring character 0xffffffff
Warn : ignoring character 0xfffffffb
Warn : ignoring character 0x18
Warn : ignoring character 0xffffffff
Warn : ignoring character 0xfffffffb
Warn : ignoring character 0x27
Warn : ignoring character 0xffffffff
Warn : ignoring character 0xfffffffd
Warn : ignoring character 0x1
Warn : ignoring character 0xffffffff
Warn : ignoring character 0xfffffffb
Info : The target is not running when halt was requested, stopping GDB.
Warn : ignoring character 0xffffffff
Warn : ignoring character 0xfffffffd
Info : The target is not running when halt was requested, stopping GDB.
Warn : ignoring character 0xd
Warn : ignoring character 0xa
Warn : keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (1072). Workaround: increase "set remotetimeout" in GDB
Warn : ignoring character 0x77
Warn : ignoring character 0x72
Warn : ignoring character 0x69
Warn : ignoring character 0x74
Warn : ignoring character 0x65
Warn : ignoring character 0x20
Warn : ignoring character 0x66
Warn : ignoring character 0x6c
Warn : ignoring character 0x61
Warn : ignoring character 0x73
Warn : ignoring character 0x68
Warn : ignoring character 0xd
Warn : ignoring character 0xa
Warn : keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (1108). Workaround: increase "set remotetimeout" in GDB

Я пробовал следующие вещи:

  1. Я открыл вторую командную строку и дал следующую команду
    arm-none-eabi-gdb led.elf
    
    Но затем начался сеанс GDB ( Я никогда не использовал его )
  2. Я пытался подключить цель через замазку (2-3 года назад я использовал этот метод для подключения nRF51) .

На этот раз оба метода не сработали.

...