STWorkbench R6.1.0 for OS21 and STLinux

Introduction

STWorkbench is an Eclipse IDE for the OS21 and STLinux Toolsets. It is based on Eclipse Helios (3.6) and C/C++ Development Tooling (CDT) (7.0.1) platform framework with customizations for build and debugging with ST Toolsets.

OS21 ST40 and ST200 functionality includes:

  • building executable, library and standard make projects
  • execute from command lines
  • debugging with enhanced views
  • ST Terminal view; serial terminal, using several connection methods
  • collecting trace, profiling and code coverage analysis

STLinux SH4 and ARM Cortex-A9 functionality includes:

  • building executable, library and standard make projects
  • execute from command lines
  • enhanced debugging of STLinux applications and libraries
  • integrated kernel configuration and build
  • kernel debugging using KGDB or the JTAG Kernel Debugger
  • the ability to launch debug sessions from the command line
  • target filesystem browsing
  • host-target file transfer
  • core file debugging
  • ST Terminal view; serial terminal, using several connection methods
  • user application profiling and coverage
  • system profiling using OProfile
  • graphical system tracing with KPTrace

STWorkbench also contains a number of useful third party plugins:

For a list of changes made in Eclipse Helios see Eclipse 3.6 - New and Noteworthy and for changes in CDT 7.0 see CDT New In 7.0.

The source code for STWorkbench components licensed under the Eclipse Public License (EPL) can be obtained by emailing cpt-marketing@list.st.com

Please refer to the  Errata page for the complete list of issues that have been resolved or remain open in this release.


Summary of improvements since last release (R6.0.0)

  • Support for STLinux ArmV7 distribution (ARM Cortex-A9)
    • Kernel & user space makefile & executable projects
    • Kernel & user space debugging
    • Trace & profile support
    • Also includes SMP awareness
  • Improved support for SDK2
    • Added support for environment variables to manage SDK2.
  • Special project wizard for STAPI_SDK for STLinux application tree.
    • Ease the management for STAPI build configurations
    • Automate the creation of STLinux Target and Kernel debug configurations.
  • Complete the support of environment variable such as ${VAR} in launch configurations for both OS21 and STLinux plugins.
  • Improve KPTrace performances
    • ARM-SMP support in KPTrace and VisualOprofile
    • KPTrace over Ethernet (in addition to NFS)
    • Optimization in KPTrace database size and time spent by parsing of tracefiles
    • Enhancements in wizard able to start/stop KPTrace; integrated creation of projects, improvement in errors/warnings management and in layout
    • Integrated a Multi Level Pie Chart (MLPC) view for STLinux trace statistics
    • Improve usability of search engine and display of results; shared time range between criterias and removal of synchronization with timechart on simple selection
  • New "Function Viewer" feature available in debug perspective, allowing breakpoints to be managed at function level

Supported hosts

STWorkbench R6.1.0 is supported on the following 32-bit hosts:

  • RedHat Enterprise version 4 and 5
  • Windows XP and 7
  • STLinux hosted on Fedora 12 through to 15

STWorkbench R6.1.0 is known to be compatible with the following 64-bit hosts when used with a 32-bit JRE:

  • RedHat Enterprise version 4 and 5
  • Windows 7
  • STLinux hosted Fedora 14 and 15

STWorkbench requires a 32-bit Java 1.6 JRE version 1.6.0_11 or greater

  • A compatible version is available in the STWorkbench OS21 installation.
  • A compatible JRE is not automatically available if STWorkbench is installed via stmyum for STLinux development. The user must install one if not already provided by the host OS.

Linux 32-bit JRE and libraries

  • STWorkbench requires a 32-bit JRE (even on a 64-bit host) and is tested with the 32-bit java-1.6.0-openjdk that is typically available for a Red Hat/Fedora Core installation via the commands (as root):

    # yum -y update
    # yum -y install java-1.6.0-openjdk.i\*

    If a 64-bit JRE was previously installed then the new 32-bit JRE can be selected using the alternatives command:

    # alternatives --config java

    To test which JRE is in use, run the following (as a normal user) and check the version information:

    $ java -version

  • If a 32-bit OpenJDK JRE is not available for your host then the Oracle Java SE 6 can be used. This can be downloaded from the Oracle web-site Java SE Downloads site:www.oracle.com
  • If GTK warnings are reported then install the following:

    # yum -y install gtk2-engines.i\* libcanberra-gtk2\*.i\* PackageKit-gtk\*.i\*

  • If using a KDE Desktop then install the following:

    # yum install -y libbonobo*i686* libgnomeui*i686 libXt*i686

  • If not installed via stmyum on a 64-bit Linux host, the 32-bit GNU C library support may not be installed. To install:

    # yum -y install glibc.i\*

    If using OS21 Trace features, install:

    # yum -y install elfutils-libelf.i\*

    A 32-bit version of the GTK is also required. If not installed, install using:

    # yum -y install gtk2.i* libXtst.i*



