Debugging STM32F769i-disco using openocd and gdb in Linux
Hello ST,
I'm trying to launch a debug session for STM32f769i-disco using openocd and gdb in linux. I've install openocd(0.10.0), gdb and gdb-multiarch tools in linux.
This is the below log after launching openocd with my board's config file.
openocd -f /usr/share/openocd/scripts/board/stm32f769i-disco.cfg
Open On-Chip Debugger 0.10.0
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
Info : STLINK v2 JTAG v37 API v2 SWIM v26 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 3.259299
Info : stm32f7x.cpu: hardware has 8 breakpoints, 4 watchpointsAfter this, I launched gdb-multiarch and ran the below command to connect to openocd server. But it failed as below.
(gdb) target remote localhost:3333
Remote debugging using localhost:3333
warning: Architecture rejected target-supplied description
warning: No executable has been specified and target does not support
determining executable automatically. Try using the "file" command.
Truncated register 16 in remote 'g' packet
(gdb)After this the below log showed up in the openocd terminal window in continuation to the above openocd log.
Info : accepting 'gdb' connection on tcp/3333
Info : device id = 0x10006451
Info : flash size = 2048kbytes
Info : Single Bank 2048 kiB STM32F76x/77x found
undefined debug reason 7 - target needs reset
Info : dropped 'gdb' connectionI think this is an issue with the stm32f769i-disco.cfg file.
The original openocd installation directory has stm32f7.cfg file only. I tried using that file but it didn't work. Moreover, the file mentioned it's only for STM32F756NGH6 which is not what I have. So I used stm32f769i-disco.cfg file.
Note that this file IS NOT available with the default openocd installation in Ubuntu. I've downloaded this file from the below location and copied it into /usr/share/openocd/scripts.
https://github.com/ntfreak/openocd/blob/master/tcl/board/stm32f769i-disco.cfg
I had to update the below line to get it working as stlink.cfg is not available with default openocd installation.
source [find interface/stlink.cfg]
to
source [find interface/stlink-v2-1.cfg]Openocd session was launched using
openocd -f /usr/share/openocd/scripts/board/stm32f769i-disco.cfgWhen I point openocd to use all the files from the above github repository, I get these errors.
openocd -s /home/dheeraj/Downloads/OPNOCD/tcl -f /home/dheeraj/Downloads/OPNOCD/tcl/board/stm32f769i-disco.cfg
Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
/home/dheeraj/Downloads/OPNOCD/tcl/interface/stlink.cfg:6: Error: invalid command name "adapter"
in procedure 'script'
at file "embedded:startup.tcl", line 60
at file "/home/dheeraj/Downloads/OPNOCD/tcl/board/stm32f769i-disco.cfg", line 5
at file "/home/dheeraj/Downloads/OPNOCD/tcl/interface/stlink.cfg", line 6Probably an issue with stlink.cfg file in that git repo.
Can someone from ST team point me to the correct cfg files for this board? My goal is to launch a debug session using GDB CLI.
Thanks
Dheeraj
