How To Create and Debug Hello World in TimeStorm

This document provides a guide to remote debugging using TimeStorm.

Prerequisites

  • Install the Factory SDK Installer, which is located in your Factory build output, to provide TimeStorm with a cross-toolchain.
  • After the installation, verify that your toolchain exists in TimeStorm, under Window -> Preferences -> Timestorm -> Toolchains.
  • You will need an SSH server running on your target, such as dropbear.
  • You will need to set a password for root on your target. You may do so by running the passwd command in a terminal.
  • Make a Hardware Target profile in TimeStorm: Right click your project, and click Debug As > Remote C/C++ Application. In the resulting Debug Configuration window, click the Target tab, and select Manage Target. Create a new HW target — we recommend using SCP in the Download tab (specify SSH credentials) — and use SSH in the Execute tab.

Hello World Example

  1. Create the hello world application: Select File -> New -> C++ Project.
    1. Select Hello World C++ Project under Executable.
    2. Specify TimeStorm Cross-Compile toolchain.
    3. Give the app a name, "helloworld".
    4. Click Next, modify the author info, and/or just click next.
    5. Click Next, do not make changes to the configurations page.
    6. Select the same cross toolchain.
  2. Select helloworld in the Project explorer, and build using Project -> Build project. Verify it builds without error.
  3. Right click on helloworld, click Debug As > Remote C/C++ Application.
  4. Under target, select the hardware target added in the prerequisites of this tutorial.
  5. Click Debug, and you can step into and through the execution of the app.

Shared Library Example

  1. Create a new shared library project: select File -> New -> C++ Project.
    1. Select Hello World C++ Library under Shared Libraries.
    2. Specify TimeStorm Cross-Compile toolchain.
    3. Give the library project a name, "hellolib".
    4. Click Next, don't make changes in the Configurations page.
    5. Select the toolchain for your architecture.
  2. Try to build the project, Click Project -> Build Project. If there are no errors skip to step 4.
  3. Add the fPIC option to the build step for the library: in project explorer, right click on hellolib, and click properties
    1. Under* C/C++ Build*, click settings.
    2. From the Configuration drop-down menu, select All.
    3. In the Tool Settings tab under GCC C++ Compiler, select Miscellaneous.
    4. In the Other flags: textbox, append "-fPIC".
    5. Click OK to leave the properties window for hellolib.
    6. Click Build Project under the Project menu, it should work now.
  4. To create the application that will use the shared library: Select File -> New -> C++ Project.
    1. Select Hello World C++ Project under Executable.
    2. Specify TimeStorm Cross-Compile toolchain.
    3. Give the app a name, "helloworld".
    4. Click Next, modify the author info, and/or just click next.
    5. Click Next, do not make changes to the configurations page.
    6. Select the same cross toolchain.
  5. Select helloworld in the Project explorer, and build using Project -> Build project. Verify that it builds without error.
  6. Right-click on helloworld in the Project Explorer, and click properties.
  7. Under C/C++ General click Paths and Symbols.
    1. In the Configuration drop-down select All.
    2. In the references tab, check hellolib.
    3. Click Includes tab, under Languages select C++ source file.
    4. Select /hellolib under include directories.
    5. Click edit, and change /hellolib to /hellolib/src.
  8. Under C/C++ Build select Settings.
    1. Under tool settings, select GCC C++ Linker/Libraries.
    2. In Libraries, click the Add button.
    3. Type 'hellolib' and click ok.
    4. Click ok to exit out of project.
  9. Modify helloworld.cpp, add hellolib.h to the #includes, and insert a call to "sayHello();" in the main() function.
  10. Build the project.
  11. Right click on helloworld, click debug as remote C++ application.
  12. In debug configurations window click the Environment tab, add "LD_LIBRARY_PATH" with the value ".".
  13. Under target, select the target added during the beginning of this tutorial.
  14. Click Debug, and you can step into and through the execution of the app / lib.