Notes

  • This release is compatible with version R5.2.0 of the ST40 Micro Toolset, R7.2.0 of the ST200 Micro Toolset and STLinux-2.4. Although this release works with previous versions, some functionality may not be available. Also, the ST Toolset version may not be available on all the supported STWorkbench R6.1.0 hosts. Please consult the toolset documentation for more details.
  • Windows hosted STWorkbench may be used to view STLinux KPTrace files.
  • To use STWorkbench with the ST40 Micro Toolset and the ST200 Micro Toolset the toolsets must be available on your PATH. See the toolset installation instructions for more information.
  • The use of spaces in file names, paths, workspaces and project names is discouraged as they are not supported in some parts of the toolset and can cause problems.
  • The Serial Relay connection of the ST Terminal and the Target Pack usage in the debug launch configuration require that the "stmc/bin" and "stmc/lib" paths have to be set respectively in $PATH and in $LD_LIBRARY_PATH environment variables.
  • Due to the ongoing development of the ARMv7 tools users of STWorkbench may experience some stability issues when debugging ARMv7 targets. In particular users should ensure that the stlinux24-cross-armv7-gdb version they are using is up to date (release 64 or later).


STWorkbench Training and Resources

STWorkbench users within ST can find further information about the training and resources available at the STWorkbench Product page of the CPT intranet site http://cpt.st.com/products/stworkbench. Internal users should submit support requests via the SUPst support database, using the STWorkbench category.

STWorkbench users outside of ST can find more information at www.stlinux.com. Use the "Search this site: " field and search for STWorkbench. External users can use Bugzilla for STLinux specific issues or email stworkbench.support@st.com.


STWorkbench Platform Framework

The STWorkbench 6.1.2 platform is a customized version of Eclipse/CDT with the following additional features:

  • Breakpoints view
    • Setting hardware breakpoints now uses the same interface as software breakpoints.
    • The new Add Breakpoint dialog supports enhanced breakpoint features.
    • The STWorkbench 6.1.2 provide the ability to set breakpoint per thread, the feature is available only when debugging a C/C++ application using the Standard Debug Layer. The feature is accessible through the Add breakpoint button available in the breakpoint view toolbar and selecting the Advanced Add breakpoint dialog.
  • Build Logs
    • STWorkbench Make Targets allow the automatic generation of Build Logs (i.e. the output from the compilation/linking process).
    • The log can then be loaded by the STWorkbench Indexer to provide more accurate source code indexing, taking account of symbols defined by the makefile.
    • Can then choose to highlight or hide the inactive parts of the source code.
  • Debug view
    • Support for the display of OS21 thread names.
  • Environment Variables
    • Environment variables can now be specified directly or loaded via a script for an STWorkbench project.
    • These variables can then be used in building or launching debugging .
    • The commonly used fields in the Launch Configuration will accept environment variables or combinations of strings & variables e.g. $TARGET, ${DVD_FRONTEND}stx${DVD_BACKEND}.cmd
  • Favourite View
    • Favourite View enables the user to select and display variables in current stack frame. The user can chose variables to display, control/modify values through dialog box (through toolbar buttons) or directly through code source (contextual menu while right click on code source).
  • Function return value available in Variable view
    • When returning (Step Out) from a function the Variable view highlights the function return value.
  • GDB console
    • Word wrap can be disabled so that the whole line can be seen horizontally and navigated with a scrollbar.
    • Script output prior to the first interactive GDB prompt is displayed.
    • Debug console does not automatically hide other console views when a debug event occurs.
  • Launch configuration dialog
    • All ST launch configurations are grouped together under ST Applications
  • Memory view
    • Additional visualization formats are available.
    • Data can be displayed in different column sizes.
    • The view has the ability to dump, restore and set ranges of memory.
  • Multiple Build Consoles
    • A separate build console is available for each build configuration by checking the Open option in Window>Preferences...>C/C++ >Build console.
  • Variable view
    • Now displays addresses of variables.
  • Watched Memory Mapped registers
    • In the Memory Mapped registers view, the user can select registers to make them Watched which makes them appear first in the register list.
  • Pending Breakpoints
    • Improved support for inserting pending breakpoints while target is running and suspended

For more information on using STWorkbench, including tutorials, see the online help in STWorkbench by selecting Help > Help Contents > STWorkbench Help.

STLinux Plugin Suite

