Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This Quickstart provides you with the know-how to install and work with the RTOS Board Support Package (BSP) for the phyCORE-AM572x Rapid Development Kit (RDK). This Quickstart shows you how to do everything from installing the appropriate tools and source, to creating RTOS projects and debugging them through JTAG. Please refer to the phyCORE-AM572x Hardware Manual for specific information on board-level features such as jumper configuration, memory mapping and pin layout for the phyCORE-AM572x System on Module (SOM) and baseboard. Additionally, gain access to the SOM and baseboard schematics for the phyCORE-AM57x Rapid Development Kit by submitting a Request for Schematic Files from the PHYTEC Service Desk. Sign up or login here: PHYTEC Support Portal.

Table of Contents
outlinetrue

Anchor
Requirements
Requirements
Requirements

...

The following system requirements are necessary to successfully complete this Quickstart. Deviations from these requirements may suffice, or may have other workarounds.

Hardware

  • phyCORE-AM572x System on Module (PCM-057)
  • phyCORE-AM572x Baseboard (PCM-948)
  • Serial cable (RS-232)
  • JTAG Emulator (Spectrum Digital XDS200 USB JTAG Emulator is used in this Quickstart)
  • AC adapter supplying 12VDC / min. 2A

  • 1GB or larger SD Card
  • SD card reader operational under Linux
    • If you do not have SD card access under Linux then interacting with the board will only be possible through the JTAG interface.

Software

  • A modern GNU/Linux Operating host system either natively or via a virtual machine:
    • Ubuntu 16.04 LTS recommended, 64-bit required. Other distributions will likely work, please note that some setup information as well as OS-specific commands and paths may differ.
    • If using a virtual machine, VMWare Workstation, VMWare Player, and VirtualBox are all viable solutions.
  • Root access to your Linux Host PC. Some commands in the Quickstart will not work if you don’t have sudo access (ex. package installation, formatting SD card).
  • At least 50GB of free storage space if building BSP from source or 15GB if using pre-built BSP.
  • Active Internet connection.

Anchor
DevelopmentHostSetup
DevelopmentHostSetup
Development Host Setup

...

Anchor
InstallHostDebianPackages
InstallHostDebianPackages
Install Host Debian Packages

Installing the RTOS BSP requires certain packages to be installed. Run the following command to ensure you have the packages installed:

Code Block
sudo apt-get install libc6:i386 mono-runtime wget


Note

Above is the recommended package installation for following this Quickstart on a Ubuntu 16.04 LTS Linux distribution. The names of the packages that provide the required software and libraries may differ in other Linux distributions.

Create an Install Directory

Run these commands to create a directory which will house your RTOS BSP. In this Quickstart, the PHYTEC base directory is /opt/PHYTEC_BSPs and the RTOS BSP directory is /opt/PHYTEC_BSPs/rtos_ti/install. This RTOS BSP directory is not a hard requirement, so feel free to modify the following commands to suit your needs.

...

Note

$RTOS_INSTALL_ROOT is referenced throughout this document. If you use a different directory instead of what is here, be sure to configure this variable accordingly.

Get Started With the Pre-Built RTOS BSP

...

This section is intended to walk you through the steps required to retrieve, extract, and start working with the pre-built RTOS BSP.

Note

If you made it this far without first visiting and following the information provided in the BSP-RTOS-TI-AM57x-PD17.1.0 QuickstartRequirements and Development Host Setup sections, please follow those links and return when your configuration meets the requirements and your environment is ready.

Connector Interfaces

Use the following as a reference for the connector interfaces on the phyCORE-AM572x Rapid Development Kit that will be used in this Quickstart:


Retrieve and Extract the Pre-Built RTOS BSP

Run these commands to download and extract the pre-built RTOS BSP:

Code Block
wget http://artifactory.phytec.com/artifactory/am57xx-images-released-public/BSP-RTOS-TI-AM57x-PD17.1.01.tar.bz2
tar -jxf BSP-RTOS-TI-AM57x-PD17.1.01.tar.bz2 -C $RTOS_INSTALL_ROOT

...

Info

Optional command to free up disk space:

Code Block
rm -f BSP-RTOS-TI-AM57x-PD17.1.01.tar.bz2


