Project

General

Profile

For TI SDK users, skip to A Getting Started Guide for the AM335x Series of System on Modules for TI SDK Release

Getting Started Guide for Yocto MDK September 2015 Release

First Steps

1. Install the latest MDK Release:

The Yocto MDK is released as a self-extracting installer for Linux systems. It includes a root filesystem, pre-built kernel, u-boot, and MLO images, and a self-contained toolchain for cross compilation. The release is built and tested using Ubuntu Precise 12.04 LTS.
- Download the current release: https://support.criticallink.com/redmine/attachments/download/9537/mitysom-335x-devkit-MDK-2015-11-18.sh
- Open a shell and run the self-extracting installer. It may be necessary to mark the file as executable.

chmod +x mitysom-335x-devkit-MDK-2015-11-18.sh
./mitysom-335x-devkit-MDK-2015-11-18.sh

- Select the installation directory and complete the installation. Default is /opt/criticallink/mitysom-335x_DATE

2. Install the git-core and subversion applications:
- Open a Terminal window on the host machine
- Run the command, or one appropriate for your machine: sudo apt-get install git-core subversion
- After the install is finished reboot the machine

To build the kernel, follow Linux Kernel for Kernel Build Instructions
To build U-boot, follow Das U-boot Port for U-boot Build Instructions

Building an example application

For making applications we recommend QT. Qt Starter Guide

To build a single c/c++ file

  • Source the toolchain
    source /opt/criticallink/mitysom-335x_DATE/environment-setup-cortexa8t2hf-vfp-neon-criticallink-linux-gnueabi
    
  • Replace your usual gcc/g++ command with the cross compile equivalent
    arm-criticallink-linux-gnueabi-cpp
    arm-criticallink-linux-gnueabi-g++
    arm-criticallink-linux-gnueabi-gcc
    
  • All the cross compile tools can be found in: /opt/criticallink/mitysom-335x_DATE/sysroots/i686-clsdk-linux/usr/bin/arm-criticallink-linux-gnueabi/

Basic Makefile

Note: Sourcing the toolchain will set the CC environment variable to the correct value

Makefile: The $(CC) line must have one tab for proper Makefile syntax.

HelloWorld: HelloWorld.c
     $(CC) -o HelloWorld HelloWorld.c

Useful Links

Critical Link's AM335x Wiki page - This page has an ever expanding base of knowledge that is updated regularly by our engineers
Critical Link Support Site - The main Critical Link Support Website

Getting Started Guide for TI SDK Release

First Steps

1. Download the MitySOM Virtual Machine Image for Virtual Box: https://support.criticallink.com/files/mityarm335x/mityarm-335x_SDK.ova
- VirtualBox is available here: https://www.virtualbox.org/wiki/Downloads

2. Set up the Virtual Machine (VM) by following this guide: https://support.criticallink.com/files/mityarm335x/readme.pdf
- The default username and password for this virtual machine is U: mitydsp and P: mitydsp
- If you are not asked to update the VirtualBox Guest Additions after the VM boots, manually update them by clicking the devices menu in the VirtualBox window, and clicking "Insert Guest Additions CD..." and follow the prompts on screen.

3. Install the git-core and subversion applications:
- Open a Terminal window on the virtual machine
- Run the command: sudo apt-get install git-core subversion
- Enter the password for the current user
- After the install is finished reboot the machine

Git Basics

Critical Link stores all of its up-to-date code on a public Git repository, so understanding basic git commands will be beneficial for keeping your software versions current. If you are familiar with Git already, skip this section.

Useful commands
git status - informs you of the condition of the working directory.
git fetch - updates the local repository with all of the changes since its last update. DOES NOT AFFECT LOCAL FILES
git pull - updates the local repository with all of the changes since its last update PLUS merges the changes from the updates repository into the local files.
git branch - view available local branches. Adding "-a" will show all available branches, including remote ones
git checkout - change to a different local branch.
git checkout -b [name of local branch] [name of remote branch] - change to a remote branch and store a local copy

More git resources

Interactive git cheatsheet
Git from the Bottom Up

Fix toolchain environment-setup script

  • Open a terminal.
  • Open the /usr/local/ti-sdk-am335x-evm-05.03.02.00/linux-devkit/environment-setup file in the gedit text editor
    sudo gedit /usr/local/ti-sdk-am335x-evm-05.03.02.00/linux-devkit/environment-setup
    
  • Comment out line 10 by placing a hash-tag '#' at the beginning of the line
  • Line 10 should now read: "# export SDK_PATH=/export/space/ti-sdk-am335x-evm-05.03.02.00/linux-devkit"
  • Save file and close gedit

