AM261x MCU+ SDK: IAR Launch, Load and Run

| AM261x MCU+ SDK 26.00.00 |

IAR Launch, Load and Run

Note
  The steps on this page should be done each time EVM is power cycled or when a new IAR session is started.

# Prerequisites

A quick recap of the steps that need to have been done before you proceed

- Make sure you have installed IAR Embedded Workbench as mentioned in Download, Install and Setup IAR Embedded Workbench
- Make sure the UART port used for console is identified as mentioned in Setup UART Terminal
- Make sure you have the EVM power cable, JTAG cable, UART cable connected as shown in Cable Connections
- Make sure you have done the steps for a SOC initialization method SOC Initialization using the Binary Flashed in OSPI memory
- Make sure EVM boot mode switch is setup correctly based on the SOC initilization method
  - For the RECOMMENDED method, SOC Initialization using the Binary Flashed in OSPI memory, the boot mode should be OSPI BOOT MODE
- Make sure the UART logs on doing EVM POWER-ON indicate that SOC initization is successful
- Make sure you have built the example of interest as mentioned in Build a Hello World example

# Load and run example binaries in IAR Embedded Workbench

- Launch IAR Embedded Workbench IDE
- POWER-ON the EVM
- Make sure the `SBL NULL` is flashed on the board, and ensure the UART logs of SBL NULL get printed. Refer IAR Embedded Workbench Does Not Support GEL Scripts
- When using IAR EW for build
  - Open the workspace and project need to be flashed.
  - Build the project.
  - Navigate to Toolbar > `Project` > `Download and Debug`

Download and Debug Program

- Now the program will be halted at `main()`
- Navigate to Toolbar > `View` > `Terminal IO` to open the terminal to view the console logs

Terminal IO

- Click Go button on the toolbar to run the program and debug using various IAR debug options.

Debug Options

- The program output can be seen on the UART and Terminal log.
- Below shows the output of the "hello world" example

Hello world program output

- When using Makefile for build
  - Open any existing project
  - Right click on the project and select the option Add external binary and browse to the .out file location.
    Add external binary
  - Now the binary is loaded to the project, Right click on the .out file and make sure the "Set as Debug Target" is enabled.
    Set Target binary for debug
  - Click on Project > Download and Debug to load the binary. Continue as the steps in the previous section.