The following enhancements have been made to the STLinux Plugin Suite:

  • Support for environment variables in launch configurations and execute from command line options.
    For a list of the supported fields see the following help pages. 
        Help > Debugging > Environment variables
        and
        Help > Execute from Command Line > Direct Launch: STLinux
  • Ability to specify an STLinux kernel binary with an arbitrary path. In previous releases the vmlinux binary had to reside in the root of the kernel project. Now it is possible to specify a binary file at any location. This is supported in "STLinux Kernel" and "STLinux Attach to Kernel" launch configurations.
  • Support for ARMv7 using execute from command line.
    For details see Help > Execute from Command Line > Direct Launch: STLinux
     
  • Support for ST40 Linux C/C++ Compiler discovery options.
    For details see Help > Editing > Navigation.

System Monitoring

A group of views that provide information about application runtime behavior, see Help > Help Contents > STWorkbench for OS21 and STLinux > System Monitoring

  • ST40/ST200 Branch Trace View

    This view provides a listing of the last branches (from 8 up to 1024) that the program performed before stopping. To display the Branch Trace View, change to the Debug perspective using the Debug button on the right side of the main toolbar and select Window > Show View > Branch Trace View..

    For more information, see the online help in STWorkbench by selecting Help > Help Contents > STWorkbench for OS21 and STLinux > System Monitoring > Branch Trace View.

  • ST40/ST200 Performance Counters View

    This view is for control and display of the CPU performance counters. These are CPU registers that capture metrics in a non-intrusive way to display a wide range of core related events. See Help > Help Contents > STWorkbench for OS21 and STLinux > System Monitoring > Performance Counters.



ST40 Toolset Plugin Suite

The ST40 Micro Toolset Plugin Suite is a set of plugins providing STWorkbench users with an integrated development and debugging environment for the ST40 Micro Toolset. It includes the following new functionality.

  • Executable Projects (also known as Managed Make projects) are available for ST40 Micro Toolset executables, static libraries and relocatable libraries.
  • Makefile Projects are available for the ST40 Micro Toolset.
  • The user has the ability to attach to either a stopped or running target.
  • The STWorkbench Help provides ST40 specific tutorials on building and debugging. For more information, see the online help in STWorkbench by selecting Help > Help Contents > STWorkbench for OS21 and STLinux.
  • Execute from Command Line: Direct Launch
    • STWorkbench supports the ability to launch a debug session directly from the command line. To use the Execute from Command Line feature, start STWorkbench with the option -st40debug to display usage instructions.
    • For more information, see the online help in STWorkbench by selecting Help > Help Contents > STWorkbench for OS21 and STLinux > Execute from Command Line.


ST200 Toolset Plugin Suite

The ST200 Micro Toolset Plugin Suite is a set of plugins that provide STWorkbench users with an integrated development and debugging environment for the ST200 Micro Toolset. It includes the following functionality.

  • Executable Projects (also known as Managed Make projects) are available for ST200 Micro Toolset executables, static libraries and relocatable libraries.
  • Makefile Projects are available for the ST200 Micro Toolset.
  • The STWorkbench Help provides ST200 specific tutorials on building and debugging. For more information, see the online help in STWorkbench by selecting Help > Help Contents > STWorkbench for OS21 and STLinux.
  • ST Analysis tools have been included to provide profiling and tracing features in STWorkbench.
  • Statistics view(simulator only)
    • View statistics when running on the simulator. To display the Statistics view, change to the Debug perspective using the Debug button on the right side of the main toolbar and select Window > Show View > ST200 Statistics view.
    • For more information, see the online help in STWorkbench by selecting Help > Help Contents > STWorkbench for OS21 and STLinux > Statistics view (simulator only)
  • Execute from Command Line: Direct Launch
    • STWorkbench supports the ability to launch a debug session directly from the command line. To use the Execute from Command Line feature, start STWorkbench with the option -st200debug to display usage instructions. For more information, see the online help in STWorkbench by selecting Help > Help Contents > STWorkbench for OS21 and STLinux > Execute from Command Line
  • ST200 Cheat Sheets
    • Provides step by step guidance on the main steps needed to develop embedded applications for the ST200. To display the ST200 Cheat Sheets select Help > Cheat Sheets... > ST200 Toolset Development.

The ST Analysis tools are the same for both OS21 ST200 and ST40.



ST Analysis Tools