Building the Latest Linux Kernel

This guide assumes you have successfully booted the VM and are logged into the desktop

  • Open a terminal window (Ubuntu 10.04: There is an icon on the top menu bar. Ubuntu 12.04: Open the Ubuntu menu and search for terminal)
  • In the terminal window, navigate to the projects directory on the VM
    cd ~/projects/
  • In the projects directory there are four existing folders. Navigate to the Linux Kernel directory
    cd linux-mityarm-335x/
  • Pull the updated repository of the Linux Kernel from Git
    git pull
  • Checkout the newest Kernel version and create a local branch.
    NOTE: You can view all available branches by running: git branch -a
    git checkout -b mityarm-linux-v3.2 origin/mityarm-linux-v3.2
  • Verify the correct branch was checked out
    git status

    A successful checkout will be confirmed by output similar to this:
    mitydsp@mitydsp-dev:~/projects/linux-mityarm-335x$ git status
    # On branch mityarm-linux-v3.2
    nothing to commit (working directory clean)
    
  • Download the latest am335x power management binary from Texas Instruments. INCLUDE THE PARENTHESIS
    NOTE: This step is only necessary for Kernel version 3.2
    (cd firmware; rm am335x-pm-firmware.bin; wget --content-disposition "http://arago-project.org/git/projects/?p=am33x-cm3.git;a=blob_plain;f=bin/am335x-pm-firmware.bin;hb=refs/heads/master")
  • Source the cross-compile toolchain from the TI-SDK.
    source /usr/local/ti-sdk-am335x-evm-05.03.02.00/linux-devkit/environment-setup
  • Configure the Kernel for the MitySOM Devkit
    make ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- mityarm-335x-devkit_defconfig
  • Build the uImage of the Kernel. If your VM has more than one core, adding -j#, where # is the number of cores, will speed up the build process
    make ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- uImage

    Once the kernel is done building, you will see output similar to below:
    Image Name:   Linux-3.2.0-00217-g3c4aa5c
    Created:      Mon Feb  3 09:39:45 2014
    Image Type:   ARM Linux Kernel Image (uncompressed)
    Data Size:    3725888 Bytes = 3638.56 kB = 3.55 MB
    Load Address: 0x80008000
    Entry Point:  0x80008000
      Image arch/arm/boot/uImage is ready
    
  • Build and install the Kernel Modules
    The variable INSTALL_MOD_PATH MUST BE SET otherwise the files will be installed onto the local machine's filesystem. The path specified by the commands below will install the files in the projects directory under ~/projects/rootfs/.

    Build Modules

    make INSTALL_MOD_PATH=../rootfs ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- modules

    Install Modules
    make INSTALL_MOD_PATH=../rootfs ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- modules_install

The Kernel and its modules are now built. The uImage file used for boot is located in ~/projects/linux-mityarm-335x/arch/arm/boot/, and the Kernel modules are in ~/projects/rootfs. The Kernel modules will need to be copied on top of the root filesystem that is used with the Kernel.

For more information about the Linux Kernel follow this link: https://support.criticallink.com/redmine/projects/armc8-platforms/wiki/Linux_Kernel

Building the Latest U-Boot

  • Open a terminal window (Ubuntu 10.04: There is an icon on the top menu bar. Ubuntu 12.04: Open the Ubuntu menu and search for terminal)
  • In the terminal window, navigate to the projects directory
    cd ~/projects/
  • In the projects directory there are four existing folders. Navigate to the U-Boot directory
    cd u-boot-mityarm-335x/
  • Pull the updated repository of U-Boot from Git
    git pull
  • Checkout the latest U-Boot and create a local branch
    git checkout -b u-boot-2013.10 origin/u-boot-2013.10
  • Verify the correct branch was checked out
    git status

    A successful checkout will be confirmed by output similar to this:
    mitydsp@mitydsp-dev:~/projects/u-boot-mityarm-335x$ git status
    # On branch u-boot-2013.10
    nothing to commit (working directory clean)
    
  • If it hasn't been done already, Source the cross-compile toolchain from the TI-SDK
    source /usr/local/ti-sdk-am335x-evm-05.03.02.00/linux-devkit/environment-setup
  • Configure and build U-Boot for the SoM you have
    U-Boot must be configured based on your System on a Module's (SoM) NAND size. You can figure out how you need to configure U-Boot with this link, starting on line 19, to find your NAND size based on model number.
    For NAND sizes 512MB or larger, use the following command:
    make ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- mityarm335x_4kpage

    For all other modules, use this command:
    make ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- mityarm335x

