From: Paul F. <fer...@gm...> - 2025-07-17 07:52:46
|
On Thu, Jul 17, 2025 at 12:28:16PM +0800, Zixian Zeng wrote: > On Wed, Jul 16, 2025 at 11:42:06AM +0300, Paul Fertser wrote: > > On Wed, Jul 16, 2025 at 01:01:37PM +0800, Zixian Zeng wrote: > > > I like using OpenOCD and GDB to debug programs on STM32. On STM32 I just > > > need to do > > > > openocd -f board/stm32f3discovery.cfg > > > > arm-none-eabi-gdb <executable> #in other terminal > > > And using `tar ext :3333` > > > > Good to hear you like it and it's easy with STM32F3, your commands are > > correct. BTW, you can use gdb-multiarch (or just gdb on Fedora) from > > your distro repository, no need for a special arm-none-eabi version. > > > Thanks for your suggestion, but I use Gentoo as Linux distribution, > which doesn't have gdb-multiarch package. :-( But it has "multitarget" USE flag for GDB ebuild. > > > I found board/ti_mspm0_launchpad.cfg in mainline repo, and using the > > > latest openocd right away. I can connect to the board and program it. > > > But I can not debug it > > > > What exactly "can not debug" implies? You can see full interaction > > between GDB and OpenOCD if you do "set debug remote 1" before running > > "target" command. > > > I try enable the debug information and dump the log to: > https://nopaste.net/sDiGiAeWyS Are you sure there's anything inside that while (1) loop you're trying to step through? Please look through the disassembly. Also try going instruction by instruction with "stepi". > > > and nothing happens when I reset board through GDB "monitor > > > mspm0_board_reset" command. > > > > That is a special command to simulate power on reset it seems. Why > > exactly are you trying to use it, what you expect and what actually > > happens? > > > > Simply I want to reset the board and let it execute the first > instruction. Then it would be "mon reset halt" and then "si". > I also try using "monitor reset [halt]" but nothing > happens. It can not be nothing, and it's not there in your log. Monitor commands is something GDB doesn't track, they're just passed through, so if you something like "mon reset halt" and you want to see the result in GDB you need to do "mon gdb_sync" and then "si" to let GDB sync. BTW, "reset" without argument is "reset run" so a different command, it doesn't even try to halt. > So I doubt that I can not use GDB debugging programs compiled by > "tiarmclang". Or can I use GNU toolchain to develop MSPM0G3507-LaunchPad ? GDB seem to be picking up debugging info from your ELF file properly, at least your current log doesn't show anything obviously wrong about it. -- Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software! mailto:fer...@gm... |