Skip to main content
Achar1
Associate II
October 21, 2021
Solved

how to launch stm32cubeide debugger from command line?

how to launch stm32cubeide debugger from command line?

This topic has been closed for replies.
Achar1
Achar1Best answer
Associate II
October 26, 2021

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.

7 replies

Markus GIRDLAND
ST Employee
October 21, 2021

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

Achar1
Achar1Author
Associate II
October 21, 2021

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.

Markus GIRDLAND
ST Employee
October 21, 2021

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:

0693W00000FDI9qQAH.png

Achar1
Achar1AuthorBest answer
Associate II
October 26, 2021

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.