AM261x MCU+ SDK: Build a Hello World example

| AM261x MCU+ SDK 26.00.00 |

Build a Hello World example

# Using CCS projects

- When using CCS projects to build, make sure you have imported and built the CCS project of interest (see Using SDK with CCS Projects)
- Quick steps to import the "hello world example" CCS project are listed below
  - In CCS, goto "Toolbar > View > Project Explorer"
  - In the "Project Explorer" window, right click and select "Import > CCS Projects"
  - Click "Browse" and goto the folder `${SDK_INSTALL_DIR}/examples/hello_world`
  - Select the project `hello_world_{board}_r5fss0-0_freertos_ti-arm-clang`
  - The project will be imported into the "Project Explorer"
  - Right click on the project title and click "Build Project"
  - This will build the project, now you can load and run it (see CCS Launch, Load and Run)

# Using IAR Embedded Workbench projects

- Quick steps to import the "hello world example" IAR EW project are listed below
  - In IAR EW, goto `Toolbar > File > Open Workspace`
  - Browse and goto the folder `${SDK_INSTALL_DIR}/examples/hello_world/am261x-lp/r5fss0-0_freertos/iar-arm`
  - Select the `hello_world_am261x-lp_r5fss0-0_freertos.template.eww` file
  - The workspace and project will be imported.
  - Right click on the project title and click `"Make"`
  - This will build the project, now you can load and run it (see IAR Launch, Load and Run)

# Using makefiles

- When using makefiles to build, make sure you have built the example of interest using makefiles (see Using SDK with Makefiles)
- Given below is the command to build the "hello world example". Note, use `make` in Linux and MacOS

        cd ${SDK_INSTALL_PATH}
        gmake -s -C examples/hello_world/{board}/r5fss0-0_freertos/ti-arm-clang

- After the executable is built successfully, now you can load and run it (see CCS Launch, Load and Run)

# Rebuilding libraries

- When a CCS example project is built or a single example is built with makefiles, as described above, the libraries are not re-built.
- If you have modified any source or header file with a library, you need to rebuild the libraries using makefiles.
- By default the SDK when installed has all libraries pre-built, however if you want to rebuild the libraries, do below

        cd ${SDK_INSTALL_PATH}
        gmake -s libs PROFILE=debug      # for debug mode libraries
        # OR
        gmake -s libs PROFILE=release    # for release mode libraries

- See also Using SDK with Makefiles for more library build options and makefile tips.