Anchor
InstallCCS
InstallCCS
Install Code Composer Studio

Code Composer Studio (CCS) is an Eclipse-based integrated development environment (IDE) offered by Texas Instruments for TI embedded processors. The recommended CCS version for this RTOS BSP is 7.2.0. Run these commands to download and install CCS:

...

Info

Optional command to free up disk space:

Code Block
rm -f CCS7.2.0.00013_web_linux-x64.tar.gz


Anchor
InstallCCSConfigurationFiles
InstallCCSConfigurationFiles
Install Code Composer Studio Configuration Files

PHYTEC provides files to help ease the CCS configuration process when targeting the phyCORE-AM57x RDK. Run these commands to install these files for use with CCS:

...

Note

If you installed CCS into a directory other than the one recommended above, you must change the path in the above command to reflect your CCS directory.

Prepare SD Card for Boot

We recommend that you use an SD card populated with the RTOS BSP secondary bootloader (SBL) so that the phyCORE-AM572x RDK hardware is configured (pinmux, clocks, etc.) by the RTOS board support library.

...

Info

If you would like to add a small suite of interface diagnostic applications to the SD card, run these commands with your formatted SD card mounted on your PC:

Code Block
cd $RTOS_INSTALL_ROOT/pdk_am57xx_1_0_8/packages

# set up the environment for building the diagnostic applications
source pdksetupenv.sh

cd $RTOS_INSTALL_ROOT/pdk_am57xx_1_0_8/packages/ti/board/diag
make am572x_phycore_rdk_sd
cd $RTOS_INSTALL_ROOT/pdk_am57xx_1_0_8/packagispackages/ti/board/bin/am572x_phycore_rdk/sd

# In the following command, replace <user> with your host's username
cp * /media/<user>/boot/
sync



Anchor
CreateSimpleCCSProject
CreateSimpleCCSProject
Create a Simple Code Composer Studio Project

You will now create a simple CCS project to test your JTAG connection to the phyCORE-AM572x RDK.

...

  1. Set Target to AM572x - Cortex A15 and the secondary Target field to AM572X_PHYCORE_RDK.

    Note

    If AM572X_PHYCORE_RDK isn't a selectable option in the secondary Target field, it is likely that the am572x_phycore_rdk.xml file was not correctly installed in the BSP-RTOS-TI-AM57x-PD17.1.0 Quickstart step. Please review Install CCS Configuration Files step. Please review this step and try again after restarting CCS.


  2. Set Connection to Texas Instruments XDS2xx USB Debug Probe.
  3. Click the Cortex A [ARM] tab and set your project name to hello_world.
  4. Under Advanced Settings, set Linker command file to AM572x.lds.
  5. Under Project templates and examples, select Hello World from the Basic Examples section.
    Your New CCS Project window should now look similar to this screenshot:
  6. Click Finish.

Build and Debug the Simple Code Composer Studio Project

Building and debugging this simple CCS project is a relatively easy process. Follow these steps to ensure your build environment is set up correctly and that you are able to debug your project through the JTAG interface.

...

  1. Ensure that you have a target configuration file in your project set to Active/Default. If you followed the steps in the Create a Simple Code Composer Studio Project section, this file (AM572X_PHYCORE_RDK.ccxml by default) and setting will be created for you.

    To create a target configuration file manually, right click the hello_world project name in the Project Explorer window and click New → Target Configuration File. Select AM572X_PHYCORE_RDK in the Board or Device list and click Save under Save Configuration.

    Warning

    Due to a bug in the Sitara Device Support package installed with the recommended version of CCS, you will likely need to modify the target configuration file before your project will build. To do so, open the target configuration file (AM572X_PHYCORE_RDK.ccxml by default) from your Project Explorer window. Click the Advanced tab at the bottom of the Target Configuration window. Note that the third and fourth ICECrusherCS entries have duplicate names. Rename the third ICECrusherCS entry to ICECrusherCS_2 and the fourth ICECrusherCS entry to ICECrusherCS_3 and save the target configuration.


  2. Open your project's target configuration file from the Project Explorer window.

