cancel
Showing results for 
Search instead for 
Did you mean: 

eclipse tool chain setup (how to set debugger)

ckim
Associate II
Posted on December 02, 2015 at 13:01

Hi, I follwed 

http://www.st.com/web/en/catalog/tools/FM147/CL1794/SC961/SS1533/PF261797?s_searchtype=keyword

 and then to 

http://www.openstm32.org/Installing+System+Workbench+for+STM32+with+installer

 page to install SW4STM4 tool.

I could import the Uart_printf project in the STM32cubeF4 package and build it. But I don't know how to program the board and run(debug) the program. Internet search lead me to this page below.

http://erika.tuxfamily.org/wiki/index.php?title=Tutorial:_STM32_-_Integrated_Debugging_in_Eclipse_using_GNU_toolchain&oldid=5474

Then I found newest versions of gdb hardware debugging and open OCD is alread installed with the eclipse. Then I tried to configure for the debugger, but I don't know how to set it. Below is the capture. (port number 4242 is for ST-UTIL but I'm not sure it's for my case. I think I'm using ST-LINK/V2 on the board). And though eclipse said hardware gdb is already installed, I cannot find it in my C: drive. 

0690X00000602aKQAQ.jpg

When I checked 'install new software' it shows me that GDB hardware debugging is already installed. In the image below, when I check Hide items already installed, the first item disappears meaning it's installed already.

Where is gdb installed? any help would be appreciated. 

best regards,

0690X00000602aPQAQ.jpg

Chan

#eclipse #!bug #debugging
3 REPLIES 3
TarekB-ST
Associate III
Posted on December 02, 2015 at 15:48

Hello Chan

Thank you for reporting this, but SW4STM32 has already an integrated builtin debugger based on open OCD, so you don't need to install another debugging plugin within SW4STM32

Even more, the version of open OCD delivered with SW4STM32 supports more STM32 devices than other debugging plugins.

To use it after building your project, open Debug Configurations then create a new 'Ac6 STM32 Debugging' configuration

0690X00000604FtQAI.png

If the Project field is not set automatically, use the 'Browse' button and select your project.

Finally you can launch your debug session by pressing the 'Debug' button.

Best Regards,

Tarek

ckim
Associate II
Posted on December 02, 2015 at 16:19

Hello, Tarek,

Nice to hear that. I followed your direction and launched the debugger and it runs!

But I don't know the run is halted many times and I can't see the printf on my console.

(BTW, I'm testing Uart_printf from STM32cubeF4 package)

There must be something wrong in the project itself? or is there something I should set before running it? and after debugger started, pressing F6 is executing every line or function (like F10 in visual studio) isn't it? (I pressed F6 but it halts many times in some PCs)

Thanks, Best, 

0690X00000602aUQAQ.jpg

Chan

TarekB-ST
Associate III
Posted on December 04, 2015 at 11:04

Hello Chan,

For the printf output there are two cases:

 1- If you are retargetting the printf to serial output (UART/USART) ?

    As I can see from the comment in line 129 you are using an EVAL BOARD

    so based on that you need to connect your RS232 connector to your PC

    if your computer does not contain an RS232 input then you need to use an RS232 to USB adaptor

    if this is OK : the printf output cannot be displayed in openocd console

    so to display the printf output you can:

     - use an external program : there are many ones available (

http://en.wikipedia.org/wiki/Tera_Term

,  

http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

, ...) where 

http://www.compuphase.com/software_termite.htm

 is my favorite one.

     - otherwise if you dont want to use an external program you can install a terminal plugin within ecplise like ''Target Management Terminal (Core SDK)'' and ''RxTx''

       for more details see this 

http://mcuoneclipse.com/2014/03/23/serial-terminal-view-with-eclipse-kepler/

 

       PS : this works only with eclipse kepler

 2- If you want to use semihosting on System Workbench ?

     to do this please refer to this 

http://www.openstm32.org/tiki-view_forum_thread.php?comments_parentId=164

 

     

Concerning the core being halted many times when stepping over, this is because background polling is enabled by default. This is required when using GDB (we are in this case)

For more information on Event Polling see this 

http://openocd.org/doc/html/Daemon-Configuration.html#Event-Polling

 

Best Regards,

Tarek