3.10.1. Application Development on Remote Cores¶
This chapter so far has discussed about Linux development on the Cortex-A cores of the AM64x. This section will describe the process for developing RTOS or bare metal applications on the Cortex-R and Cortex-M cores of the SOC. Three main steps of this process will be covered:
Develop and debug a standalone application through CCS
Add IPC to the application
Launch the application from Linux.
An example will be provided to demonstrate this process.
For PRU development, please refer to PRU Training in the Processor SDK documentation.
3.10.1.1. Obtain MCU+ SDK and CCS¶
Just as the Processor SDK Linux is the foundational software for Linux development, the MCU+ SDK provided by TI assists RTOS and bare metal (or NORTOS) development. The MCU+ SDK can be downloaded from here. The MCU+ SDK documentation includes:
MCU+ SDK User Guide: contains detailed information about the SDK
MCU+ SDK Academy: contains step-by-step labs for getting started with the SDK
Code Composer Studio (CSS) is recommended for development and debugging on Cortex-R/Cortex-M cores. Please download CCS from here.
Once the MCU+ SDK and CCS are installed, please follow instructions here to setup the CCS and EVM. After the CCS and EVM are set up, development can start.
3.10.1.2. Build the LED Blink Example from the MCU+ SDK¶
Follow instructions here to build and run the LED example through CCS, either for the R5 core or the M4 core. Verify the configured LED on the EVM blinks according to the configuration of the example.
3.10.1.3. Add IPC to the LED Blink Program¶
In order to launch an R5/M4 application from Linux, IPC needs to be added to the application. Follow the MCU+ SDK User’s Guide on IPC to understand how to enable the IPC module.
For the LED blink example built and run in the previous step, IPC needs to be configured as shown below:
Now with IPC enabled, rebuild the LED blink program.
3.10.1.4. Launch the LED Blink Program from Linux¶
Disconnect the EVM from CCS and boot the EVM to Linux.
Please note that the boot mode switches need to be set properly depending on the booting media.
Once Linux is up, copy the .out file of the LED blink program to the /lib/firmware/pdk-ipc
folder in the Linux file system.
Now we can launch the program using the sysfs interface. Follow the steps at Booting Remote Cores from the Linux Console or User Space to update the remote core soft link to point to the led_blink.out binary.
Reboot the board in order to load new binaries onto the remote cores.
Now when Linux boots, the LED blink program will automatically run on the M4 core.
Note
To more easily observe the LED blinking, change the blinking loop to an infinite loop in C source file gpio_led_blink.c of the example.
To reduce the file size of the program when launched from Linux, we can strip the symbols from the .out file using CCS tool:
$ <CCS folder>/ccs/tools/compiler/ti-cgt-armllvm_1.3.0.LTS/bin/tiarmstrip -o=<new .out file> <original .out file>