Actions

EmSys

Hardware And Software Setup

From EdWiki

Hardware And Software Setup


What is Toolchain?

  • A toolchain is a collection of programming tools.
  • It consists of a compiler, linker, assembler, and a debugger.
  • The GNU toolchain is a programming tools produced by the GNU Project.


Toolchain

The toolchain used for embedded development is a cross toolchain (cross compiler). In other words, when the host and target architectures are different, the toolchain is called a cross compiler (e.g. if we develop a code on a Linux machine based on the x64 architecture, but we're compiling for an ARM target, then we need Linux-based ARM-targeting cross compiler).

Host and Target


When talking about toolchains, one must distinguish three different machines:

  • the build machine, on which the toolchain is built
  • the host machine, on which the toolchain is executed
  • the target machine, for which the toolchain generates code


Toolchain - Name convention

Toolchain has a name convention:

arch[-vendor][-os]-abi
  • arch - architecture
    arm, mips, x86, i686, etc.
  • vendor - tool chain supplier
  • os - operating system
    linux, none (bare metal)
  • abi - application binary interface
    eabi, gnueabi, gnueabihf

Examples

arm-none-eabi

This toolchain targets the ARM architecture, has no vendor, does not target an operating system (i.e. targets a "bare metal" system), and complies with the ARM eabi. (Note) arm-elf and arm-none-eabi just use two versions of the ARM abi. The eabi toolchain uses a newer revision, but could also be called arm-elf-eabi, as it generates elf too.

i686-apple-darwin10-gcc-4.2.1

This toolchain targets the Intel i686 architecture, the vendor is Apple, and the target OS is Darwin version 10.

arm-none-linux-gnueabi

The toolchain that can be installed in Debian-based systems using a package manager like apt (the package is called gcc-arm-linux-gnueabi). This toolchain targets the ARM architecture, has no vendor, creates binaries that run on the Linux operating system, and uses the GNU EABI. In other words, it is used to target ARM-based Linux systems.

arm-linux-gcc

This is actually binary for gcc which produces objects for ARM architecture to be run on Linux with default configuration (abi) provided by toolchain.

i686-unknown-linux-gnu

32-bit GNU/linux

arm-eabi

Android ARM compiler

x86_64-w64-mingw32

x86_64 architecture means AMD64, w64 is actually mingw-w64 used as a "vendor" here, mingw32 is the same as win32 API for gcc's perspective.

i686-pc-msys

32-bit, "pc" is a generic name, msys binary

Code Composer Studio

Code Composer Studio includes a Linaro distribution of the ARM GNU compiler, so programmers have the option of using this GCC Compiler instead of the TI compiler to build their projects.

Objective

The objective of this lab exercise is to download and install Code Composer Studio, as well as download the various other support documents and software to be used with this course. These development tools will be used throughout the remaining lab exercises in this course.

CCS v9 - Hardware Requirements

Memory Recommended
Memory 2GB 6GB
Disk Space 900MB 2GB average (1 or 2 device families) 3.5GB all features
Processor 1.0GHz x86 compatible processor Dual core x86 compatible processor
Table: CCS v9 - Hardware Requirements


  • Disk space listed depends on features selected during installation. 900MB is for a bare minimal installation. Does not include temporary space required by the installer.
  • Note that the most important requirement is memory. At least 4GB of memory or more is highly recommended.

CCS v9 - Operating System Requirements

  1. Windows
    Windows 7 (SP1 or later), Windows 8.x and Windows 10
  2. Ubuntu 18.04 LTS
    update system and Install dependent libraries
sudo apt-get update
sudo apt-get install libc6-i386 libusb-0.1-4 libgconf-2-4 build-essential


► Windows 7 (SP1 or later), Windows 8.x and Windows 10

There are two two editions for Windows, 32-bit and 64-bit installers:

32-bit Edition will allow you to install on the 32-bit edition of Windows. Obtain "EmSys Tools CD" from your instructor or Download it from here

64-bit Edition will allow you to install on the 64-bit edition of Windows. Obtain "EmSys Tools CD" from your instructor or Download it from here

► Unzip CCS8.3.0.00009_win32.zip (32-bit edition) or CCS10.2.0.00009_win64.zip (64-bit edition)

► Navigate to CCS8.3.0.00009_win32 or CCS10.2.0.00009_win64 folder

► Run ccs_setup_8.3.0.00009_win32.exe (32-bit edition) or ccs_setup_10.2.0.00009.exe (64-bit edition)

► This will start the CCS install wizard.

NOTE: you have to de-activate your antivirus temporary during the installation, as the installer ask you:

Just in case, in order to be secure, just avoid any web-surfing or torrent or any other internet communication in the meantime.

  1. Accept the Software License Agreement and click Next.
  2. Unless you have a specific reason to install CCS in another location, accept the default installation folder and click Next. If you have another version of CCS and you want to keep it, we recommend that you install this version into a different folder.
  3. In the next dialog, select the processors that your CCS installation will support. Place a checkmark under "TM4C12x ARM Cortex M4F core based MCUs"
  4. Click Next
  5. In the Select Debug Probes, leave everything as default and click Next

If everything looks good, click Finish to start your install!

Note: If you have an issue with the web installer not being able to connect to the internet then please try the off-line installer.

Please have patience as It takes some time to do all the work. When the installation is complete, uncheck the “Launch Code Composer Studio ” checkbox and then click Finish button.


Install Code Composer Studio - Ubuntu

Prerequisites

Resolve Dependencies, before proceeding to Installation Instructions.

libc6:i386

Ubuntu 20.04 LTS

  • update system
host@user$  sudo apt update

install dependent libraries:

host@user$ sudo apt install libc6:i386 libusb-0.1-4 libgconf-2-4 libncurses5 libpython2.7 libtinfo5

Ubuntu 18.04 LTS

  • update system:
host@user$ sudo apt-get update
  • Install dependent libraries:
host@user$ ssudo apt install libc6:i386 libusb-0.1-4 libgconf-2-4 build-essential

Ubuntu 16.04 LTS

Starting with this version of new CCSv6.2.0, the application is natively 64-bit and only requires one 32-bit library installed.

From a terminal prompt, issue the following command to install it:

host@user$ sudo apt-get update
host@user$ sudo apt-get install libc6:i386

This is due to the fact Linux 64-bit versions of the TI compilers were not yet ready.


Installation Instructions

► Obtain the CCS Installer CD from your instructor or Download it from here

► Simply save the file and untar.

► Open terminal either via Ctrl+Alt+T keyboard shortcut or by searching for “terminal” from software launcher

► Navigate to CCS10.2.0.00009_linux-x64 folder

► Run ccs_setup_10.2.0.00009.run as a normal user.

host@user:~/Downloads/CCS10.2.0.00009_linux-x64$ ./ccs_setup_10.2.0.00009.run

This will start the CCS install wizard.

  1. Accept the Software License Agreement and click Next.
  2. Unless you have a specific reason to install CCS in another location, accept the default installation folder and click Next. If you have another version of CCS and you want to keep it, we recommend that you install this version into a different folder.
  3. In the next dialog, select the processors that your CCS installation will support. Place a checkmark under "TM4C12x ARM Cortex M4F core based MCUs" → click Next
  4. Please Note the Unsupported boards, click Next
  5. In the Select Debug Probes, leave everything as default and click Next

If everything looks good, click Finish to start your install!

Note: If you have an issue with the web installer not being able to connect to the internet then please try the off-line installer.

Please have patience as It takes some time to do all the work. When the installation is complete, check the “Create Desktop shortcut” checkbox and then click Finish button.

Install Drivers

Once CCS installation has completed, navigate to directory <Install-Folder>/ccs1020/ccs/install_scripts.

host@user:~$ cd ~/ti/ccs1020/ccs/install_scripts/

As root, execute script "install_drivers.sh".

host@user:~/ti/ccs1020/ccs/install_scripts$ sudo ./install_drivers.sh


Install TivaWare for C Series Windows

► Download TivaWare™ for C Series.
► Run SW-TM4C-2.1.4.178.exe file (It's self-extracting)
► Please install TivaWare into the drive:\ti\TivaWare_C_Series-2.1.4.178 folder.

Tools included in the TivaWare for C Series suite

Tivaware tools for c series.png

The TivaWare for C Series suite contains and integrates all user-required source-code functions and object libraries, which include:

  • Peripheral Driver Library (DriverLib)
  • Graphic Library
  • USB Library
  • Sensor Hub Library
  • Open Source RTOS
  • Open Source Stacks
  • Utilities
  • Boot Loader and In-System Programming Support
  • Example Codes
  • Third-Party Examples


Install TivaWare for C Series Ubuntu

Download TivaWare library, and unzip into a folder, lets call “TivaWare_C_Series-2.1.4.178” folder in your home directory:

host@user:~$ cd ti
host@user:~$ mkdir TivaWare_C_Series-2.1.4.178
host@user:~$ sudo apt-get install -y unzip &>> /dev/null
host@user:~$ unzip -u ~/Downloads/SW-TM4C-2.1.4.178.exe -d ~/ti/TivaWare_C_Series-2.1.4.178


Tools included in the TivaWare for C Series suite

Tivaware tools for c series.png

The TivaWare for C Series suite contains and integrates all user-required source-code functions and object libraries, which include:

  • Peripheral Driver Library (DriverLib)
  • Graphic Library
  • USB Library
  • Sensor Hub Library
  • Open Source RTOS
  • Open Source Stacks
  • Utilities
  • Boot Loader and In-System Programming Support
  • Example Codes
  • Third-Party Examples



Install/Verify Drivers

Linux

Once CCS installation has completed, navigate to directory <Install-Folder>/ccs930/ccs/install_scripts.

host@user:~$ cd ~/ti/ccs930/ccs/install_scripts/

As root, execute script "install_drivers.sh".

host@user:~/ti/ccs930/ccs/install_scripts$ sudo ./install_drivers.sh

Windows

Verify ICDI Device Drivers

ICDI Device Drivers

► Assure that your LaunchPad is connected to your laptop.
► Click on the Windows Start button.
► Right-click on Computer and select Properties from the drop-down menu.
► Click on Device Manager on the left of the dialog.

The Device Manager window displays a list of hardware devices installed on your computer and allows you to set the properties for each device. If you see any of the following three devices listed in the Other category:

  • Stellaris ICDI JTAG/SWD Interface
  • Stellaris ICDI DFU Device
  • Stellaris Virtual Serial Port

it means that the driver for those devices is not installed.

Run this step only if your device drivers did not install properly.

► Obtain the ICDI drivers from your instructor or download the zip file from Stellaris ICDI Drivers for Windows.
► Unzip the file to a folder on your desktop.
► Back in the Device Manager, right-click on each of the Other devices (one at the time) and select Update Driver. In the following dialogs point the wizard to the folder on your desktop with the unzipped files. If the process seems to take longer than it should, the wizard is likely searching on-line. Turn off your wireless or disconnect your network cable to prevent this.

► Make sure all three devices listed above are properly installed.


Tiva C Series EK-TM4C123GXL LaunchPad Boad

Tiva C Series EK-TM4C123GXL Evaluation Kit

Description

The TM4C123G LaunchPad Evaluation Kit is a low-cost evaluation platform for ARM Cortex-M4F based microcontrollers from Texas Instruments. The design of the TM4C123G LaunchPad highlights the TM4C123GH6PM microcontroller with a USB 2.0 device interface and hibernation module.

The EK-TM4C123GXL also features programmable user buttons and an RGB LED for custom applications. The stackable headers of the TM4C123G LaunchPad BoosterPack™ XL Interface make it easy and simple to expand the functionality of the TM4C123G LaunchPad when interfacing to other peripherals with Texas Instruments MCU BoosterPack.

Features

The ARM Cortex-M4F Based MCU TM4C123G LaunchPad Evaluation Kit (EK-TM4C123GXL) offers these features:

  • High Performance TM4C123GH6PM MCU:
    1. 80MHz 32-bit ARM Cortex-M4F CPU
    2. 256KB Flash, 32KB SRAM, 2KB EEPROM
    3. Two Controller Area Network (CAN) modules
    4. Dual 12-bit 2MSPS ADCs, motion control PWMs
    5. 8 UART, 6 I2C, 4 SPI
  • On-board In-Circuit Debug Interface (ICDI)
  • USB Micro-B plug to USB-A plug cable
  • Preloaded RGB quick-start application
  • Tiva C Series TM4C123G LaunchPad -- Readme First

Tiva C Series TM4C123G LaunchPad Evaluation Board

Ek-tm4c12gxl-board.png

Switch and LED interface

Switch and LED interfaces
  • PC0-PC3 is used for JTAG connections to the debugger on the LaunchPad.
  • The LaunchPad connects PB6 to PD0, and PB7 to PD1.
  • If you wish to use both PB6 and PD0 you will need to remove the R9 resistor.
  • Similarly, to use both PB7 and PD1 remove the R10 resistor


GPIO Pin Pin Function USB Device
PF4 GPIO SW1
PF0 GPIO SW2
PF1 GPIO RGB LED (RED)
PF2 GPIO RGB LED (BLUE)
PF3 GPIO RGB LED (GREEN)
PC0 TCK/SWCLK ICDI
PC1 TMS/SWDIO ICDI
PC2 TDI ICDI
PC3 TDO/SWO ICDI
PA0 U0RX Virtual COM P0rt (RxD)
PA1 U0TX Virtual COM Port (TxD)
Table: EK-TM4c123GXl LaunchPad - Switches, LEDs and Virtual COM Port

Interface connectors

Ek tm123gxl launchpad headers.png


Pin J1 J3 J4 J2
1 3.3V 5V PF2 GND
2 PB5 GND PF3 PB2
3 PB0 PD0 PB3 PE0
4 PB1 PD1 PC4 PF0
5 PE4 PD2 PC5 RESET
6 PE5 PD3 PC6 PB7
7 PB4 PE1 PC7 PB6
8 PA5 PE2 PD6 PA4
9 PA6 PE3 PD7 PA3
10 PA7 PF1 PF4 PA2

References

  1. Tiva C Series TM4C123G LaunchPad -- Readme First
  2. Tiva C Series TM4C123G LaunchPad Evaluation Kit -- User's Manual
  3. TM4C123GH6PM Microcontroller -- Data Sheet

Hardware Setup

Kit Contents

You should find the following in your box:

Connecting the board

tm4c123gxl_board_setup.png

Tiva™ C Series TM4C123G LaunchPad

The TM4C123GXL LaunchPad Board ICDI USB port (marked DEBUG and shown in the picture below) is a composite USB port and consists of three connections:

  • Stellaris ICDI JTAG/SWD Interface - debugger connection
  • Stellaris ICDI DFU Device - firmware update connection
  • Stellaris Virtual Serial Port - a serial data connection

Using the included USB cable, ► connect the USB emulation connector on your evaluation board (marked DEBUG) to a free USB port on your PC. A PC’s USB port is capable of sourcing up to 500 mA for each attached device, which is sufficient for the evaluation board. If connecting the board through a USB hub, it must be a powered hub. The drivers should install automatically.

LaunchPad


Make sure that the power switch in the upper left hand corner of your board is in the right-hand DEBUG position as shown:



Start

  • Switch the POWER SELECT switch to the right for DEBUG mode.
  • Connect the USB-A cable plug to an available port on the PC and the Micro-B plug to the Debug USB port on the Board.
  • Verify that the POWER LED D4 on the board is lit.

Objective

In this lab, we’ll create a project that contains two source files, main.c and tm4c123gh6pm_startup_ccs_gcc.c, which contain the code to blink an LED on your LaunchPad board. The purpose of this lab is to practice creating projects and getting to know the look and feel of Code Composer Studio. In later labs we’ll examine the code in more detail. So far now, don’t worry about the C code we’ll be using in this lab.

Ccs studio startup logo.png

Create a New CCS Project
Review the CCS GUI
Add Path and Build Variables
Add files to your project
Add the INCLUDE search paths for the header files
Examine Project Explorer
Build your project and fix any errors
Debug Configuration
Load, Debug, Run
Create a variable at workspace level in CCS 6.1.x and above

GNU Arm Embedded Toolchain (Pre-built GNU toolchain for Arm Cortex-M and Cortex-R processors)

The GNU ARM Embedded toolchains are integrated and validated packages featuring the ARM Embedded GCC compiler, libraries and other GNU tools necessary for bare-metal software development on devices based on the ARM Cortex-M and Cortex-R processors. The toolchains are available for cross-compilation on Microsoft Windows, Linux and Mac OS X host operating systems.

These toolchains are based on Free Software Foundation's (FSF) GNU Open source tools and newlib.

These toolchains support ARM Cortex-M0, Cortex-M0+, Cortex-M3, Cortex-M4, Cortex-M7, Cortex-M23, Cortex-M33, Cortex-R4, Cortex-R5, Cortex-R7, Cortex-R8 and Cortex-R52 processors.

GNU Arm embedded toolchain for Linux (64-bit)

The GNU Embedded Toolchain for ARM is a ready-to-use, open source suite of tools for C, C++ and Assembly programming targeting Arm Cortex-M and Cortex-R family of processors. It includes the GNU Compiler (GCC) and is available free of charge directly from Arm for embedded software development on Windows, Linux and macOS operating systems.

Ubuntu

WARNING: the gcc-arm-none-eabi package was deleted from repository.

Please download the toolchain from this link and untar it.