hello,
I am attempting to get the GDB debugger to work with Lazarus.
I made a debug probe using a Raspberry PI and OpenOcd. The installation of the software went very well (several cups of coffee required!) with few snags. I also got the Ocd config file to work for this particular controller (STM32F103C8T6)
I connected the Pi to a STM32 blue pill card via the probe connector and a lashup of 4 wires, and arranged the PI (powered by USB) to supply 3.3v power to the STM32.
I was able to load and run the Blinky.bin program using a telnet link from my PC to the headless Pi using WiFi on my network.
I then ran the GDB debugger (arm-embedded-gdb.exe) supplied from the MBR package from git which I used previously. I was able to use this to connect to the GDB server on the PI and run the program using remote "Monitor" commands as follows:
C:\Windows\System32>C:\fpcupdeluxe-mbf\fpc\bin\x86_64-win64\arm-embedded-gdb.exe
C:\fpcupdeluxe-mbf\fpc\bin\x86_64-win64\gdbtest.exe: warning: Couldn't determine a path for the index cache directory.
GNU gdb (GDB) 10.1
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=x86_64-w64-mingw32 --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) target remote 192.168.1.201:3333
Remote debugging using 192.168.1.201:3333
warning: No executable has been specified and target does not support
determining executable automatically. Try using the "file" command.
0x0800118a in ?? ()
(gdb) monitor program /home/pi/fileserver/temp/Blinky.bin 0x8000000
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000e9c msp: 0x20005000
** Programming Started **
** Programming Finished **
(gdb) monitor reset
(gdb) monitor halt
target halted due to debug-request, current mode: Thread
xPSR: 0x81000000 pc: 0x0800118a msp: 0x20004f8c
(gdb)
I set up the debugger options in Lazarus to use the remote debugger. When I run the program from Lazarus, I get the following error and it shuts down.
warning: Couldn't determine a path for the index cache directory
Any ideas on how to proceed ?
Also (assuming it will work) will Lazarus load the program from PC to PI automatically, or do I have to load the program from the PI side before starting ?
ps - a working openocd.cfg file for a PI zero w......
source [find interface/raspberrypi-native.cfg]
transport select swd
set CHIPNAME stm32f103c8t6
source [find target/stm32f1x.cfg]
# did not yet manage to make a working setup using srst
#reset_config srst_only
reset_config srst_nogate
adapter srst delay 100
adapter srst pulse_width 100
bcm2835gpio_swd_nums 25 24
bcm2835gpio_trst_num 7
bcm2835gpio_srst_num 18
bindto 0.0.0.0
init
targets
reset halt