2021-10-21 02:52 AM
how to launch stm32cubeide debugger from command line?
Solved! Go to Solution.
2021-10-26 06:02 AM
I am able to get the solution to this issue.
pl find the batch files contents attached.
main batch file
@setlocal
@set CUR_DIR=%CD%
start /B Connect_JLinkGDBServerCL.bat
start /B Start_GDB.bat %CUR_DIR%\SUITE_Objs\RTLSTagTest.elf
@endlocal
Connect_JLinkGDBServerCL.bat
%STM_base_dir%\JLinkGDBServerCL.exe -port 2331 -s -device STM32L462RE -endian little -speed 4000 -if swd -swoport 2332 -telnetport 2333 -noreset -noir -localhostonly 1 - singlerun -strict -timout 0 -nogui
Start_GDB.bat batch file
%GDB_DIR%\arm-none-eabi-gdb.exe --command=Gdb_StartUp.gdb %1
Gdb_StartUp.gdb file
target remote localhost:2331
load
break my_end
print coverage_data_pool
c
quit
with all connected batch file i am able to resolve this issue.
thanks for your support.
2021-10-21 03:44 AM
Hello there!
It will depend on what debug probe you are using. If you are using ST-Link GDB server then you can find all the commands available, and how to start the GDB server, at this link: UM2576
2021-10-21 04:12 AM
hi,
Thanks for your quick response
I have used the following command
set STM_base_dir=
C:\ST\STM32CubeIDE_1.7.0\STM32CubeIDE
@set gdb_server_dir=%STM_base_dir%\plugins\com.st.stm32cube.ide.mcu.externaltools.stlink-gdb-server.win32_2.0.0.202105311346\tools\bin\
@rem set cube_programmer_dir=%STM_base_dir%\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_2.0.0.202105311346\tools\bin
cmd /K %gdb_server_dir%\ST-LINK_gdbserver.exe -c config1.txt
pl find the cinfig1.txt is attached.
After execution I am getting error
C:\Venkatesh\CmdLine_Build_RTLSTag>cmd /K C:\ST\STM32CubeIDE_1.7.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.stlink-gdb-server.win32_2.0.0.202105311346\tools\bin\\ST-LINK_gdbserver.exe
-c config1.txt
STMicroelectronics ST-LINK GDB server. Version 5.9.1
Copyright (c) 2021, STMicroelectronics. All rights reserved.
Starting server with the following options:
Persistent Mode : Enabled
LogFile Name : debug.log
Logging Level : 31
Listen Port Number : 2331
Status Refresh Delay : 15s
Verbose Mode : Disabled
SWD Debug : Enabled
ST-Link enumeration failed
Error in initializing ST-LINK device.
Reason: ST-LINK DLL error.
2021-10-21 04:37 AM
Hello again Venkatesh,
Are you using J-Link or ST-Link GDB server? The error indicates that it can not find an ST-Link connected and the Port Number that is being listened to is 2331, which is the default for J-Link.
You can go into the debug configuration through the GUI of your application and see the exact command line that is being used by clicking on the button highlighted below:
2021-10-21 05:06 AM
Thanks so much or your support
If I execute from GUI everything is working fine
As per your guild line, I have copied the command line pasted in to one batch file
set STM_base_dir=C:\ST\STM32CubeIDE_1.7.0\STM32CubeIDE
%STM_base_dir%\plugins\com.st.stm32cube.ide.mcu.externaltools.jlink.win32_2.0.0.202105051205\tools\bin\JLinkGDBServerCL.exe -port 2331 -s -device STM32L462RE -endian little -speed 4000 -if swd -vd
When I execute same command from command prompt, it will stuck
Please give your inputs to resolve this issue.
2021-10-21 05:29 AM
Hello again!
It looks like everything is working as intended in the screenshot of the command prompt window. The launch has succeeded and it is now waiting for the GDB connection.
If you plan on using command line then you will need to change the GDB Connection Settings in your Debug Configuration from "Autostart local GDB server" to "Connect to remote GDB server".
Since you are using J-Link any additional commands will need to be found in the J-Link user manual and not the ST-Link GDB server one. However, you can find some additional information regarding debugging and the debug configuration in the STM32CubeIDE user manual, UM2609, in chapter 3.
2021-10-21 09:26 PM
As per your guide lines, I have selected "Connect to remote GDB server".
Still I am getting same error.
Please give me inputs to resolve this issue.
Thanks in advance
2021-10-26 06:02 AM
I am able to get the solution to this issue.
pl find the batch files contents attached.
main batch file
@setlocal
@set CUR_DIR=%CD%
start /B Connect_JLinkGDBServerCL.bat
start /B Start_GDB.bat %CUR_DIR%\SUITE_Objs\RTLSTagTest.elf
@endlocal
Connect_JLinkGDBServerCL.bat
%STM_base_dir%\JLinkGDBServerCL.exe -port 2331 -s -device STM32L462RE -endian little -speed 4000 -if swd -swoport 2332 -telnetport 2333 -noreset -noir -localhostonly 1 - singlerun -strict -timout 0 -nogui
Start_GDB.bat batch file
%GDB_DIR%\arm-none-eabi-gdb.exe --command=Gdb_StartUp.gdb %1
Gdb_StartUp.gdb file
target remote localhost:2331
load
break my_end
print coverage_data_pool
c
quit
with all connected batch file i am able to resolve this issue.
thanks for your support.