The ST Analysis Tools view provides profiling and tracing features in STWorkbench for STLinux and OS21. The features are different between OS21 and STLinux and consists:

  • Static Analysis tools
    • STgprof (similar to gprof)
    • STgcov (similar to gcov)
    • OS21 Profiler (provides OS21 profiling)
  • Interactive Analysis tools
    • STLinux kptrace and STLinux LTTng
      See STLinux Trace and Profile
    • STLinux oprofile
    • OS21 System Activity
      Data is available from an application linked with OS21 tracing enabled (using the -trace and -trace-api options). It provides:
      • A sequence diagram showing the interrupts, task switches and OS21 function calls plotted with timestamps.
      • Metrics of total time spent in each interrupt, task or idle.
      • OS21 function call parameters and return results; plus support to locate to the source line where the OS21 function has been called from.
      • User-defined tracepoints.
    • OS21 Profiler
      Data is available from an application linked with OS21 Profiler enabled (using the -profile option). It provides the same data display as Static OS21 Profiler Analysis but with the flexibility that it can be started, stopped and reconfigured from a Debug view.
    • STMC Sample Profiler
      Performs non-intrusive PC sampling from the STMC and creates a gprof compatible gmon.out file from a non-instrumented application.
    • STMC Sample History
      Similar to STMC Sample Profile except it displays a sequential list of the actual PC values sampled.

All the interactive OS21 System Activity tools can be started at the same time, except for STMC Sample Profiler and STMC Sample History as they mutually exclusive. The displays can be set up to be updated automatically when a breakpoint is hit.

For more information on using the OS21 ST Analysis features, including tutorials, see the online help in STWorkbench by selecting Help > Help Contents > ST40 trace, profile and coverage and ST200 trace, profile and coverage.

STWorkbench FAQ

  • Question: How do I use STWorkbench when the ST40 Micro Toolset or ST200 Micro Toolset is not on my path? Answer: Create a script file to launch STWorkbench that also adds the toolsets to the PATH.
  • Question: When using a makefile project on Windows and the RM command is specified as del, I get the following error. What is wrong?

    /usr/bin/sh: del: command not found
    make: [clean] Error 127 (ignored)

    Answer: This error occurs if Cygwin is on the PATH. The workaround is to not specify an RM command in the makefile, but still use -$(RM) in the clean target. STWorkbench then correctly works out which command to use, whether Cygwin is on the PATH or not.

  • Question: Is it possible to start an STWorkbench debug session from the command line? Answer: Yes. The feature is called "Execute from command line: Direct Launch" and STWorkbench is required to be on the PATH.

    For example, the following launches a debug session for the executable a.out, on an mb519 target called stmc:

    stworkbench -st40debug -t stmc:mb519:st40 -e a.out

    For more information, see the online help in STWorkbench by selecting Help > Help Contents > STWorkbench for OS21 and STLinux > Execute from Command Line

    To get a list of all toolsets which support execute from command line launch STWorkbench with the -help option:

    stworkbench -help

  • Question:How do I attach to a running target? Answer: You must already have launched STWorkbench, the project that contains the target application that you wish to attach to must already be open, and your target must be running the desired application.
    1. Select Run > Open Debug Dialog...and the Create, Manage and Run Configurations dialog appears.
    2. Expand the ST Applications category and double click on ST40 Attach to Target Application. STWorkbench creates a new launch configuration.
    3. In the Main tab, check that the project is selected and specify the name of the application in the C/C++ Application field.
    4. Select the Debugger tab and enter your TargetPack parameters. You need to define the ST Micro Connect, the TargetPack and the Core.
    5. Then select Attach to running target in the Attach type combobox. This changes the connection command to look like the following:

      stmc:mb602:st40,no_reset=1,no_pokes=1

    6. Click Debug to attach to the target. The target stops, the Debug perspective appears and shows a callstack to indicate where the application has stopped. You can now use the normal debug controls to step through your application.
  • Question: How do I make full use of the STWorkbench indexing and Macro and Include Discovery (build log) features? Answer: STWorkbench provides excellent source navigation features including the ability to highlight inactive (not compiled) code by displaying it in the editor with a different colored background. It is also possible to "fold away" (that is, hide) inactive code. When working with a source base that includes a lot of conditionally compiled source code, these features can greatly improve code legibility.

    For more information see the online help Help > Help Contents > STWorkbench for OS21 and STLinux > Editing >  Navigation

    Note: If the source code is indexed first and then a build log applied, the newly discovered information relating to macros and includes is not used until all currently open editors are closed and the index has been rebuilt. To rebuild the index, right click the project in the Project Explorer view and then select Index >  Rebuild.

    For large projects, indexing can take a few minutes to complete. To avoid having to perform two index builds if the debug session has been started using the Execute from Command Line interface, we recommend not to specify the -index switch on the command line. Instead, after launching the debug session, set up the "Macro and Include Discovery Options" first, (using the procedure described in the Navigation help page) and then switch on indexing. To switch on indexing in Properties, select C/C++ General > Indexer and in Select Indexer choose Fast C/C++ Index (recommended) and click OK. STWorkbench now builds the index, and its progress is displayed in the status bar at the bottom right hand side of the STWorkbench window.