Sysprogs forums › Forums › VisualGDB › Debugger setup for Black Magic Probe?
- This topic has 23 replies, 6 voices, and was last updated 23 hours, 53 minutes ago by
support.
-
AuthorPosts
-
July 15, 2025 at 00:41 #36807
julieninnovel
ParticipantHi,
Sorry for my late answer, I was very busy…
So, I’ve done a new try, and it’s the same. The target seems to be not loaded with my binary file before running the application.
So it’s steel not working…
Has you can see on my previous post, on the GDB log output, there is no load action.
If I do it manually with a command line tool, it’s working fine (see in attached file an extract of my mannualy command lines)
Thanks for your help.
PS :
I’m using the VisualGDB version 6.0R8 (build 5338)
ARM Toolchain 14.2.1/15.2/r2
Attachments:
You must be logged in to view attached files.July 15, 2025 at 07:48 #36809support
KeymasterIt looks like your technical support period has expired. We would be happy to help you, however we would kindly ask you to renew your technical support on the following page first: https://sysprogs.com/splm/mykey
July 16, 2025 at 01:29 #36810julieninnovel
ParticipantHi, sorry for this, the renew just be done ! Thanks
July 19, 2025 at 20:23 #36820support
KeymasterThanks for renewing your support. Based on the last screenshots you provided, you have left the “target selection command” in VisualGDB Project Properties -> Debug Settings empty, so it confuses VisualGDB’s logic for detecting whether the target is running.
The target selection command should be “target extended-remote blackmagic.local:2345“. Commands like “set mem …” should go to “Additional GDB Commands -> commands before selecting a target” and commands like “mon swp_scan”, “load”, etc should go to “commands after selecting a target”.
August 12, 2025 at 06:14 #36834julieninnovel
ParticipantHi,
Thanks for your answer. I’ve done all parameter like you sayed (I’ve juste changed to use the blackmagick probe COM port instead of TCP).
I’ve attached some screens shots of the configuration and the error displayed when I programm without debug.
I’ve also attached 2 screens shots of the manual prog done using GDB on a windows command tool.
Thanks
Here is the GDB Session log :
c:\sysgcc\arm-eabi\bin\arm-none-eabi-gdb.exe –interpreter mi E:\MesDocuments\Code_source\BlackMagicProbe\Sensor\VisualGDB\Sensor_App\Debug\Sensor_App
c:\sysgcc\arm-eabi\bin\arm-none-eabi-gdb.exe –interpreter mi E:\MesDocuments\Code_source\BlackMagicProbe\Sensor\VisualGDB\Sensor_App\Debug\Sensor_App
-gdb-version
-gdb-version
=thread-group-added,id=”i1″
=thread-group-added,id=”i1″
=thread-group-added,id=”i1″
~”GNU gdb (GDB) 15.2\n”
~”GNU gdb (GDB) 15.2\n”
~”GNU gdb (GDB) 15.2\n”
~”Copyright (C) 2024 Free Software Foundation, Inc.\n”
~”Copyright (C) 2024 Free Software Foundation, Inc.\n”
~”Copyright (C) 2024 Free Software Foundation, Inc.\n”
~”License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.”
~”License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.”
~”License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.”
~”\nType \”show copying\” and \”show warranty\” for details.\n”
~”\nType \”show copying\” and \”show warranty\” for details.\n”
~”\nType \”show copying\” and \”show warranty\” for details.\n”
~”This GDB was configured as \”–host=i686-w64-mingw32 –target=arm-none-eabi\”.\n”
~”This GDB was configured as \”–host=i686-w64-mingw32 –target=arm-none-eabi\”.\n”
~”This GDB was configured as \”–host=i686-w64-mingw32 –target=arm-none-eabi\”.\n”
~”Type \”show configuration\” for configuration details.\n”
~”Type \”show configuration\” for configuration details.\n”
~”Type \”show configuration\” for configuration details.\n”
~”For bug reporting instructions, please see:\n”
~”For bug reporting instructions, please see:\n”
~”For bug reporting instructions, please see:\n”
~”<https://www.gnu.org/software/gdb/bugs/>.\n”
~”<https://www.gnu.org/software/gdb/bugs/>.\n”
~”<https://www.gnu.org/software/gdb/bugs/>.\n”
~”Find the GDB manual and other documentation resources online at:\n <”
~”Find the GDB manual and other documentation resources online at:\n <”
~”Find the GDB manual and other documentation resources online at:\n <”
~”http://www.gnu.org/software/gdb/documentation/>.\n\n”
~”http://www.gnu.org/software/gdb/documentation/>.\n\n”
~”http://www.gnu.org/software/gdb/documentation/>.\n\n”
~”For help, type \”help\”.\n”
~”For help, type \”help\”.\n”
~”For help, type \”help\”.\n”
~”Type \”apropos word\” to search for commands related to \”word\”…\n”
~”Type \”apropos word\” to search for commands related to \”word\”…\n”
~”Type \”apropos word\” to search for commands related to \”word\”…\n”
~”Reading symbols from E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\VisualGDB\\Sensor_App\\Debug\\Sensor_App…\n”
~”Reading symbols from E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\VisualGDB\\Sensor_App\\Debug\\Sensor_App…\n”
~”Reading symbols from E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\VisualGDB\\Sensor_App\\Debug\\Sensor_App…\n”
(gdb)
~”GNU gdb (GDB) 15.2\n”
~”GNU gdb (GDB) 15.2\n”
~”GNU gdb (GDB) 15.2\n”
~”Copyright (C) 2024 Free Software Foundation, Inc.\n”
~”Copyright (C) 2024 Free Software Foundation, Inc.\n”
~”Copyright (C) 2024 Free Software Foundation, Inc.\n”
~”License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.”
~”License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.”
~”License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.”
~”\nType \”show copying\” and \”show warranty\” for details.\n”
~”\nType \”show copying\” and \”show warranty\” for details.\n”
~”\nType \”show copying\” and \”show warranty\” for details.\n”
~”This GDB was configured as \”–host=i686-w64-mingw32 –target=arm-none-eabi\”.\n”
~”This GDB was configured as \”–host=i686-w64-mingw32 –target=arm-none-eabi\”.\n”
~”This GDB was configured as \”–host=i686-w64-mingw32 –target=arm-none-eabi\”.\n”
~”Type \”show configuration\” for configuration details.\n”
~”Type \”show configuration\” for configuration details.\n”
~”Type \”show configuration\” for configuration details.\n”
~”For bug reporting instructions, please see:\n”
~”For bug reporting instructions, please see:\n”
~”For bug reporting instructions, please see:\n”
~”<https://www.gnu.org/software/gdb/bugs/>.\n”
~”<https://www.gnu.org/software/gdb/bugs/>.\n”
~”<https://www.gnu.org/software/gdb/bugs/>.\n”
~”Find the GDB manual and other documentation resources online at:\n <”
~”Find the GDB manual and other documentation resources online at:\n <”
~”Find the GDB manual and other documentation resources online at:\n <”
~”http://www.gnu.org/software/gdb/documentation/>.\n\n”
~”http://www.gnu.org/software/gdb/documentation/>.\n\n”
~”http://www.gnu.org/software/gdb/documentation/>.\n\n”
~”For help, type \”help\”.\n”
~”For help, type \”help\”.\n”
~”For help, type \”help\”.\n”
~”Type \”apropos word\” to search for commands related to \”word\”.\n”
~”Type \”apropos word\” to search for commands related to \”word\”.\n”
~”Type \”apropos word\” to search for commands related to \”word\”.\n”
^done
^done
^done
(gdb)
-list-features
-list-features
^done,features=[“frozen-varobjs”,”pending-breakpoints”,”thread-info”,”data-read-memory-bytes”,”breakpoint-notifications”,”ada-task-info”,”language-option”,”info-gdb-mi-command”,”undefined-command-error-code”,”exec-run-start-option”,”data-disassemble-a-option”,”simple-values-ref-types”]
^done,features=[“frozen-varobjs”,”pending-breakpoints”,”thread-info”,”data-read-memory-bytes”,”breakpoint-notifications”,”ada-task-info”,”language-option”,”info-gdb-mi-command”,”undefined-command-error-code”,”exec-run-start-option”,”data-disassemble-a-option”,”simple-values-ref-types”]
^done,features=[“frozen-varobjs”,”pending-breakpoints”,”thread-info”,”data-read-memory-bytes”,”breakpoint-notifications”,”ada-task-info”,”language-option”,”info-gdb-mi-command”,”undefined-command-error-code”,”exec-run-start-option”,”data-disassemble-a-option”,”simple-values-ref-types”]
(gdb)
-gdb-set verbose on
-gdb-set verbose on
^done
^done
^done
(gdb)
-gdb-set filename-display absolute
-gdb-set filename-display absolute
^done
^done
^done
(gdb)
-gdb-set disassembly-flavor intel
-gdb-set disassembly-flavor intel
&”warning: could not convert ‘disassembly’ from the host encoding (CP1252) to UTF-32.\nThis normally should not happen, please file a bug report.”
&”warning: could not convert ‘disassembly’ from the host encoding (CP1252) to UTF-32.\nThis normally should not happen, please file a bug report.”
&”warning: could not convert ‘disassembly’ from the host encoding (CP1252) to UTF-32.\nThis normally should not happen, please file a bug report.”
&”\n”
&”\n”
&”\n”
^error,msg=”No symbol \”disassembly\” in current context.”
^error,msg=”No symbol \”disassembly\” in current context.”
^error,msg=”No symbol \”disassembly\” in current context.”
(gdb)
-gdb-set print demangle off
-gdb-set print demangle off
^done
^done
^done
(gdb)
set mem inaccessible-by-default off
set mem inaccessible-by-default off
&”set mem inaccessible-by-default off\n”
&”set mem inaccessible-by-default off\n”
&”set mem inaccessible-by-default off\n”
=cmd-param-changed,param=”mem inaccessible-by-default”,value=”off”
=cmd-param-changed,param=”mem inaccessible-by-default”,value=”off”
=cmd-param-changed,param=”mem inaccessible-by-default”,value=”off”
^done
^done
^done
(gdb)
target extended-remote \\.\COM20
target extended-remote \\.\COM20
&”target extended-remote \\\\.\\COM20\n”
&”target extended-remote \\\\.\\COM20\n”
&”target extended-remote \\\\.\\COM20\n”
~”Remote debugging using \\\\.\\COM20\n”
~”Remote debugging using \\\\.\\COM20\n”
~”Remote debugging using \\\\.\\COM20\n”
=thread-group-started,id=”i1″,pid=”42000″
=thread-group-started,id=”i1″,pid=”42000″
=thread-group-started,id=”i1″,pid=”42000″
=thread-created,id=”1″,group-id=”i1″
=thread-created,id=”1″,group-id=”i1″
=thread-created,id=”1″,group-id=”i1″
&”warning: platform-specific solib_create_inferior_hook did not load initial shared libraries.\n”
&”warning: platform-specific solib_create_inferior_hook did not load initial shared libraries.\n”
&”warning: platform-specific solib_create_inferior_hook did not load initial shared libraries.\n”
~”0x08005eac in HAL_PWREx_ControlVoltageScaling (VoltageScaling=536873732) at E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\Sensor_App\\Drivers\\STM32G0xx_HAL_Driver\\Src\\stm32g0xx_hal_pwr_ex.c:772\n”
~”0x08005eac in HAL_PWREx_ControlVoltageScaling (VoltageScaling=536873732) at E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\Sensor_App\\Drivers\\STM32G0xx_HAL_Driver\\Src\\stm32g0xx_hal_pwr_ex.c:772\n”
~”0x08005eac in HAL_PWREx_ControlVoltageScaling (VoltageScaling=536873732) at E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\Sensor_App\\Drivers\\STM32G0xx_HAL_Driver\\Src\\stm32g0xx_hal_pwr_ex.c:772\n”
~”772\t if (VoltageScaling == PWR_REGULATOR_VOLTAGE_SCALE1)\n”
~”772\t if (VoltageScaling == PWR_REGULATOR_VOLTAGE_SCALE1)\n”
~”772\t if (VoltageScaling == PWR_REGULATOR_VOLTAGE_SCALE1)\n”
*stopped,frame={addr=”0x08005eac”,func=”HAL_PWREx_ControlVoltageScaling”,args=[{name=”VoltageScaling”,value=”536873732″}],file=”E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\Sensor_App\\Drivers\\STM32G0xx_HAL_Driver\\Src\\stm32g0xx_hal_pwr_ex.c”,fullname=”E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\Sensor_App\\Drivers\\STM32G0xx_HAL_Driver\\Src\\stm32g0xx_hal_pwr_ex.c”,line=”772″,arch=”armv6s-m”},thread-id=”1″,stopped-threads=”all”
*stopped,frame={addr=”0x08005eac”,func=”HAL_PWREx_ControlVoltageScaling”,args=[{name=”VoltageScaling”,value=”536873732″}],file=”E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\Sensor_App\\Drivers\\STM32G0xx_HAL_Driver\\Src\\stm32g0xx_hal_pwr_ex.c”,fullname=”E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\Sensor_App\\Drivers\\STM32G0xx_HAL_Driver\\Src\\stm32g0xx_hal_pwr_ex.c”,line=”772″,arch=”armv6s-m”},thread-id=”1″,stopped-threads=”all”
*stopped,frame={addr=”0x08005eac”,func=”HAL_PWREx_ControlVoltageScaling”,args=[{name=”VoltageScaling”,value=”536873732″}],file=”E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\Sensor_App\\Drivers\\STM32G0xx_HAL_Driver\\Src\\stm32g0xx_hal_pwr_ex.c”,fullname=”E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\Sensor_App\\Drivers\\STM32G0xx_HAL_Driver\\Src\\stm32g0xx_hal_pwr_ex.c”,line=”772″,arch=”armv6s-m”},thread-id=”1″,stopped-threads=”all”
^done
^done
^done
(gdb)
mon swdp_scan
mon swdp_scan
&”mon swdp_scan\n”
&”mon swdp_scan\n”
&”mon swdp_scan\n”
@”You are now detached from the previous target.\n”
@”You are now detached from the previous target.\n”
@”You are now detached from the previous target.\n”
@”Available Targets:\n”
@”Available Targets:\n”
@”Available Targets:\n”
@”No. Att Driver\n”
@”No. Att Driver\n”
@”No. Att Driver\n”
@” 1 STM32G03/4 M0+\n”
@” 1 STM32G03/4 M0+\n”
@” 1 STM32G03/4 M0+\n”
^done
^done
^done
(gdb)
info shared
info shared
&”info shared\n”
&”info shared\n”
&”info shared\n”
~”No shared libraries loaded at this time.\n”
~”No shared libraries loaded at this time.\n”
~”No shared libraries loaded at this time.\n”
^done
^done
^done
(gdb)
attach 1
attach 1
&”attach 1\n”
&”attach 1\n”
&”attach 1\n”
~”A program is being debugged already. Kill it? (y or n) [answered Y; input not from terminal]\n”
~”A program is being debugged already. Kill it? (y or n) [answered Y; input not from terminal]\n”
~”A program is being debugged already. Kill it? (y or n) [answered Y; input not from terminal]\n”
=thread-exited,id=”1″,group-id=”i1″
=thread-exited,id=”1″,group-id=”i1″
=thread-exited,id=”1″,group-id=”i1″
=thread-group-exited,id=”i1″
=thread-group-exited,id=”i1″
=thread-group-exited,id=”i1″
~”Attaching to program: E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\VisualGDB\\Sensor_App\\Debug\\Sensor_App, Remote target\n”
~”Attaching to program: E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\VisualGDB\\Sensor_App\\Debug\\Sensor_App, Remote target\n”
~”Attaching to program: E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\VisualGDB\\Sensor_App\\Debug\\Sensor_App, Remote target\n”
=thread-group-started,id=”i1″,pid=”1″
=thread-group-started,id=”i1″,pid=”1″
=thread-group-started,id=”i1″,pid=”1″
=thread-created,id=”1″,group-id=”i1″
=thread-created,id=”1″,group-id=”i1″
=thread-created,id=”1″,group-id=”i1″
*running,thread-id=”1″
*running,thread-id=”1″
*running,thread-id=”1″
^done
^done
^done
&”warning: platform-specific solib_create_inferior_hook did not load initial shared libraries.\n”
&”warning: platform-specific solib_create_inferior_hook did not load initial shared libraries.\n”
&”warning: platform-specific solib_create_inferior_hook did not load initial shared libraries.\n”
~”0x08001fdc in SetFilterAdc (pu16_AdcDataTab=0x200009ac <au16_AdcReadTab+8>) at E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\Sensor_App\\Core\\Src\\adc.c:558\n”
~”0x08001fdc in SetFilterAdc (pu16_AdcDataTab=0x200009ac <au16_AdcReadTab+8>) at E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\Sensor_App\\Core\\Src\\adc.c:558\n”
~”0x08001fdc in SetFilterAdc (pu16_AdcDataTab=0x200009ac <au16_AdcReadTab+8>) at E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\Sensor_App\\Core\\Src\\adc.c:558\n”
~”558\t au32_AdcSumm[i] += au16_Adc4Filter[j][i];\n”
~”558\t au32_AdcSumm[i] += au16_Adc4Filter[j][i];\n”
~”558\t au32_AdcSumm[i] += au16_Adc4Filter[j][i];\n”
*stopped,frame={addr=”0x08001fdc”,func=”SetFilterAdc”,args=[{name=”pu16_AdcDataTab”,value=”0x200009ac <au16_AdcReadTab+8>”}],file=”E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\Sensor_App\\Core\\Src\\adc.c”,fullname=”E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\Sensor_App\\Core\\Src\\adc.c”,line=”558″,arch=”armv6s-m”},thread-id=”1″,stopped-threads=”all”
*stopped,frame={addr=”0x08001fdc”,func=”SetFilterAdc”,args=[{name=”pu16_AdcDataTab”,value=”0x200009ac <au16_AdcReadTab+8>”}],file=”E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\Sensor_App\\Core\\Src\\adc.c”,fullname=”E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\Sensor_App\\Core\\Src\\adc.c”,line=”558″,arch=”armv6s-m”},thread-id=”1″,stopped-threads=”all”
*stopped,frame={addr=”0x08001fdc”,func=”SetFilterAdc”,args=[{name=”pu16_AdcDataTab”,value=”0x200009ac <au16_AdcReadTab+8>”}],file=”E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\Sensor_App\\Core\\Src\\adc.c”,fullname=”E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\Sensor_App\\Core\\Src\\adc.c”,line=”558″,arch=”armv6s-m”},thread-id=”1″,stopped-threads=”all”
(gdb)
&”Quit\n”
&”Quit\n”
&”Quit\n”
(gdb)Attachments:
You must be logged in to view attached files.August 26, 2025 at 03:00 #36852julieninnovel
ParticipantHi,
Just UP this question…
Thanks
August 26, 2025 at 19:02 #36853support
KeymasterHi,
Sorry for the delay. Based on what we can see, the Black Magic Probe reports the gdb events in a rather unconventional order:
attach 1 *running,thread-id=”1″ ^done *stopped,frame={addr=”0x08001fdc”,func=”SetFilterAdc”,args=[{name=”pu16_AdcDataTab”,value=”0x200009ac <au16_AdcReadTab+8>”}],file=”E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\Sensor_App\\Core\\Src\\adc.c”,fullname=”E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\Sensor_App\\Core\\Src\\adc.c”,line=”558″,arch=”armv6s-m”},thread-id=”1″,stopped-threads=”all”
So, when VisualGDB asks it to attach to the target, it reports that the target is running (and hence won’t accept commands like “load”) and then after some time that changes to stopped.
You can try checking the black magic probe documentation whether there is a flag overriding this behavior.
If not, you can try experimenting with gdb hooks. E.g. create a file called hook.gdb in the project directory:
define hook-stop if !$hooked_load load set $hooked_load = 1 end end
Then, using VisualGDB Project Properties, add “source $(ProjectDir)/hook.gdb” as a pre-target command. This will force GDB to set the hook on the first stop that would run the “load” command.
August 27, 2025 at 01:21 #36854julieninnovel
ParticipantHi,
Thanks for yhis, with the hook file it’s now working fine in debug mode.
But I’ve steel got error when I do “Program and start without debugging”.
Sorry, I’m not an expert of GDB…
Thanks
Here is the GDB Session log :
c:\sysgcc\arm-eabi\bin\arm-none-eabi-gdb.exe –interpreter mi E:\MesDocuments\Code_source\BlackMagicProbe\Sensor\VisualGDB\Sensor_App\Debug\Sensor_App
-gdb-version
=thread-group-added,id=”i1″
~”GNU gdb (GDB) 15.2\n”
~”Copyright (C) 2024 Free Software Foundation, Inc.\n”
~”License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.”
~”\nType \”show copying\” and \”show warranty\” for details.\n”
~”This GDB was configured as \”–host=i686-w64-mingw32 –target=arm-none-eabi\”.\n”
~”Type \”show configuration\” for configuration details.\n”
~”For bug reporting instructions, please see:\n”
~”<https://www.gnu.org/software/gdb/bugs/>.\n”
~”Find the GDB manual and other documentation resources online at:\n <”
~”http://www.gnu.org/software/gdb/documentation/>.\n\n”
~”For help, type \”help\”.\n”
~”Type \”apropos word\” to search for commands related to \”word\”…\n”
~”Reading symbols from E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\VisualGDB\\Sensor_App\\Debug\\Sensor_App…\n”
(gdb)
~”GNU gdb (GDB) 15.2\n”
~”Copyright (C) 2024 Free Software Foundation, Inc.\n”
~”License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.”
~”\nType \”show copying\” and \”show warranty\” for details.\n”
~”This GDB was configured as \”–host=i686-w64-mingw32 –target=arm-none-eabi\”.\n”
~”Type \”show configuration\” for configuration details.\n”
~”For bug reporting instructions, please see:\n”
~”<https://www.gnu.org/software/gdb/bugs/>.\n”
~”Find the GDB manual and other documentation resources online at:\n <”
~”http://www.gnu.org/software/gdb/documentation/>.\n\n”
~”For help, type \”help\”.\n”
~”Type \”apropos word\” to search for commands related to \”word\”.\n”
^done
(gdb)
-list-features
^done,features=[“frozen-varobjs”,”pending-breakpoints”,”thread-info”,”data-read-memory-bytes”,”breakpoint-notifications”,”ada-task-info”,”language-option”,”info-gdb-mi-command”,”undefined-command-error-code”,”exec-run-start-option”,”data-disassemble-a-option”,”simple-values-ref-types”]
(gdb)
-gdb-set verbose on
^done
(gdb)
-gdb-set filename-display absolute
^done
(gdb)
-gdb-set disassembly-flavor intel
&”warning: could not convert ‘disassembly’ from the host encoding (CP1252) to UTF-32.\nThis normally should not happen, please file a bug report.”
&”\n”
^error,msg=”No symbol \”disassembly\” in current context.”
(gdb)
-gdb-set print demangle off
^done
(gdb)
source E:\MesDocuments\Code_source\BlackMagicProbe\Sensor\Sensor_App/hook.gdb
&”source E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\Sensor_App/hook.gdb\n”
^done
(gdb)
set mem inaccessible-by-default off
&”set mem inaccessible-by-default off\n”
=cmd-param-changed,param=”mem inaccessible-by-default”,value=”off”
^done
(gdb)
target extended-remote \\.\COM13
&”target extended-remote \\\\.\\COM13\n”
~”Remote debugging using \\\\.\\COM13\n”
=thread-group-started,id=”i1″,pid=”42000″
=thread-created,id=”1″,group-id=”i1″
&”warning: platform-specific solib_create_inferior_hook did not load initial shared libraries.\n”
~”Loading section .isr_vector, size 0xb8 lma 0x8000000\n”
+download,{section=”.isr_vector”,section-size=”184″,total-size=”312007″}
+download,{section=”.isr_vector”,section-sent=”184″,section-size=”184″,total-sent=”184″,total-size=”312007″}
~”Loading section .text, size 0x6f28 lma 0x80000b8\n”
+download,{section=”.text”,section-size=”28456″,total-size=”312007″}
+download,{section=”.text”,section-sent=”24328″,section-size=”28456″,total-sent=”24512″,total-size=”312007″}
~”Loading section .rodata, size 0x36c lma 0x8006fe0\n”
+download,{section=”.rodata”,section-size=”876″,total-size=”312007″}
~”Loading section .init_array, size 0x4 lma 0x800734c\n”
+download,{section=”.init_array”,section-size=”4″,total-size=”312007″}
~”Loading section .fini_array, size 0x4 lma 0x8007350\n”
+download,{section=”.fini_array”,section-size=”4″,total-size=”312007″}
~”Loading section .data, size 0x64 lma 0x8007354\n”
+download,{section=”.data”,section-size=”100″,total-size=”312007″}
~”Start address 0x080065b4, load size 29624\n”
~”Transfer rate: 27 KB/sec, 846 bytes/write.\n”
~”Current language: auto\n”
~”The current source language is \”auto; currently asm\”.\n”
~”Reset_Handler () at E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\Sensor_App\\Core\\Startup\\startup_stm32g030k8tx.S:60\n”
~”60\t ldr r0, =_estack\n”
*stopped,frame={addr=”0x080065b4″,func=”Reset_Handler”,args=[],file=”E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\Sensor_App\\Core\\Startup\\startup_stm32g030k8tx.S”,fullname=”E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\Sensor_App\\Core\\Startup\\startup_stm32g030k8tx.S”,line=”60″,arch=”armv6s-m”},thread-id=”1″,stopped-threads=”all”
^done
(gdb)
mon swdp_scan
&”mon swdp_scan\n”
@”You are now detached from the previous target.\n”
@”Available Targets:\n”
@”No. Att Driver\n”
@” 1 STM32G03/4 M0+\n”
^done
(gdb)
info shared
&”info shared\n”
~”No shared libraries loaded at this time.\n”
^done
(gdb)
attach 1
&”attach 1\n”
~”A program is being debugged already. Kill it? (y or n) [answered Y; input not from terminal]\n”
=thread-exited,id=”1″,group-id=”i1″
=thread-group-exited,id=”i1″
~”Attaching to program: E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\VisualGDB\\Sensor_App\\Debug\\Sensor_App, Remote target\n”
=thread-group-started,id=”i1″,pid=”1″
=thread-created,id=”1″,group-id=”i1″
*running,thread-id=”1″
^done
&”warning: platform-specific solib_create_inferior_hook did not load initial shared libraries.\n”
~”HAL_GetTick () at E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\Sensor_App\\Drivers\\STM32G0xx_HAL_Driver\\Src\\stm32g0xx_hal.c:320\n”
~”320\t{\n”
*stopped,frame={addr=”0x080043d0″,func=”HAL_GetTick”,args=[],file=”E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\Sensor_App\\Drivers\\STM32G0xx_HAL_Driver\\Src\\stm32g0xx_hal.c”,fullname=”E:\\MesDocuments\\Code_source\\BlackMagicProbe\\Sensor\\Sensor_App\\Drivers\\STM32G0xx_HAL_Driver\\Src\\stm32g0xx_hal.c”,line=”320″,arch=”armv6s-m”},thread-id=”1″,stopped-threads=”all”
~”Current language: auto\n”
~”The current source language is \”auto; currently c\”.\n”
(gdb)
&”Quit\n”
(gdb)Attachments:
You must be logged in to view attached files.August 27, 2025 at 09:40 #36856support
KeymasterThis looks like the loading now happens after target external-remote, but before the attach command. You can probably work around it by creating a do_attach.gdb file, that would add a hook and immediately issue the “attach” command, and then replacing “attach” with “source …/attach.gdb” in VisualGDB Project Properties (and removing the old hook.gdb reference).
That said, it could be way easier to use one of the proper hardware probes supported by OpenOCD. The problems you are encountering happen because the Black Magic Probe developers decided to reimplement some of the OpenOCD functionality, and ended up reimplementing it differently enough to cause various glitches. It should be possible to work around them, but if you don’t want to dive into the GDB internals, it may simply be not worth it.
-
AuthorPosts
- You must be logged in to reply to this topic.