...

  1. If all of the previous steps have been followed correctly, the hello_world program will be paused at an automatically generated breakpoint at line 7 of hello.c. Click the Resume button located in the top toolbar.
  2. You should see "[CortexA15_0] Hello World!" in the Console window just like this screenshot:

Generate Example Code Composer Studio Projects

...

Included with this RTOS BSP is a number of configuration files that can be used to generate importable CCS projects for reference and interface testing. This section will explain how to generate and import these CCS projects.

Generate Example Projects

The Platform Development Kit (PDK) provides a script to search through the PDK and generate importable CCS projects if it finds configuration files that match the arguments given to the script. Run these commands to generate these projects:

...

Within your current directory you should now have a new subdirectory called MyExampleProjects that contains an additional subdirectory for each found configuration file that matches the arguments given to the pdkProjectCreate.sh script.

Import and Configure Example Projects

To import the example projects, start by opening CCS.

...

Your imported project should now be ready to build and debug.

Rebuild the Platform Development Kit After Modification

Build the RTOS BSP from Source

...

The Platform Development Kit (PDK) contains the majority of the board and hardware-specific drivers and libraries and, when modified, will need to be rebuilt before use. This section will explain how to rebuild the PDK component of the download and build from the RTOS BSP .

Info

The phyCORE-AM572x RDK board support library source files are located at $RTOS_INSTALL_ROOT/pdk_am57xx_1_0_8/packages/ti/board/src/am572x_phycore_rdk. This is likely the best place to start when modifying the board support library to suit your needs. Two other locations look into are the chip-support library at $RTOS_INSTALL_ROOT/pdk_am57xx_1_0_8/packages/ti/csl and the drivers at $RTOS_INSTALL_ROOT/pdk_am57xx_1_0_8/packages/ti/drv.

Run the following commands to clean and build the entirety of the PDK:

Code Block
cd $RTOS_INSTALL_ROOT/pdk_am57xx_1_0_8/packages

# set up the environment for building the PDK
source pdksetupenv.sh

make clean
make all
Info

You can also clean and make individual components of the PDK from the above directory. The following make targets are supported by the included makefile: csl profiling board emac fatfs gpio i2c mcasp mmcsd nimu osal pm spi uart icss-emac nimu-icss pcie sbl usb vps pruss. To clean one of the listed, append _clean to the end of the target component that you want to clean when running make.

Build the RTOS BSP from Source

This section will explain how to download and build from the RTOS BSP sources. Please note that this is not a required procedure but the steps and scripts to build the BSP from source are offered here for reference.

Note

If you made it this far without first visiting and following the information provided in the BSP-RTOS-TI-AM57x-PD17.1.0 Quickstart and BSP-RTOS-TI-AM57x-PD17.1.0 Quickstart sections, please follow those links and return when your configuration meets the requirements and your environment is ready.

Configure Bash as Default Shell

By default, Ubuntu 16.04 uses the Debian Almquist Shell (dash) for calls to the Bourne Shell (sh). This will cause issues in building certain RTOS BSP components as some of Dash's built-in commands do not support all of the required options. To ensure your system uses Bash over Dash for calls to /bin/sh, run this command:

Code Block
sudo dpkg-reconfigure dash

Select <No> when prompted to use dash as the default system shell (/bin/sh).

Install Additional Host Debian Packages

Building the RTOS BSP from source requires additional packages to be installed. Run the following command to ensure you have the packages installed:

Code Block
sudo apt-get install build-essential cmake curl doxygen git libboost-dev libloki-dev libtinfo-dev unzip
Note

The above is the recommended package installation for development on a Ubuntu 16.04 LTS Linux distribution. The names of the packages that provide the required software and libraries may differ in other Linux distributions. Also note that these packages are required in addition to those listed in the Install Host Debian Packages section.

Install the Linaro Toolchain

Run the following commands to install the Linaro Toolchain:

Code Block
wget https://releases.linaro.org/components/toolchain/binaries/5.3-2016.02/arm-linux-gnueabihf/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf.tar.xz
tar -Jxvf gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf.tar.xz -C /opt/PHYTEC_BSPs
rm gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf.tar.xz

After extracting the toolchain, it needs to be added to the host's PATH to properly use it for building:

