Included in the S32DS for ARM is a set of example projects, which include one called 'hello'. This example shows a basic application which activates an LED when a button is pressed on the S32K144EVB-Q100 evaluation board. The S32K SDK is not used in this example.

In this HOWTO, we will show how to load the project into the workspace, build, download to the target, and run debug.

1. Create Project

a. File -> New -> New S32DS Project from Example

OR from the Dashboard

b. Select S32DS Example Projects -> S32K144 -> hello

2. Examine the code

a. Locate the project in C/C++ Projects view

b. Expand 'hello', then 'src'

c. Double-click on 'hello.c', to open the file in the editor

3. Build the project

a. Click to select hello project, this is to ensure that the tool knows which project you wish to build.

b. Click Build button. By default, the standard 'Debug' build configuration will be used. Projects created using either the New S32DS Project from Example, or New S32DS Project wizard are setup with 3 build configurations: Debug, Debug_RAM, and Release. The 'Debug' configuration contains settings to build the project with the lowest compiler optimization setting and to occupy the Flash memory space on the target. The 'Debug_RAM' configuration is very similar to the 'Debug' configuration with one exception. It is set to occupy the RAM memory space on the target. The 'Release' configuration will build the project with the highest optimization setting and to occupy the Flash memory space on the target.

c. From the console tab, the build status output is displayed. Check here to confirm the build completed and there were no errors.

4. Setup Debug Configuration

a. Click Run -> Debug Configurations… OR from the Debug button menu

b. Expand the 'GDB PEMicro Interface Debugging' group.

c. Select the configuration which matches the build configuration you just used to build the project. For each build configuration generated by the new project wizard, it also generates a matching debug configuration.

d. Select the Debugger tab. The debug configuration was created with the 'PE Micro GDB server' option selected, but there are several hardware options for this. Select the option which matches your hardware setup. For example, for the S32K144, most likely you have the standard evaluation board, which has OpenSDA integrated. In this case, you would use the OpenSDA interface option. For other MCUs, you may have hardware which requires the USB Multilink or Cyclone.

e. Click Refresh to ensure the correct port is selected.

5. Click Debug to start the debugger launch sequence. It is not necessary to click on the 'Apply' button unless setting changes are being made without intention to launch the debugger. The scripts behind the Debug button include the actions of the script behind the Apply button.

6. When the launch sequence completes, the application is executed until the start of main(), where a breakpoint was automatically set.

7. It is now possible to run or step through the code, view variables and registers.

8. Click Resume and when Button 0 is pressed, the LED will turn on as Blue, and when Button 0 is released, the LED turns off.

9. To end the debug session, click the 'Terminate' button. It is a good idea to also click on 'Remove All Terminated Launches', before starting another debug session.