U-Boot is now built. The MLO and u-boot.img files needed for boot are located in the U-Boot build directory, ~/projects/u-boot-mityarm-335x/

For more information about u-boot follow this link: https://support.criticallink.com/redmine/projects/armc8-platforms/wiki/Das_U-Boot_Port

Updating your SD Card

With your development kit you were provided an SD card. This card comes with a fully operational Linux OS pre-installed. This includes the u-boot.img, uImage, and kernel module files that were just built above.

  • Use an SD Card reader to connect the SD card to your computer. If you plug the card reader in and don't see any window pop up, check to see if the device was see by the VM by going to the "Devices" drop down menu in the virtual box window and checking the USB devices. If your card reader doesn't have a check mark next to it, click it and the device will connect to virtual box.
  • Find the mount point of the sd card by running
    df

    you sould get similar output as seen below
    mitydsp@mitydsp-dev:~$ df
    Filesystem           1K-blocks      Used Available Use% Mounted on
    /dev/sda1            118779164  61357084  51388416  55% /
    none                   1026520       284   1026236   1% /dev
    none                   1030756       252   1030504   1% /dev/shm
    none                   1030756      1836   1028920   1% /var/run
    none                   1030756         0   1030756   0% /var/lock
    none                   1030756         0   1030756   0% /lib/init/rw
    /dev/sdc3              2822496     69828   2609288   3% /media/START_HERE
    /dev/sdc1                71133      4139     66995   6% /media/boot
    /dev/sdc2               909168    658896    204088  77% /media/rootfs

    In this case, the SD card's rootfs and boot partition were mounted in the /media folder.
  • The following commands will copy the Linux Kernel and u-boot images to the boot partition of the SD card.
    NOTE: It is recommended to back up the stock images that came on the SD card. Do this with the following commands (assuming a mount point in /media/boot)
    cp /media/boot/u-boot.img /media/boot/u-boot.img.stock
    cp /media/boot/MLO /media/boot/MLO.stock
    cp /media/boot/uImage /media/boot/uImage.stock

    Copy new images (THESE COMMANDS WILL OVERWRITE THE OLD IMAGES)
    cp ~/projects/u-boot-mityarm-335x/u-boot.img /media/boot
    cp ~/projects/u-boot-mityarm-335x/MLO /media/boot
    cp ~/projects/linux-mityarm-335x/arch/arm/boot/uImage /media/boot
  • Copy the kernel modules to the rootfs partition
    sudo cp -r ~/projects/rootfs/* /media/rootfs

The SD card will now have the latest Linux Kernel with modules and u-boot versions recommended by Critical Link.

For more information about the filesystem follow this link: https://support.criticallink.com/redmine/projects/armc8-platforms/wiki/Root_Filesystem

Building an example application

For making applications we recommend QT. Qt Starter Guide
For information on using Code composer to build software, checkout this TI guide. http://processors.wiki.ti.com/index.php/Code_Composer_Studio_v5_Users_Guide

To build a single c/c++ file

  • Source the toolchain
    source /usr/local/ti-sdk-am335x-evm-05.03.02.00/linux-devkit/environment-setup
    
  • Replace your usual gcc/g++ command with the cross compile equivalent
    arm-arago-linux-gnueabi-cpp
    arm-arago-linux-gnueabi-g++
    arm-arago-linux-gnueabi-gcc
    
  • All the cross compile tools can be found in: /usr/local/ti-sdk-am335x-evm-05.03.02.00/linux-devkit/bin

Basic Makefile

Note: Sourcing the toolchain will set the CC environment variable to the correct value

Makefile: The $(CC) line must have one tab for proper Makefile syntax.

HelloWorld: HelloWorld.c
     $(CC) -o HelloWorld HelloWorld.c

Useful Links

Critical Link's AM335x Wiki page - This page has an ever expanding base of knowledge that is updated regularly by our engineers
Critical Link Support Site - The main Critical Link Support Website

Go to top
Add picture from clipboard (Maximum size: 1 GB)