This describes how to create projects to automatically manage builds and how to debug applications using STWorkbench as a remote debugger.
STLinux applications have no intrinsic links to specific target boards, therefore this is applicable to any supported board. However, the following host and target features must be available.
Click File > New > Project.... The New Project window appears.
Select C > C Project from the Wizards tree/list and click Next. The C Project dialog appears.
Enter 'HelloWorld' into the Project name text box
Select Executable from the Project types list
Select ST40 Linux GCC from the Toolchain list.
Click Finish. This bypasses the final page of the wizard but the default values are correct. If an alert appears to confirm a perspective switch, click Yes.
Select HelloWorld from the STWorkbench C/C++ Projects view.
Click File > New > File. The New File window appears.
Enter 'hello.c' into the File name text box and click Finish.
Copy the following into the editor.
#include <stdio.h> int main() { int i; for (i=0; i<25; i++) { printf("Hello world\n"); } return 0; }
If the console output is not displayed automatically, select HelloWorld from the STWorkbench Navigator window.
To explore further, try the following.
Select HelloWorld from the STWorkbench Navigator window.
Click Run > Debug.... The Create, manage, and run configurations window appears.

From the Configurations list, select STLinux Target Application and click New. A HelloWorld configuration is automatically created from the selected project.
In the Debug window, select the Debugger tab.
Check that ST40 Linux GDB Debugger or ST200 Linux GDB Debugger is selected in the Debugger list.
Enter the name or IP address of the target board into the Target name or IP address text box.
Click Debug. The application is copied to the target and executed, and the debugger stops at a breakpoint on main(). If an alert is displayed to confirm a perspective switch, choose Yes.
Click Run > Step Over twice. The value of i, shown in the STWorkbench Variables window becomes 0.
Click Run > Step Over again. Hello world appears in the STWorkbench Console window.
Note: The Console window shows the console output of multiple processes. Switch between them using the terminal icon at the top right of the Console window.
Click Run > Resume. The program runs to completion and is marked
To explore further, try the following.