Code Block
export PATH=/opt/PHYTEC_BSPs/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf/bin:$PATH
Info

To make this change last beyond your current terminal session, use a text editor to modify your ~/.bashrc file and add the above command to the end of the file.

Install the Repo Tool

The repo tool is used to obtain RTOS BSP sources from Git. Run the following commands to install the repo tool:

Code Block
sudo mkdir -p /opt/bin

# In the following command, replace <user> with your host's username
sudo chown -R <user>:<user> /opt/bin

curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > /opt/bin/repo
chmod a+x /opt/bin/repo

After installing the repo tool, it needs to be added to the host's PATH to use it for downloading sources:

Code Block
export PATH=/opt/bin:$PATH
Info

To make this change last beyond your current terminal session, use a text editor to modify your ~/.bashrc file and add the above command to the end of the file.

Git Setup

If you have not yet configured your Git environment on this machine, please run the following commands to set your user name and email address. See here for more information on getting started with Git.

Code Block
git config --global user.email "your@email.com"
git config --global user.name "Your Name"
git config --global http.sslcainfo /etc/ssl/certs/ca-certificates.crt

Create a Build Directory

A separate directory from the standard install directory is required to build the RTOS BSP from source. Run these commands:

Code Block
mkdir -p /opt/PHYTEC_BSPs/rtos_ti/build
cd /opt/PHYTEC_BSPs/rtos_ti/build
export RTOS_BUILD_ROOT=`pwd`
Note

$RTOS_BUILD_ROOT is referenced throughout this section. If you use a different directory instead of what is here, be sure to configure this variable accordingly.

Download the BSP Sources

Download the manifest file for the AM57x RTOS PD17.1.0 BSP:

Code Block
cd $RTOS_BUILD_ROOT
repo init -u https://stash.phytec.com/scm/tirtos/manifests-phytec.git -b am57x -m BSP-RTOS-TI-AM57x-PD17.1.0.xml

Download the RTOS BSP sources specified in the manifest file:

Code Block
repo sync

Start the Build and Install

The RTOS build and install script will download and install components not offered through Git as well as build and install components sourced through the above manifest. Run the following commands to start the build:

Code Block
cd $RTOS_BUILD_ROOT
./rtos-build-install.sh

sources. Please note that this is not a required procedure but the steps and scripts to build the BSP from source are offered here for reference.

Note

If you made it this far without first visiting and following the information provided in the Requirements and Development Host Setup sections, please follow those links and return when your configuration meets the requirements and your environment is ready.

Configure Bash as Default Shell

By default, Ubuntu 16.04 uses the Debian Almquist Shell (dash) for calls to the Bourne Shell (sh). This will cause issues in building certain RTOS BSP components as some of Dash's built-in commands do not support all of the required options. To ensure your system uses Bash over Dash for calls to /bin/sh, run this command:

Code Block
sudo dpkg-reconfigure dash

Select <No> when prompted to use dash as the default system shell (/bin/sh).

Install Additional Host Debian Packages

Building the RTOS BSP from source requires additional packages to be installed. Run the following command to ensure you have the packages installed:

Code Block
sudo apt-get install build-essential cmake curl doxygen git libboost-dev libloki-dev libtinfo-dev unzip


Note

The above is the recommended package installation for development on a Ubuntu 16.04 LTS Linux distribution. The names of the packages that provide the required software and libraries may differ in other Linux distributions. Also note that these packages are required in addition to those listed in the Install Host Debian Packages section.

Install the Linaro Toolchain

Run the following commands to install the Linaro Toolchain:

Code Block
wget https://releases.linaro.org/components/toolchain/binaries/5.3-2016.02/arm-linux-gnueabihf/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf.tar.xz
tar -Jxvf gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf.tar.xz -C /opt/PHYTEC_BSPs
rm gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf.tar.xz

After extracting the toolchain, it needs to be added to the host's PATH to properly use it for building:

Code Block
export PATH=/opt/PHYTEC_BSPs/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf/bin:$PATH


Info

To make this change last beyond your current terminal session, use a text editor to modify your ~/.bashrc file and add the above command to the end of the file.

Install the Repo Tool

The repo tool is used to obtain RTOS BSP sources from Git. Run the following commands to install the repo tool:

