AM261x MCU+ SDK: CCS Launch, Load and Run

| AM261x MCU+ SDK 26.00.00 |

CCS Launch, Load and Run

Note
  The steps on this page should be done each time EVM is power cycled or when a new CCS session is started.
  The screenshots shown are for AM263PX but can be similarly used for AM261X.

# Prerequisites

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

- Make sure you have installed CCS as mentioned in Download, Install and Setup CCS
- 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
  - RECOMMENDED method is SOC Initialization using the Binary Flashed in OSPI memory
  - Other options, if recommended method cannot be used, are mentioned in SOC Initialization
- 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 or CCS console 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

# Launch CCS

- Launch the target configuration created with Create Target Configuration

Launch Target Configuration

Note
  When debugging an application with SBL NULL, ensure the Target configuration is created without an Initialization script.

- You will see the AM261X target configuration in the "Debug" window as shown below

Target Configuration After Launch

# Load and run example binaries in CCS

- POWER-ON the EVM
- If you dont see the expected SOC initialization logs on UART or CCS console, then recheck your EVM Setup
- Connect the target CPU of interest if not already connected. For the "hello world" example this is `MAIN_Cortex_R5_0_0`

Connect CPU

- This should initialize the device and initialize R5 to be able to connect
  GEL Output
- Reset the CPU

Reset CPU

- Load program on the CPU

Load Program

- When using makefiles to build,
  - In the "Load Program" dialog, select "Browse" and select the program from `examples/{example folder}/{board}/{cpu}_{os}/{compiler}` as shown below for the "hello world" program.

Select Program for Makefile Build

- When using CCS projects,
  - In the "Load Program" dialog, select "Workspace", select the project and then select the program as shown below,

Select Program for CCS Projects Build

Select the Program from CCS Project

- After the program is loaded, you will see the program is halted at "main" as shown below

Program at main()

- Depending on the example you are running, you may need to load more programs on other CPUs for the example to work as expected. Typically, this is needed for multi-core interprocessor communication (IPC) examples. For the "hello world" program shown above, no more programs need to be loaded.
- Select "Resume" to run the program and debug using the various CCS debug options

      \htmlonly <style>div.image img[src="ccs_load_run_07_am26.png"]{width:30%}</style>\endhtmlonly
      \image html ccs_load_run_07_am26.png "Load Program"

- The program output will be seen on CCS console, and/or UART terminal, if enabled. Below shows a sample output on both CCS console and UART console, after running the "hello world" program.

Run the Program

# Re-load and run example binaries

- Here simply repeat the steps shows in Load and run example binaries in CCS
- It is especially important to "reset the CPU" before reloading the program.
- In most cases, you dont need to power-cycle the EVM to reload the program or load a new program.
- In some cases, depending on whether the previous program execution was successful or not, the CPU or some SOC peripheral may be in a exception or hang state. In this case program reload may not work.
  - SOLUTION: Power cycle the EVM and repeat all steps shown on this page.