ilg-archived / openocd Goto Github PK
View Code? Open in Web Editor NEWThe GNU MCU Eclipse OpenOCD
Home Page: http://gnuarmeclipse.github.io/openocd/
License: GNU General Public License v2.0
The GNU MCU Eclipse OpenOCD
Home Page: http://gnuarmeclipse.github.io/openocd/
License: GNU General Public License v2.0
OpenOCD successfully flashes STM32H743xx rev Y silicon, but fails to flash STM32H743xx rev V silicon. From the command line, running:
./src/openocd -s ./tcl -f ./tcl/board/st_nucleo_h743zi.cfg -c "program /path/to/file.elf verify reset exit"
produces the following output when trying to program an STM32H743VIT6-V on a custom PCBA:
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: 1800 kHz
adapter_nsrst_delay: 100
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : clock speed 1800 kHz
Info : STLINK V2J29S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.116230
Info : stm32h7x.cpu: hardware has 8 breakpoints, 4 watchpoints
Info : Listening on port 3333 for gdb connections
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
adapter speed: 4000 kHz
** Programming Started **
auto erase enabled
Info : Device: STM32H7xx 2M
Info : flash size probed value 2048
Info : STM32H flash has dual banks. Bank (0) size is 1024kb, base address is 0x8000000
Error: flash write algorithm aborted by target
Info : error executing stm32h7x flash write algorithm
Error: flash write failed, FLASH_SR = 00050000
Error: error writing to flash at address 0x08000000 at offset 0x00020000
** Programming Failed **
shutdown command invoked
Trying to flash an STM32H743ZIT6U-V on a NUCLEO-H743ZI2 dev board produces similar results. However, flashing an STM32H743ZIT6-Y on a NUCLEO-H743ZI succeeds.
./src/openocd -s ./tcl -f ./tcl/board/st_nucleo_h743zi.cfg -c "program /path/to/file.elf verify reset exit"
Expected behaviour: The binary should be successfully flashed onto the H7 with the following output:
auto erase enabled
Info : Device: STM32H7xx 2M
Info : flash size probed value 2048
Info : STM32H flash has dual banks. Bank (0) size is 1024kb, base address is 0x8000000
wrote 131072 bytes from file /path/to/file.elf in 1.826331s (70.086 KiB/s)
** Programming Finished **
** Verify Started **
verified 14552 bytes in 0.103641s (137.117 KiB/s)
** Verified OK **
** Resetting Target **
shutdown command invoked
Actual behaviour: Flashing fails with the following output:
auto erase enabled
Info : Device: STM32H7xx 2M
Info : flash size probed value 2048
Info : STM32H flash has dual banks. Bank (0) size is 1024kb, base address is 0x8000000
Error: flash write algorithm aborted by target
Info : error executing stm32h7x flash write algorithm
Error: flash write failed, FLASH_SR = 00050000
Error: error writing to flash at address 0x08000000 at offset 0x00020000
** Programming Failed **
shutdown command invoked
The problem appears to be a consequence of the stm32x_write
function in src/flash/nor/stm32h7x.c
not setting the PGx bit in the bank x flash control register prior to calling stm32x_write_block
. Inserting a call to target_write_u32
anywhere before target_run_flash_async_algorithm
to set PGx appears to fix the problem. Based of the existing code structure, this call should be made immediately prior to calling stm32x_write_block
. See theNth@972e7cd for a proposed patch.
When attempting to connect to an F7 nucleo or an H7 nucleo, an invalid-command message is received.
Command in use:
/opt/gnu-mcu-eclipse/openocd/0.10.0-10-20181020-0522/bin/openocd -f board/st_nucleo_h743zi.cfg
Result:
GNU MCU Eclipse 64-bit Open On-Chip Debugger 0.10.0+dev-00352-gaa6c7e9b (2018-10-20-06:18)
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: 1800 kHz
adapter_nsrst_delay: 100
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
/opt/gnu-mcu-eclipse/openocd/0.10.0-10-20181020-0522/bin/..//scripts/target/stm32h7x.cfg:102: Error: invalid command name "stm32h7x.dap"
in procedure 'script'
at file "embedded:startup.tcl", line 60
at file "/opt/gnu-mcu-eclipse/openocd/0.10.0-10-20181020-0522/bin/..//scripts/board/st_nucleo_h743zi.cfg", line 8
at file "/opt/gnu-mcu-eclipse/openocd/0.10.0-10-20181020-0522/bin/..//scripts/target/stm32h7x_dual_bank.cfg", line 2
at file "/opt/gnu-mcu-eclipse/openocd/0.10.0-10-20181020-0522/bin/..//scripts/target/stm32h7x.cfg", line 102
(The F7 attempt was in the office, I don't have that board to hand here.)
OpenOcd support suggests that this is a mis-match between the scripts and the binary.
I have produced my own openocd build from the upstream source, which works for me. However, I do not wish to become a package maintainer, so I am feeding this issue back to you.
Attempting to set this up. openOCD connects just fine, but I get this error when launching the debugger.
Error in services launch sequence
Unhandled exception when executing Sequence org.eclipse.cdt.dsf.gdb.service.command.GDBControl_7_0$1@e24df6, step #0
java.lang.AbstractMethodError
OpenOCD versions tested: 0.9 and 0.10
Eclipse version: Mars
Problem:
Project builds successfully and loads on the chip OK. Initial breakpoint is successful. Attempting to set new breakpoints via source window fail as shown below:
758,755 &"No source file named C:\\\\Development\\\\Workspace\\\\DiscoveryF0\\\\Src\\\\main.c.\n"
758,757 52^done,bkpt={number="5",type="breakpoint",disp="keep",enabled="y",addr="<PENDING>",pending=\
"C:\\\\Development\\\\Workspace\\\\DiscoveryF0\\\\Src\\\\main.c:76",times="0",original-location="C:\\
\\\Development\\\\Workspace\\\\DiscoveryF0\\\\Src\\\\main.c:76"}
758,758 (gdb)
However, setting breakpoints via disassembly window are successful.
617,172 55-break-insert --thread-group i1 -f *0x080001de
617,249 55^done,bkpt={number="7",type="breakpoint",disp="keep",enabled="y",addr="0x080001de",func="S\
ystemClock_Config",file="../Src/main.c",fullname="C:\\Development\\Workspace\\DiscoveryF0\\Debug/../\
Src/main.c",line="105",times="0",original-location="*0x080001de"}
I am working to see if I can resolve this issue myself. However, in doing so I ran into an issue with the build process on ubuntu. The build script failed with references to /Host/Work/....
I've resolved that issue and it looks like I can now build. Would you like the build problem entered as a separate issue here?
We had a similar problem with ARM before which was resolved a few months ago (#18). The similar issue could be reproduced for RISC-V now:
(gdb) target remote | openocd -c "gdb_port pipe" -f openocd/scripts/board/sifive-hifive1.cfg
Remote debugging using | openocd -c "gdb_port pipe" -f openocd/scripts/board/sifive-hifive1.cfg
GNU MCU Eclipse 64-bits Open On-Chip Debugger 0.10.0+dev-00392-gbe9ef0b0 (2018-01-12-16:51)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 10000 kHz
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi_tdo_sample_edge falling"
Info : clock speed 10000 kHz
Info : JTAG tap: riscv.cpu tap/device found: 0x10e31913 (mfg: 0x489 (SiFive, Inc.), part: 0x0e31, ver: 0x1)
Info : [0] Found 2 triggers
halted at 0x204001e2 due to debug interrupt
Info : Examined RISCV core; XLEN=32, misa=0x40001105
Info : Found flash device 'issi is25lp128' (ID 0x0018609d)
cleared protection for sectors 64 through 255 on flash bank 0
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : accepting 'gdb' connection from pipe
Info : dropped 'gdb' connection
Remote connection closed
(gdb)
/cc @palmer-dabbelt
hello, does the openOCD support the cjtag? if not, where can i add the code for it and is it very difficult to do ?
looking forward to your reply.
I ran through the build process on a clean Ubuntu 16.04 64 bit installation.
In case it helps to refine the installation instructions at all I found that the script failed a few times until I installed each of the following in turn:
sudo apt install automake
sudo apt install texinfo
sudo apt install makeinfo
Maybe it's too much trouble to enumerate all required packages for all possible build platforms in which case running the script and installing things on a trial and error basis is probably OK?
Curiously the GCC build script did not complain about these tools being missing and did not install them (otherwise they would still be available now for the openocd script) so I don't know if it uses and installs them in the docker container while the openocd script installs and uses them on the host or something?!
One other thing - at the very end of the build process I got this but I don't know if it's significant?
/Host/Work/openocd/scripts/build-helper.sh: line 743: DEPLOY_FOLDER_NAME: unbound variable
The binaries work great as long as you are using devices with the winusb/libusb driver installed against them; for some devices (such as FTDI devices) you can use Zadig to switch over to the winusb driver, but then anything that is using that FTDI device with the native drivers will no longer work.
It looks like libusb 1.0.21 and later support usbdk, which brings some sanity to the Windows world of USB; with usbdk support, libusb can request that Windows detach the driver so that it can be used with libusb directly, neatly solving the issue.
Is there any possibility of a binary build of openocd linked against libusb 1.0.21+ so we can take advantage of this ability?
Hi,
Not sure if this is the right place, but how do I flash without debugging (using the "Run" option?)
using st-link and stm32f4
Thanks
Dave
I have board without hardware reset and when I accidentaly configure reset_config srst_only
, openocd failes with "double free or corruption".
I can connect with ST-LINK/V2-1 without problem.
(ST-LINK/V2-1 is reported as STLINK v2 JTAG v30 API v2 SWIM v20 VID 0x0483 PID 0x374B
)
After connecting with ST-LINK/V2, OpenOCD fails with backtrace and double free or corruption message.
(ST-LINK/V2 is reported as STLINK v2 JTAG v30 API v2 SWIM v7 VID 0x0483 PID 0x3748
)
I have tried all versions of gnu-mcu-eclipse/openocd and the problem was not in version
v0.10.0-2-20170622-1535-dev
and it first occures in
v0.10.0-3-20170826-1813-dev
all later versions are affected, at least
v0.10.0-7-20180123
v0.10.0-5-20171110
source [find interface/stlink-v2.cfg ]
reset_config srst_only
set CHIPNAME STM32F030xC
set WORKAREASIZE 0x00008000
source [find target/stm32f0x.cfg ]
tcl_port disabled
telnet_port disabled
gdb_port disabled
init
reset halt
sleep 300
flash write_image erase "app.elf"
sleep 300
reset run
sleep 1000
shutdown
Expected behaviour: [What you expected to happen]
Error: timed out while waiting for target halted
TARGET: STM32F030xC.cpu - Not halted
Actual behaviour: [What actually happened]
GNU MCU Eclipse 64-bits Open On-Chip Debugger 0.10.0+dev-00404-g20463c28 (2018-01-23-12:24)
...
Error: timed out while waiting for target halted
Error in `/path_to/bin/openocd': double free or corruption (fasttop): 0x000000000287e2c0
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f05389e97e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f05389f237a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f05389f653c]
/opt/scide/cnd/tools/Linux-x86_64/openocd/0.10.0-7-20180123-1217/bin/openocd[0x5df57f]
platformio/platform-atmelsam#43
http://openocd.zylin.com/gitweb?p=openocd.git;a=commit;h=deaf3d264123391d8fe5c4cccbf8fb8852e1be23
not urgent, but because of the adafruit M4 boards, there is some demand.
Just received my ATMEL SAMC21 XPLAINED PRO, and I immediately tried to play with it: the first thing I noticed is that the OpenOCD version which came with my distribution (Ubuntu 16.04) didn't included the required board script. I lazily ripped it, and tried to flash a blinky demo:
$ openocd -f board/atmel_samc21_xplained_pro.cfg -c "program demo.elf reset exit"
Open On-Chip Debugger 0.9.0 (2015-09-02-10:42)
...
Info : only one transport option; autoselect 'swd'
adapter speed: 500 kHz
adapter_nsrst_delay: 100
cortex_m reset_config sysresetreq
Info : CMSIS-DAP: SWD Supported
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : CMSIS-DAP: FW Version = 02.09.0169
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 500 kHz
Info : SWD IDCODE 0x0bc11477
Info : at91samc21j18.cpu: hardware has 4 breakpoints, 2 watchpoints
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x21000000 pc: 0x00000120 msp: 0x20002448
** Programming Started **
auto erase enabled
Error: Couldn't find part correspoding to DID 11010100
Error: auto_probe failed
** Programming Failed **
shutdown command invoked
Ok, fair enough, SAMC21 support have been added lately: I needed to upgrade OpenOCD to the latest version available.
$ /opt/gnuarmeclipse/openocd/0.10.0-201701241841/bin/openocd -f board/atmel_samc21_xplained_pro.cfg -c "program demo.elf reset exit"
GNU ARM Eclipse 64-bits Open On-Chip Debugger 0.10.0-00113-g0f83948 (2017-01-24-19:18)
...
Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
none separate
adapter speed: 400 kHz
cortex_m reset_config sysresetreq
Error: unable to find CMSIS-DAP device
Error: No Valid JTAG Interface Configured.
OpenOCD 0.9.0 is able to detect the CMSIS-DAP interface, but not the latest version? Running the above command using sudo
didn't fixed it and confirmed that this is not a permission issue along with the following commands:
$ lsusb
...
Bus 003 Device 053: ID 03eb:2111 Atmel Corp.
...
$ ls -l /dev/bus/usb/003/053
crw-rw----+ 1 root plugdev 189, 308 Apr 17 15:59 /dev/bus/usb/003/053
$ id
uid=1000(renaud) gid=1000(renaud) groups=1000(renaud),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),113(lpadmin),127(sambashare)
I'm stuck. I'm willing to help, but I've no idea how.
Minor issue but src/flash/nor/Makefile.am lists fespi.c twice - lines 25 and 27:
https://github.com/gnu-mcu-eclipse/openocd/blob/gnu-mcu-eclipse-dev/src/flash/nor/Makefile.am
Hi @ilg-ul, I've just tried your pre-built version of OCD to get support for STM32F746-DISCO, but getting dynamic linker errors (on OSX 10.8.5). Previously I've been running the "official" OCD 0.9.0 without problems...
/Applications/GNU\ ARM\ Eclipse/OpenOCD/0.10.0-201601101000-dev/bin/openocd -f board/stm32f7discovery.cfg
GNU ARM Eclipse 64-bits Open On-Chip Debugger 0.10.0-dev-00287-g85cec24 (2016-01-10-12:03)
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: 2000 kHz
adapter_nsrst_delay: 100
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : clock speed 1800 kHz
dyld: lazy symbol binding failed: Symbol not found: _OSAtomicIncrement32Barrier
Referenced from: /Applications/GNU ARM Eclipse/OpenOCD/0.10.0-201601101000-dev/bin/libusb-1.0.0.dylib
Expected in: /usr/lib/libSystem.B.dylib
dyld: Symbol not found: _OSAtomicIncrement32Barrier
Referenced from: /Applications/GNU ARM Eclipse/OpenOCD/0.10.0-201601101000-dev/bin/libusb-1.0.0.dylib
Expected in: /usr/lib/libSystem.B.dylib
Trace/BPT trap: 5
Add a new callback in the semihosting structure, to be called before exit()
, to do any cleanups that are necesary for the target.
Working with an STM Nucleo STM32F722 board for debugging with Eclipse and Windows. This board is just available since a few days. I get the following output:
GNU ARM Eclipse 64-bits Open On-Chip Debugger 0.10.0-00113-g0f83948 (2017-01-24-18: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: 2000 kHz
adapter_nsrst_delay: 100
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Started by GNU ARM Eclipse
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : clock speed 1800 kHz
Info : STLINK v2 JTAG v28 API v2 SWIM v18 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 3.247244
Info : stm32f7x.cpu: hardware has 8 breakpoints, 4 watchpoints
Info : accepting 'gdb' connection on tcp/3333
Info : device id = 0x10006452
Warn : Cannot identify target as a STM32 family.
Error: auto_probe failed
Error: Connect failed. Consider setting up a gdb-attach event for the target to prepare target for GDB connect, or use 'gdb_memory_map disable'.
Error: attempted 'gdb' connection rejected
I think I know what needs to be added to src/flash/nor/ stm32f2x.c file. Setting up an complete build environment looks to be a bit complicated. Im working on windows. Is there are someone who has the environment to make an windows 64 bit test build for me with the required updates to the file?
https://github.com/gnuarmeclipse/openocd/blob/gnuarmeclipse-dev/src/flash/nor/stm32f2x.c#L66
* STM32F7[2|3]
* 512 KByte part with 4 x 16, 1 x 64, 3 x 128.
*
https://github.com/gnuarmeclipse/openocd/blob/gnuarmeclipse-dev/src/flash/nor/stm32f2x.c#L895
case 0x452: /* F72x/73x */
max_flash_size_in_kb = 512;
max_sector_size_in_kb = 128;
flash_size_reg = 0x1FF0F442; //not sure for this one, but likely the same as other F7 ???
stm32x_info->has_extra_options = true;
stm32x_info->has_boot_addr = true;
break;
https://github.com/gnuarmeclipse/openocd/blob/gnuarmeclipse-dev/src/flash/nor/stm32f2x.c#L1137
case 0x452:
device_str = "STM32F7[2|3]x";
switch (rev_id) {
case 0x1000:
rev_str = "A";
break;
}
break;
Hi! I did what is described below.
git clone https://github.com/gnu-mcu-eclipse/openocd.git
cd openocd/
./bootstrap
./configure --enable-ulink --enable-jlink --enable-stlink --enable-openjtag
make
I see:
src/flash/nor/psoc5lp.c: В функции «psoc5lp_get_part_number»:
src/flash/nor/psoc5lp.c:237:2: ошибка: «strncpy» output truncated before terminating nul copying 2 bytes from a string of the same length [-Werror=stringop-truncation]
strncpy(str + 8, "xx", 2);
^~~~~~~~~~~~~~~~~~~~~~~~~
cc1: все предупреждения считаются ошибками
make[2]: *** [Makefile:2968: src/flash/nor/psoc5lp.lo] Ошибка 1
GCC version: 8.1.1 20180531
Platform: 4.16.13-1-ARCH
GNU Make 4.2.1
openocd full debug in uboot and kernel
http://fatalfeel.blogspot.tw/2015/12/openocd-with-eclipse-debug-kernel-of.html
Minor issue:
src/target/Makefile.am lists riscv_semihosting.c twice:
Here
https://github.com/gnu-mcu-eclipse/openocd/blob/gnu-mcu-eclipse-dev/src/target/Makefile.am#L144
and here:
https://github.com/gnu-mcu-eclipse/openocd/blob/gnu-mcu-eclipse-dev/src/target/Makefile.am#L147
I'll do a PR for this anon but am in the middle of other stuff so just logging it here so I don't forget it...
Submodule links are broken to repo.or.cz. They are of the form repo.or.cz/r/something.git
, but the actual URLs seem to be repo.or.cz/something.git
Expected behaviour: Submodules are cloned
Actual behaviour: Failure to connect to download them
[~/workspace/openocd]$ git submodule update --init [gnu-mcu-eclipse-dev]
Cloning into '/Users/jakobw/workspace/openocd/jimtcl'...
fatal: unable to access 'http://repo.or.cz/r/jimtcl.git/': Couldn't connect to server
fatal: clone of 'http://repo.or.cz/r/jimtcl.git' into submodule path '/Users/jakobw/workspace/openocd/jimtcl' failed
Failed to clone 'jimtcl'. Retry scheduled
Cloning into '/Users/jakobw/workspace/openocd/src/jtag/drivers/libjaylink'...
fatal: unable to access 'http://repo.or.cz/r/libjaylink.git/': Couldn't connect to server
fatal: clone of 'http://repo.or.cz/r/libjaylink.git' into submodule path '/Users/jakobw/workspace/openocd/src/jtag/drivers/libjaylink' failed
Failed to clone 'src/jtag/drivers/libjaylink'. Retry scheduled
Cloning into '/Users/jakobw/workspace/openocd/tools/git2cl'...
fatal: unable to access 'http://repo.or.cz/r/git2cl.git/': Couldn't connect to server
fatal: clone of 'http://repo.or.cz/r/git2cl.git' into submodule path '/Users/jakobw/workspace/openocd/tools/git2cl' failed
Failed to clone 'tools/git2cl'. Retry scheduled
Cloning into '/Users/jakobw/workspace/openocd/jimtcl'...
fatal: unable to access 'http://repo.or.cz/r/jimtcl.git/': Couldn't connect to server
fatal: clone of 'http://repo.or.cz/r/jimtcl.git' into submodule path '/Users/jakobw/workspace/openocd/jimtcl' failed
Failed to clone 'jimtcl' a second time, aborting
I am trying to install https://github.com/gnuarmeclipse/openocd/releases/download/gae-0.9.0-20150519/gnuarmeclipse-openocd-win64-0.9.0-201505190955-setup.exe from command line. I am successfully able to install silently with /S option but failed to install to different folder than default. The silent installations always installing openocd at "C:\Program Files\GNU ARM Eclipse\OpenOCD". Kindly let me know how install to different folder than default one.
Following are the commands i used to install openocd at "L:\openocd":
C:>"C:\Users\rkandur\Downloads\gnuarmeclipse-openocd-win64-0.9.0-201505190955-setup.exe" /S /D=l:\openocd
Hi @ilg-ul,
I don't know where is better to post this issue, would be thankful for a help. I can't reproduce this issue with 20170607-2132-dev
but with v0.10.0-2-20170622-1535
I can.
Just pipe OpenOCD to GDB:
(gdb) target remote | openocd -c "gdb_port pipe" ...
...
undefined debug reason 7 - target needs reset
Remote failure reply: E0E
On Windows OpenOCD does fail after establishing a connection with this message:
Error: fdopen: failed to open read stream
import socket
import sys
import time
PORT = 3335
srv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
srv.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
srv.bind(('127.0.0.1', PORT))
srv.listen(1)
sys.stderr.write('Waiting for connection on {}...\n'.format(PORT))
client_socket, addr = srv.accept()
sys.stderr.write('Connected by {}\n'.format(addr))
while True:
data = client_socket.recv(1024)
if data:
print(data)
interface remote_bitbang
remote_bitbang_port 3335
remote_bitbang_host 127.0.0.1
set WORKAREASIZE 0x8000
set CHIPNAME lm4f120h5qr
source [find target/stellaris.cfg]
reset_config srst_only
Save that in a file and execute it like this: "path/to/openocd.exe -f /path/to/configfile.cfg"
Expected behaviour:
It should connect and then will spit out the command from OpenOCD, in this case this:
b'BrbBbB262626262626262bB2626260426040401R'
Actual behaviour:
It connects and then quits with this error:
Error: fdopen: failed to open read stream
When running OpenOCD on a Linux Host then it connects successfully, even no matter if the other part is running on Windows or Linux.
I use arduino+microbit1+microbit2 to complete this experiment
How do openocd choose multiple cmsis-dap devices?
Via cmsis_dap_serial?
How to get cmsis_dap_serial?
I copied the cmsis_dap_serial of the current connection cmsis-dap from the keil debugging interface, but when the program is burned, I can't find the cmsis-dap device.
Hi, I am trying to debug PIxhawk firmware in Nucleo(STM32f411RE) board through openOCD in Eclipse.
I am using latest openOCD(0.10.0-201704182147), The project is built comfortably but having an issue while debugging it.
It always throughs an error -
Failed to execute MI command: ~/build_directory/src/firmware/nuttx/firmware_nuttx.
I didn't get the error while debugging it through command line.
Please suggest any solution.
Again not a major issue but a small annoying build issue.
I realise that you build using Docker but I am building on MinGW-64/MSYS2 using the i686 (32 bit environment) as follows:
git clone --recursive https://github.com/gnu-mcu-eclipse/openocd openocd-gme
cd openocd-gme
./bootstrap
./configure --prefix=`pwd`/openocd
make
However the build fails due to warnings (treated as errors by default) in the RISC-V target support:
In file included from ./config.h:340:0,
from src/target/riscv/riscv-011.c:11:
src/target/riscv/riscv-011.c: In function 'read_memory':
./src/helper/replacements.h:30:25: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
^
src/target/riscv/riscv-011.c:2303:29: note: in expansion of macro 'MIN'
unsigned int batch_size = MIN(count + 3 - i, max_batch_size);
^
./src/helper/replacements.h:30:38: error: signed and unsigned type in conditional expression [-Werror=sign-compare]
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
^
src/target/riscv/riscv-011.c:2303:29: note: in expansion of macro 'MIN'
unsigned int batch_size = MIN(count + 3 - i, max_batch_size);
^
src/target/riscv/riscv-011.c: In function 'write_memory':
./src/helper/replacements.h:30:25: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
^
src/target/riscv/riscv-011.c:2464:29: note: in expansion of macro 'MIN'
unsigned int batch_size = MIN(count + 2 - i, max_batch_size);
^
./src/helper/replacements.h:30:38: error: signed and unsigned type in conditional expression [-Werror=sign-compare]
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
^
src/target/riscv/riscv-011.c:2464:29: note: in expansion of macro 'MIN'
unsigned int batch_size = MIN(count + 2 - i, max_batch_size);
^
cc1.exe: all warnings being treated as errors
make[2]: *** [Makefile:2900: src/target/riscv/riscv-011.lo] Error 1
make[2]: Leaving directory '/home/Tommy.Murphy/dev/openocd/test/openocd-gme'
make[1]: *** [Makefile:3797: all-recursive] Error 1
make[1]: Leaving directory '/home/Tommy.Murphy/dev/openocd/test/openocd-gme'
make: *** [Makefile:1630: all] Error 2
To build successfully I have to specify --disable-werror:
./configure --prefix=`pwd`/openocd --disable-werror [--enable-riscv]
Note that building the official OpenOCD 0.10.0+dev sources without specifying --disable-werror at configuration time works fine:
git clone --recursive https://git.code.sf.net/p/openocd/code openocd-official
cd openocd-official
./bootstrap
./configure --prefix=`pwd`/openocd
make
make install
BTW - I'm not sure if it's another (small) issue that the RISC-V target support files (and fespi.c etc.) get compiled even if --disable-riscv is not specified? I don't know if the openocd build process normally does selective compilation based on the flags specified?
When I try to connect via the command:
sudo ./openocd -f board/stm32f4discovery.cfg
I get the following output:
http://pastebin.com/dcPBQ52Q
I have googled and cannot find an answer. I have the 49-stlinkv2.rules, 99-openocd.rules, and stlink.conf in my /etc/udev/rules.d folder. I have the most recent firmware on my board from here:
http://www.st.com/content/st_com/en/products/embedded-software/development-tool-software/stsw-link004.html
Do you know what's going wrong?
I'm trying to JTAG BBB using J-Link adapter and I end up facing the following error:
GNU MCU Eclipse 64-bit Open On-Chip Debugger 0.10.0+dev-00352-gaa6c7e9b (2018-10-20-
06:18)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 800 kHz
trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain connect_deassert_srst
Info : auto-selecting first available session transport "jtag". To override use 'transport select
<transport>'.
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : J-Link ARM V8 compiled Nov 28 2014 13:44:46
Info : Hardware version: 8.00
Info : VTarget = 3.410 V
Info : clock speed 800 kHz
Info : JTAG tap: am335x.jrc tap/device found: 0x2b94402f (mfg: 0x017 (Texas Instruments), part:
0xb944, ver: 0x2)
Info : JTAG tap: auto0.tap tap/device found: 0xffffffff (mfg: 0x7ff (<invalid>), part: 0xffff, ver: 0xf)
Error: auto0.tap: IR capture error; saw 0x0003 not 0x0001
Warn : Bypassing JTAG setup events due to errors
Info : Listening on port 3333 for gdb connections
Info : Listening on port 3334 for gdb connections
I'm unable to halt the processor after opening up a telent session nor able to do anything else.
After openeing a telenet session.
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Open On-Chip Debugger
> halt
Target not examined yet
Where am I going wrong?
I followed installation manual on Ubuntu 15.10 and met an issue:
libusb_open failed: LIBUSB_ERROR_ACCESS
No error was with sudo
. The solution is to add user to plugdev
group.
sudo usermod -aG plugdev $USER
Than relogin or restart. FIXED.
Hi Liviu - small issue with the readme.md here - the "How to build" link is broken.
I guess that http://gnuarmeclipse.github.io/openocd/how-to-build should be (or should redirect to?) https://gnu-mcu-eclipse.github.io/openocd/build-procedure/.
Also should the "Eclipse plug-in" text be a link to https://gnu-mcu-eclipse.github.io/debug/openocd/ ?
Regards
Tommy
As title says, I can detect my STM32F401-Nucleo board with st-utils
from stlink, but can't connect board with openocd.
I don't know whether I need to config others or not.
1.Setup stlink v2, and I can detect my STM32F401-Nucleo as below:
➜ bin st-util
2016-03-05T22:20:04 INFO src/stlink-common.c: Loading device parameters....
2016-03-05T22:20:04 INFO src/stlink-common.c: Device connected is: F4 device (Dynamic Efficency), id 0x10006433
2016-03-05T22:20:04 INFO src/stlink-common.c: SRAM size: 0x18000 bytes (96 KiB), Flash: 0x80000 bytes (512 KiB) in pages of 16384 bytes
2016-03-05T22:20:04 INFO gdbserver/gdb-server.c: Chip ID is 00000433, Core ID is 2ba01477.
2016-03-05T22:20:04 INFO gdbserver/gdb-server.c: Target voltage is 3265 mV.
2016-03-05T22:20:04 INFO gdbserver/gdb-server.c: Listening at *:4242...
2.but I can't connect my board with openocd, error is below:
➜ bin pwd
/Applications/GNU ARM Eclipse/OpenOCD/0.10.0-201601101000-dev/bin
➜ bin ./openocd -f board/stm32f4discovery.cfg
GNU ARM Eclipse 64-bits Open On-Chip Debugger 0.10.0-dev-00287-g85cec24 (2016-01-10-12:03)
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: 2000 kHz
adapter_nsrst_delay: 100
none separate
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : clock speed 1800 kHz
Error: open failed
in procedure 'init'
in procedure 'ocd_bouncer'
➜ bin
my Dev-environment is:
Board : STM32F401RE Nucleo
OS X EI Caption : 10.11 (15A284)
iTerm2 : Build 2.1.4
OpenOCD : 0.10.0-201601101000-dev
ST-Link V2 : https://github.com/texane/stlink
Hi,
I've just downloaded the latest release 0.10.0-9-20181016-1725
for macOS. However, inside all files are dated by July 24, 2018. Is this OK?
Also, I see that new version does not understand double braces program {{$SOURCE}}
.
Thanks!
Caution!!!!
uninstaller removes entire directory in V0.10~ on windows install.
Please use this tracker to record any issues related only to the GNU MCU Eclipse OpenOCD application itself. Please DO NOT record here any other issues (including issues related to the GNU MCU Eclipse OpenOCD plug-ins, which should be addressed to the gnu-mcu-eclipse/eclipse-plugins tracker).
For general questions and requests for help that cannot be classified as bug reports or requests for enhancements, please use the GNU MCU Eclipse forum.
When entering a new issue, please be sure you provide:
Please understand that without being able to reproduce the bug we cannot identify your problem.
To enter new issues, you need to first login to GitHub.
Note: the text should respect the markdown syntax; preview the message before posting and correct if it does not look as you expected, especially inline code or other quoted text.
Dear all,
I'm working with the STM32F401RE board in the semihosting mode, However was impossible to execute system call's related with the command processor (shell(LINUX) or the command line(WINDOWS)) such as "dir, ls -l", I suppose that it is because Openocd doesn't support such kind of SYSTEM_CALLS.
If my affirmation is correct, I'm Interesting in implementing such functionalities, could you bring me some support or ideas of how I can complete that task, please.
I will appreciate your help so much.
bye
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.