Code Block
sudo mkdir -p /opt/bin

# In the following command, replace <user> with your host's username
sudo chown -R <user>:<user> /opt/bin

curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > /opt/bin/repo
chmod a+x /opt/bin/repo

After installing the repo tool, it needs to be added to the host's PATH to use it for downloading sources:

Code Block
export PATH=/opt/bin:$PATH


Info

To make this change last beyond your current terminal session, use a text editor to modify your ~/.bashrc file and add the above command to the end of the file.

Git Setup

If you have not yet configured your Git environment on this machine, please run the following commands to set your user name and email address. See here for more information on getting started with Git.

Code Block
git config --global user.email "your@email.com"
git config --global user.name "Your Name"
git config --global http.sslcainfo /etc/ssl/certs/ca-certificates.crt

Create a Build Directory

A separate directory from the standard install directory is required to build the RTOS BSP from source. Run these commands:

Code Block
mkdir -p /opt/PHYTEC_BSPs/rtos_ti/build
cd /opt/PHYTEC_BSPs/rtos_ti/build
export RTOS_BUILD_ROOT=`pwd`


Note

$RTOS_BUILD_ROOT is referenced throughout this section. If you use a different directory instead of what is here, be sure to configure this variable accordingly.

Download the BSP Sources

Download the manifest file for the AM57x RTOS PD17.1.x BSP:

Code Block
cd $RTOS_BUILD_ROOT
repo init -u https://stash.phytec.com/scm/tirtos/manifests-phytec.git -b am57x -m BSP-RTOS-TI-AM57x-PD17.1.1.xml

Download the RTOS BSP sources specified in the manifest file:

Code Block
repo sync

Start the Build and Install

The RTOS build and install script will download and install components not offered through Git as well as build and install components sourced through the above manifest. Run the following commands to start the build:

Code Block
cd $RTOS_BUILD_ROOT
./rtos-build-install.sh


Note

By default, the RTOS build and install script will place the built RTOS BSP into /opt/PHYTEC_BSPs/rtos_ti/install. If you would like to place the RTOS BSP elsewhere, export SDK_INSTALL_PATH to your desired absolute path before running the build and install script. Make sure that the path you choose exists and that your user has read and write permissions for that path.

Rebuild the Platform Development Kit After Modification

...

The Platform Development Kit (PDK) contains the majority of the board and hardware-specific drivers and libraries and, when modified, will need to be rebuilt before use. This section will explain how to rebuild the PDK component of the RTOS BSP.

Info

The phyCORE-AM572x RDK board support library source files are located at $RTOS_INSTALL_ROOT/pdk_am57xx_1_0_8/packages/ti/board/src/am572x_phycore_rdk. This is likely the best place to start when modifying the board support library to suit your needs. Two other locations look into are the chip-support library at $RTOS_INSTALL_ROOT/pdk_am57xx_1_0_8/packages/ti/csl and the drivers at $RTOS_INSTALL_ROOT/pdk_am57xx_1_0_8/packages/ti/drv.

Run the following commands to clean and build the entirety of the PDK:

Code Block
cd $RTOS_INSTALL_ROOT/pdk_am57xx_1_0_8/packages

# set up the environment for building the PDK
source pdksetupenv.sh

make clean
make all


Info

You can also clean and make individual components of the PDK from the above directory. The following make targets are supported by the included makefile: csl profiling board emac fatfs gpio i2c mcasp mmcsd nimu osal pm spi uart icss-emac nimu-icss pcie sbl usb vps pruss. To clean one of the listed, append _clean to the end of the target component that you want to clean when running make

Note

By default, the RTOS build and install script will place the built RTOS BSP into /opt/PHYTEC_BSPs/rtos_ti/install. If you would like to place the RTOS BSP elsewhere, export SDK_INSTALL_PATH to your desired absolute path before running the build and install script. Make sure that the path you choose exists and that your user has read and write permissions for that path.

Additional Documentation

...

Texas Instruments offers documentation that can be used as reference or for guidance in effectively using the RTOS BSP:

Texas Instruments Processor SDK RTOS Software Developer Guide

Texas Instruments Processor SDK RTOS Getting Started Guide