getting started with linux sitara on ti’s arm...

42
Getting Started with Linux 4/21/2010 Chapter 0 : Welcome 1 Copyright © 2010 Texas Instruments. All rights reserved. Getting Started with Linux Getting Started with Linux On TI On TI’ s ARM Processors s ARM Processors Texas Instruments Texas Instruments Application Processors Application Processors OMAP OMAP35x DaVinci DM35x/DM64xx Sitara ® ARM Chapter Outline Æ Workshop Goals Æ Workshop Outline Æ Where To Go For More Info

Upload: others

Post on 07-Jul-2020

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 0 : Welcome 1

Copyright © 2010 Texas Instruments. All rights reserved.

Getting Started with LinuxGetting Started with LinuxOn TIOn TI’’s ARM Processorss ARM Processors

Texas InstrumentsTexas InstrumentsApplication ProcessorsApplication ProcessorsOMAP

OMAP35x

DaVinciDM35x/DM64xx

Sitara™

®ARM

Chapter Outline

Workshop GoalsWorkshop OutlineWhere To Go For More Info

Page 2: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 0 : Welcome 2

Workshop Goal and Objectives

Describe three basic parts of LinuxList various Linux distro’s available for TI processorsDescribe where to find Linux distributions for TI processors ( such as the AM3517 )Chart boot process for TI processors running LinuxBoot AM3517 to Gnome desktop; both local & remoteExamine Linux networking

Set Linux network configurationsSetup and transfer via NFS and SambaHost (and access) an HTTP server

“Get an introduction to Linuxrunning on the AM3517 EVM.”

Chapter Outline

Workshop GoalsWorkshop OutlineWhere To Go For More Info

Page 3: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 0 : Welcome 3

Getting Started with Linux Workshop

Copyright © 2010 Texas Instruments. All rights reserved.

Welcome Workshop GoalsAgendaWhere to Get More Info

Device/Tools Overview TI Devices with Linux SupportHardware Development PlatformsSoftware Development Kits

Linux What Is It?Where Do I Get It?How Do I Build It?

Booting Linux Tracing the Boot ProcessCustomizing Boot for Your BoardDas U-Boot

Working In Linux X-WindowsGNOMENetworking

Copyright © 2010 Texas Instruments. All rights reserved.

Lab ExercisesLab 1: Connect and boot the AM3517 EVM

Boot the AM3517 from an SD/MMC card.Lab 2: Start Gnome (Linux GUI) desktop running on the AM3517 EVM

There are four parts to this lab which correspond to the four different ways that you can invoke Gnome:

a. Automatically start GNOME on the AM3517 EVM’s LCDb. Manually start GNOME on the AM3517 EVM’s LCDc. Display the GNOME GUI remotely on the host PC via secure SSH connectiond. Export the GNOME GUI onto the host PC

Lab 3: Running video (and audio) on the AM3517a. Play a .wmv video movie trailerb. (Take Home Lab) View video from a USB Webcam c. (Take Home Lab) Listen to audio via USB speakers

Lab 4: Investigating Linux Networking with the AM3517a. Configure Linux Ethernet connection, both temporarily and permanentlyb. Configure a Samba Serverc. Configure an HTML Server

Page 4: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 0 : Welcome 4

Chapter Outline

Workshop GoalsWorkshop OutlineWhere To Go For More Info

Where can I get additional skills? (from TI)

C6000 Optimization Workshop (4-days)www.ti.com/training

Developing Algo’s for C6x DSP’s( Are you writing/optimizing algorithms for latest C64x+ or C674x DSP’s CPU’s )

Texas Instruments Curriculum

DaVinci Open-Source Linux Mail Listhttp://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Gstreamer and other projectshttp://linux.davincidsp.com or https://gforge.ti.com/gf/TI Softwarehttp://www.ti.com/dvevmupdates, http://www.ti.com/dmshttp://www.ti.com/myregisteredsoftware

Online Resources:

OMAP / Sitara / DaVinci Wikihttp://processors.wiki.ti.com

TI E2E Community (videos, forums, blogs)http://e2e.ti.com

This workshop presentation & exercises

System Integration Workshop using DSP/BIOS(4-days)www.ti.com/training

Building BIOS based Systems( DSP processors )

DaVinci / OMAP / Sitara System Integration Workshop using Linux (4-days)www.ti.com/training

Building Linux based Systems( ARM or ARM+DSP processors )

http://processors.wiki.ti.com/index.php /AM3517_On-line_Workshop

Page 5: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 0 : Welcome 5

Find These Workshop Materials

http://processors.wiki.ti.com/index.php/AM3517_On-line_Workshop

ti

Page 6: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 1 : Brief Devices/Tools Overview 1

Getting Started with Linux Workshop

Copyright © 2010 Texas Instruments. All rights reserved.

Welcome Workshop GoalsAgendaWhere to Get More Info

Device/Tools Overview TI Devices with Linux SupportHardware Development PlatformsSoftware Development Kits

Linux What Is It?Where Do I Get It?How Do I Build It?

Booting Linux Tracing the Boot ProcessCustomizing Boot for Your BoardDas U-Boot

Working In Linux X-WindowsGNOMENetworking

Outline

TI ARM and ARM+DSP DevicesOverview

Sitara (AM)

OMAP/DaVinci (DM)

Tools OverviewDevelopment Kits

Software Development Kits (SDK, DVSDK)

Page 7: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 1 : Brief Devices/Tools Overview 2

Outline

TI ARM and ARM+DSP DevicesOverview

Sitara (AM)

OMAP/DaVinci (DM)

Tools OverviewDevelopment Kits

Software Development Kits (SDK, DVSDK)

TI Embedded Processors Portfolio

32-bit ARMCortex™-M3

MCUs

16-bit ultra-low power

MCUs

High-performance

DSPs

ARM Cortex-A8

MPUsLow-power

DSPs

Stellaris®

ARM® Cortex™-M3 C5000™MSP430™Sitara™

ARM® Cortex™-A8& ARM9

C6000™

DaVinci™

TI Embedded ProcessorsDigital Signal Processors (DSPs)Microcontrollers (MCUs) ARM®-Based Processors

OMAP™

Software & Dev. Tools

Up to 100 MHz

Flash64 KB to 256 KB

USB, ENET MAC+PHYCAN, ADC, PWM, SPIConnectivity, Security,Motion Control, HMI,Industrial Automation

$1.00 to $8.00

300MHz to >1GHz

Cache, RAM, ROMUSB, CAN,

PCIe, EMACIndustrial computing,

POS & portable data terminals

$5.00 to $20.00

Up to 25 MHz

Flash1 KB to 256 KB Analog I/O, ADCLCD, USB, RFMeasurement,

Sensing, General Purpose

$0.49 to $9.00

Up to 300 MHz+Accelerator

Up to 320KB RAMUp to 128KB ROM

USB, ADC McBSP, SPI, I2C

Port. Telecom, audio, medical monitor & diag, industrial$3.00 to $10.00

300MHz to >1GHz+Accelerator

CacheRAM, ROM

USB, ENET, PCIe, SATA, SPI

Test & Meas., Video, audio, security,

imaging, infrastructure $5.00 to $200.00

32-bit real-time

MCUs

C2000™

Delfino™

Piccolo™

40MHz to 300 MHz Flash, RAM

16 KB to 512 KB

PWM, ADC, CAN, SPI, I2CMotor Control, Digital Power,

Lighting, Ren. Energy$1.50 to $20.00

Page 8: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 1 : Brief Devices/Tools Overview 3

Preliminary - Subject to Change

OMAP™ 3 Processors RoadmapIn

crea

sed

Perf

orm

ance

2009

AMxxxNext

500 MHz Cortex -A83D GraphicsDDR2/EMAC/CAN/USB PHY/3.3V I/OProduction-1Q10

720MHz Cortex -A8C64x+ DSP w/ Video Accelerator3D GraphicsOMAP3530

ARM+DSP+Gfx

600 MHz Cortex A8 (720MHz option)C64x+ DSP w/ Video Accelerator3D GraphicsIn production now

ARM+DSP+Gfx

2010

DM NextARM+DSP+Gfx

20112008

AM NextARM+Gfx+Acc.

AM3517ARM + Gfx

450+MHz ARM

Future

Sampling

In Development

In Production

Commercial temp range speeds are shown

Brand TransitionOMAP Sitara – AM

Digital Media – DM

Outline

TI ARM and ARM+DSP DevicesOverview

Sitara (AM)

OMAP/DaVinci (DM)

Tools OverviewDevelopment Kits

Software Development Kits (SDK, DVSDK)

AM/DM37x

Page 9: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 1 : Brief Devices/Tools Overview 4

Preliminary - Subject to Change

AM3517(05) Processor

ARM®

Cortex™-A8CPU

L3/L4 Interconnect

Peripherals

DisplaySubsystem

POWERVR SGX™Graphics

10 bit DAC10 bit DAC

LCDController

VideoEnc

16-bit VideoInput

Video ProcessingFront End

USB Phy

EMAC

Native3.3 V I/O

InterfacesHECC CANController

POWERVR SGX™ 3D engine is licensed from Imagination Tech. Ltd.

Program/Data Storage

I2Cx3

Serial Interfaces

Connectivity

MMC/SD/

SDIOx3

USB 2.0 HSOTG PHYController

GPMC

SDRCUARTx3

UARTw/IRDA

McBSPx5

McSPIx4

TimersGP x12WDT x1

HDQ /1-wire

EMACUSB 2.0 HSController

HECC

DDR2

Outline

TI ARM and ARM+DSP DevicesOverview

Sitara (AM)

OMAP/DaVinci (DM)

Tools OverviewDevelopment Kits

Software Development Kits (SDK, DVSDK)

Page 10: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 1 : Brief Devices/Tools Overview 5

Preliminary - Subject to Change

ARM®

Cortex™-A8CPU

L3/L4 Interconnect

C64x+™ DSP and video

accelerators(3525/3530 only)

Peripherals System

Display Subsystem

Connectivity

Image Pipe Parallel I/F

Camera I/FPOWERVR SGX™ Graphics

(3515/3530 only)

Program/Data StorageI2Cx3

Serial Interfaces

MMC/SD/SDIO

x3

USB Host

Ctlr x3

USB 2.0 HSOTG Ctlr

GPMC

SDRCUART

x2UART

w/IRDA

McBSPx5

McSPIx4

TimersGP x12WDT x2

HDQ /1-wire

OMAP35x Processor

10 bit DACVideoEnc 10 bit DAC

LCDCont-roller

OMAP35x processorLaptop like performance at handheld power level

Note: Peripheral limitations may apply among different packages POWERVR SGX™ 3D engine is licensed from Imagination Tech. Ltd.

Page 11: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 1 : Brief Devices/Tools Overview 6

Outline

TI ARM and ARM+DSP DevicesOverview

Sitara (AM)

OMAP/DaVinci (DM)

Tools OverviewDevelopment Kits

Software Development Kits (SDK, DVSDK)

Sitara/OMAP Evaluation/Development Kits

Tool Part Number Availability

OMAP35x EVM TMDSEVM3530 TI

AM3517 EVM TMDXEVM3517 TI

OMAP-L138 (AM1808) EVM TMDXOSKL138BET TI

Zoom OMAP35x Development Kit TMDSMEVM3530-L Logic

Zoom AM3517 Experimenter Kit SDK-XAM3517-10-256512R Logic

OMAP-L137 (AM1707) Starter Kit EVMOMAPL137 Spectrum Digital

Development Kit Contents:Eval board & documentationBSPDevelopment tools

Get Started Today

Page 12: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 1 : Brief Devices/Tools Overview 7

Featured SOMs and Modules

Tool Part Number Availability Beagle Board

(OMAP35x) Beagle Community

Hawkboard(OMAP-L138) ISSPLHawk Community

OMAP35x System on Module OMAP35x SOM-LV Logic

Overo OMAP35x Computer on Module Overo Gumstix

KBOC OMAP35x System on Module KBOC KwikByte

How to access:Contact TI Partners for more information or click link to buy now

Get Started Today

Outline

TI ARM and ARM+DSP DevicesOverview

Sitara (AM)

OMAP/DaVinci (DM)

Tools OverviewDevelopment Kits

Software Development Kits (SDK, DVSDK)

Page 13: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 1 : Brief Devices/Tools Overview 8

Software Development Kits

All TI ARM and DSP devices where appropriate

Linux GNU Compiler (CodeSourcery)C6000 DSP Compiler (TI)

Code Gen Tools(not really “kits” per se)

All TI SOC’s: ARM, DSP,ARM+DSP

Obviously, not all devices require all the s/w components

TI provided libraries, examples, demosCodec Engine (VISA), DSPlink, Codecs/Algos (XDM), BIOS, XDC, Linux utilities, etc.

DVSDK

OMAP3515, OMAP3530AM3517

Graphix SVSGX development kitOPENGL ES / VG demos, drivers, targetfs, Getting Started Guide

Graphics SDK

OMAP35, AM35, AM18OMAP-L1DM644x, DM6467, DM3xx

Small Linux Distro supporting TI ARM devicesLinux PSP SDK

Processor(s)DescriptionS/W Dev’l Kit

PSP is a TI specific acronym that represents the name of the group inside of Texas Instruments which “owns” the kernel and driver development activities: Platform Support Package teamWireless SDK is available independently of these other kits to support the TI WLxxxx Bluetooth/WiFi devices

Code Generation Tools : CodeSourceryTI SDK’s recommend the CodeSourcery Lite version, although you may want to upgrade to a more complete solutionSee Code Sourcery ARM/GNU Linux datasheethttp://www.codesourcery.com/sgpp/datasheet?target_arch=ARM&target_os=GNU%2FLinuxCheck DVSDK or Linux PSP release notes for tool versions

YesYesYesGNU C/C++ CompilerYesYesYesGNU Debugger (GDB)YesYesNoEclipse IDE

YesYesYesBig Endian, Neon support

YesNoNoUnlimited SupportYesNoNoPriority Defect Correction

Free

No

NoLite

$2799$399Annual Subscription Price (per Host)

YesYesAccess to Updates, Knowledge Base

YesYes30-day Installation SupportProfessionalPersonal

Page 14: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 2 : Linux - What, Where and How to Build It 1

Getting Started with Linux Workshop

Copyright © 2010 Texas Instruments. All rights reserved.

Welcome Workshop GoalsAgendaWhere to Get More Info

Device/Tools Overview TI Devices with Linux SupportHardware Development PlatformsSoftware Development Kits

Linux What Is It?Where Do I Get It?How Do I Build It?

Booting Linux Tracing the Boot ProcessCustomizing Boot for Your BoardDas U-Boot

Working In Linux X-WindowsGNOMENetworking

OutlineLinux : What is it?Linux : Where do I get it?How Do I Build Linux – and Why?

Page 15: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 2 : Linux - What, Where and How to Build It 2

Linux in Three Parts

Flash

BootloaderProvides rudimentary h/w initCalls Linux kernel and passes boot arguments

KernelInitializes the system (and device)Manages system resourcesProvides services for user programs

FilesystemSingle filesystem (/ root)Stores all system filesAfter init, kernel looks to filesystem for “what’s next”bootarg tells linux where to find root filesystem

File System

Linux Kernel

Boot Loader

Linux Boot Process

U-Boot

Linux Kernel

Init Process

Login Prompt

Power On

ARM assembly codePasses args to Linux (bootargs)

Initialize hardware

/sbin/init – 1st process exe by kernel

Login consoleUsually one of first prog’s to run

Looking more closely at the Kernel ...

Page 16: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 2 : Linux - What, Where and How to Build It 3

What’s in the Linux Kernel

RAM UARTMMC EMACCPU

Process Management

VFAT

Device Management

Memory Management

Virtual File System

Network Stack

EXT3

YAFFS

CPU support code

CPU/MMU support code

Character device drivers

Network device drivers

Storage device drivers

Kernel Mode

HTTP Server

Custom User Application

GstreamerFramework

3D Graphics Library

User Mode

A few more details about the filesystem...

Red Hat : Root File System

/home - Storage for user’s filesEach user gets their own folder (e.g. /home/user)Similar to “My Documents” in WindowsDVSDK GSG directory for TI tools, examples, working directory“root” user is different, that user’s folder is at /root

/media – Usually find CDROM drive(s) mounted here

/mnt – Common location to mount other file systemsLinux only allows one filesystemAdd other disks (physical, network, etc) by mounting them to an empty directory in the root filesystemWindows adds new filesystems (C:, D:, etc.) rather than using a single one

/opt – Common location for programsMontaVista install MVLinux to /optakin to Windows “C:\Program Files”

/usr – Storage for user binariesX86 Compiler for Red Hat programs (gcc) is stored in here

/dev – Common location to list all device driversSome folders common to Linux:

Page 17: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 2 : Linux - What, Where and How to Build It 4

Filesystems: Red Hat vs. MontavistaRed Hat (PC) MontaVista (ARM)

Tools/Host filesystem:location our dev’l toolsTarget filesystem:filesystem to run on TI processorsNotice the similarities between the two different Linux filesystemsWhen releasing to production, it’s common to further reduce the target filesystem to eliminate cost

OutlineLinux : What is it?Linux : Where do I get it?

What are Distributions?O/S ChoicesCommunity OptionsCommercial OptionsCommercial vs Community

How Do I Build Linux – and Why?

Page 18: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 2 : Linux - What, Where and How to Build It 5

What Is a ‘Linux Distribution’A ‘Linux distribution’ is a combination of the components requiredto provide a working Linux environment for a particular platform:1. Linux kernel port

A TI LSP or Linux PSP is a Linux kernel port to a device, not just a set of device drivers

2. BootloaderUboot is the standard bootloader for ARM Linux

3. Linux ‘file system’This does NOT mean a specific type of file system like FAT file system or flash file system … rather, it more like the “C:\” drive in WindowsIt refers to all the ‘user mode’ software that an application needs such as graphics libraries, network applications, C run-time library (glibc, uclibc), codec engine, dynamically-loaded kernel modules (CMEM, DSPLINK)

4. Development toolsGCC, GDBMV DevRocket, CCS, GHS Multi, etc.

Build It Yourself ?

Quote from kernel.org:

If you're new to Linux, you don't want to download the kernel, which is just a component in a working Linux system. Instead, you want what is called a distribution of Linux, which is a complete Linux system.

There are numerous distributions available for download on the Internet as well as for purchase from various vendors; some are general-purpose, and some are optimized for specific uses.

In fact, using a distribution even takes quite a bit of effort

This may be a bit of an understatement – even experienced users usually use a distributionCreating a distribution takes a lot of effortMaintaining a distribution … takes even more effort

Page 19: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 2 : Linux - What, Where and How to Build It 6

Linux Distributions

Linux isn’t complete without a distributionMontaVista and Timesys, for example, provide commercial (i.e. production) distributionfor TI’s DaVinci / OMAP processorsA few distributions supporting the open-source BeagleBoard (OMAP35x-based) include: OpenEmbedded, Ubuntu, Fedora, Android, Gentoo, ARMedslack and ALIP

Kernel

Windowing System

CreativityTools

OfficeSuite

Browser

What does a distro contain?

OutlineLinux : What is it?Linux : Where do I get it?

What are Distributions?O/S ChoicesCommunity OptionsCommercial OptionsCommercial vs Community

How Do I Build Linux – and Why?

Page 20: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 2 : Linux - What, Where and How to Build It 7

O/S Choices

Choices

Linux Android(a.rowboat.com) WinCE

Commercial Community

Others …

• QNX• Nucleus• Etc.

Build ItYourself

Linux Distributions

Ease of UseEasyTested

Experienced User Latest

“GIT”from kernel.org, and others

Bit-BakeRecipies

BinaryNarcissus(online tool)OE

BinaryUpdated foreach SDKrelease

Binary(Update patches)

Custom from

Sources

Open Embedded

(OE)

ÅngströmTI SDK(PSP)

TimesysMontaVistaEtc.

Custom(Build it Yourself)CommunityCommercial

Page 21: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 2 : Linux - What, Where and How to Build It 8

OutlineLinux : What is it?Linux : Where do I get it?

What are Distributions?O/S ChoicesCommunity OptionsCommercial OptionsCommercial vs Community

How Do I Build Linux – and Why?

Community OptionsTI Linux SDK (PSP)

Pre-built snapshot of Linux tested against specific version of TI Software Development KitsUpdated at each new SDK/DVSDK releasePSP = Platform Support Package (name of TI team)Currently, a bare-bones distro (“lean/mean”) Arago open-source OE project

Advantage of OE – recipies can be reused by Angstrom (or custom OE) usersIn general, users shouldn’t (re)build using OE; no reason to, because if you want more features, we recommend you go with Angstrom (also built using OE)

ÅngströmOpen-source, full-featured Linux distro targeted for embedded systemsGet it from:

User-compiled binaries widely available for many targetsNarcissus (http://www.angstrom-distribution.org/narcissus)Web-based tool to create binary version (with your own package selection)

Built using OE (user community can re-use TI OE recipies)

Page 22: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 2 : Linux - What, Where and How to Build It 9

DIY OptionsOpen-Embedded (OE)

Build Linux from source using OE’s Bit-Bake recipe(s)Many recipes available for various architectures, including many variations for a given deviceBuilds full-up distro including Kernel and FilesystemTI builds it’s PSP Linux distro’s via OE

Build from Sources (roll your own)Build directly from sources, such as kernel.orgUse GIT, as well as SVN and others to get sources from repo’sAre you nuts? Either you want to waste your life redoing what OEdid, or you’re so advanced you don’t need this presentation.

OutlineLinux : What is it?Linux : Where do I get it?

What are Distributions?O/S ChoicesCommunity OptionsCommercial OptionsCommercial vs Community

How Do I Build Linux – and Why?

Page 23: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 2 : Linux - What, Where and How to Build It 10

Commercial O/S VendorsLinux

MontaVistaTimeSysWind River

WinCEAdeneoMistralMPC DataBSQUARE

RTOSGreen HillsWind River (VxWorks)ELogic (ThreadX)QNXMentor (Nucleus)

OutlineLinux : What is it?Linux : Where do I get it?

What are Distributions?O/S ChoicesCommunity OptionsCommercial OptionsCommercial vs Community

How Do I Build Linux – and Why?

Page 24: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 2 : Linux - What, Where and How to Build It 11

Commercial vs CommunityCommercial

Less effort – another team does the work of porting new kernel to the distribution … and then laboriously testing it over-and-over againMore robust – many customers generating more inputs/errata to team testing anmaintaining the distributionMore secure – among other reasons, many homebrew distributions don’t get around to adding security patches due to effort and timeLatest features? Many vendors backport new features into their kernels – thus, you get the stability of a known kernel but with new featuresGood choice if: you don’t need the absolute latest features; you have a many projects to ammortize the costs; you’re a Linux wiz who really knows what they’re doing.Bottom Line – Commercial distributions trade cost (and the bleeding edge features) for robustness and less-effort. What is it worth, if your company depends on this product?

Community (to Git or not)Access to latest improvements in Linux kernelWant to know exactly how it is all put togetherMaximum involvement in Linux communityNo costs … (unless you count your labor)Bottom Line – Choose this option if you have the Linux expertise and labor is cheaper than NRE; or, you need access to the very latest features

Looking at MVL vs GIT example…

Example Comparison : MVL Pro 5.0 vs GIT

TI offering is clearly free as GIT Linux distributions are open source.

Demo copy and LSP open source, but original licensing has created confusion.

Linux run-time Licensing

GNU Tools free. IDE requires annual subscription.

GNU Tools free. IDE requires annual subscription.Tools licensing

Multi-vendor, including MVMV and its partnersThird-party support

Not part of kernel. TI is addressing through Arago. Initially may be less user-friendly than MVL.

Comprehensive host and target file systems with GUI tools for optimization.

File System

Applied to current release, which changes every few months. User may need new kernel to get a fix.

Applied to 2.6.18, so no need to change kernel versionsKernel bug-fixes

Uses latest available kernelUses 2.6.18, which is almost 3 years oldKernel Version

Community LinuxMVL 5.0 Pro

You've come to a fork in the road ...

Page 25: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 2 : Linux - What, Where and How to Build It 12

35

TI Customers Can CHOOSE a Linux Path: Community or Commercial

Stable

SystemTested

Supportprovided

Fast

Fresh

Roll YourOwn

LatestKernel

Commercial Community

TI Driver/KernelDevelopment

Community first pathTI delivers LSP/DVSDK to communitySmaller set of applicationsCustomer builds up solutionOpen source assetsCustomer assetsFaster access, newer kernelsMore customer responsibility

Invest own resources vs. $$

Commercial complement pathCommercial Linux partner pulls from communityPartner adds value: production testing, tools integration, support, application bundles, etc. for customersService and subscription salesExecuting with MontaVista, Timesys…Opportunities for other commercial vendors

OutlineLinux : What is it?Linux : Where do I get it?How Do I Build Linux – and Why?

Page 26: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 2 : Linux - What, Where and How to Build It 13

How Do I Build It, Let Me Count the Ways…1. Don’t … find a pre-built Linux uImage

How Do I Build It, Let Me Count the Ways…1. Don’t … find a pre-built Linux uImage

2. Build Default Linuxa. make defconfigb. make

Why Re-Build Linux Kernel?TI SDK’s often support various ARM CPU’s, thus GSG directs you to specify target processor and rebuild kernelYou made changes to a Linux source file (i.e. driver, etc.)…

Page 27: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 2 : Linux - What, Where and How to Build It 14

How Do I Build It, Let Me Count the Ways…1. Don’t … find a pre-built Linux uImage

2. Build Default Linuxa. make defconfigb. make uImage

Why Re-Build Linux Kernel?TI SDK’s often support various ARM CPU’s, thus GSG directs you to specify target processor and rebuild kernelYou made changes to a Linux source file (i.e. driver, etc.)…Change to Kernel’s Directory ( TI/MontaVista LSP Example )

> cd ti-davinci/linux-2.6.18_pro500

Configure the Kernel> make ARCH=arm CROSS_COMPILE=arm_v5t_le- davinci_dm644x_defconfig

Build the Kernel> make ARCH=arm CROSS_COMPILE=arm_v5t_le- uImage

How Do I Build It, Let Me Count the Ways…1. Don’t … find a pre-built Linux uImage

2. Build Default Linuxa. make defconfigb. make uImage

3. Build ‘Custom’ Linuxa. make defconfigb. make menuconfigc. make uImage

Page 28: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 3 : Booting Linux 1

Getting Started with Linux Workshop

Copyright © 2010 Texas Instruments. All rights reserved.

Welcome Workshop GoalsAgendaWhere to Get More Info

Device/Tools Overview TI Devices with Linux SupportHardware Development PlatformsSoftware Development Kits

Linux What Is It?Where Do I Get It?How Do I Build It?

Booting Linux Tracing the Boot ProcessCustomizing Boot ProcessDas U-Boot

Working In Linux X-WindowsGNOMENetworking

OutlineBooting Linux - ROM to Kernel

RBLUBL / XloaderDas U-Boot

Page 29: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 3 : Booting Linux 2

Booting Linux – ROM to Kernel

RBL UBL / x-loader U-Boot Kernel

ROM Internal RAM DDR2 DDR2

Device Flash

DDR2

UBLx-loader

UBoot Linux Kernel

RBLUBL

x-loader

UBoot Linux Kernel

Bootloader Components

Yes

Board Designer

No

User Config’d

U-BootU-boot

“Das U-boot” is the standard open-source Linux boot loader for ARM. It supports networking for TFTP/NFS booting. It is used to locate, load and execute the Linux kernel in uImage format and is also responsible for passing arguments to the kernel

Linux boot

XLDRUBL

The primary function of this boot loader is to initialize external memory and system clocks so that a larger, more advanced boot loader (in this case U-boot) can be loaded.

Second-level

RBLRBL

This is ROM’d code for detecting desired boot type (NAND, UART, …) and loading executable code of second-level bootloader from selected peripheral/interface

First-level

OMAP3xDaVinciOperationsBoot stage

Customizing UBL / XLDR1. Configure system clocks2. Setup memory interfaces

Page 30: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 3 : Booting Linux 3

OutlineBooting Linux - ROM to Kernel

RBLUBL / XloaderDas U-Boot

Das U-Boot

D SPTEXAS INSTRUMENTS

TECHNOLOGY

The Linux PSP SDK board is delivered with the open-source boot loader: Das U-Boot (U-Boot)

At runtime, U-Boot is usually loaded in on-board Flash or an SD/MMC card

In general, U-Boot performs the functions:1. Initializes the DaVinci EVM hardware2. Provides boot parameters to the Linux kernel3. Starts the Linux kernel

Page 31: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 3 : Booting Linux 4

To Boot Linux, You Need…

3. Filesystem

2. Linux Kernel

1. Bootloader (U-Boot) At reset, U-Boot bootloader is executed

U-Boot loads O/S kernel into DDR2 memory; then,

Connects to the root filesystemIf you don’t know what this is, think of it as the ‘c:\’ drive of in Windows PC

Where are these 3 located?

Where Do You Find …

By default, the DVEVM ships in “HDD boot” mode; this allows the demo applications to run "out-of-the-box“

“HDD boot”

Hard Drive3. Filesystem

Flash2. Linux Kernel

Flash1. Bootloader (U-Boot)

EVM Board(default)Where located:

Page 32: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 3 : Booting Linux 5

Where Do You Find …

“MMC boot”

SD/MMC

SD/MMC

SD/MMC

Hands-On Lab

“NFS boot”“HDD boot”

Linux PC (via NFS)Hard Drive3. Filesystem

Linux PC (via TFTP)Flash2. Linux Kernel

FlashFlash1. Bootloader (U-Boot)

DevelopmentDM6446 EVMDefaultWhere located:

By default, the DVEVM ships in “HDD boot” mode; this allows the demo applications to run "out-of-the-box”“NFS boot” (network boot) is good for application development

SD / MMC Boot

XLDR(FAT32)

RootFilesystem

(EXT3)

Page 33: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 3 : Booting Linux 6

NFS Boot

WindowsPC

VMware Linux “Tools” PC

DM6446DVEVM

eth0 Ethernet provides physical connection to Linux PCRoot filesystem is accessed via NFS protocolDon’t need to ‘flash’ DVEVM after compiling new program

RS-232

Tera Term

U-BootRS-232 is physical connection to U-BootUse to stop DVEVM from stand-alone bootConfigure U-Boot’s modes by setting/saving environment variables

Ethernet

~/workdir/filesys

Note: ~/workdir/filesys = /home/user/workdir/filesys

Configuring U-Boot and Starting Linux (5 Steps)

D SPTEXAS INSTRUMENTS

TECHNOLOGY

Note, login with: “user” for the Tools Linux PC“root” for the DVEVM target

You can use any RS-232 comm application (Linux or Win), we use Tera Term for its macro capability

1. Connect an RS232 serial cable and start a Tera Term

2. Power on the DVEVM and press any key in TeraTerm toabort the boot sequence

3. Set U-Boot variables to select how Linux will boot (save changes to flash to retain settings after power cycle)

4. Boot Linux using either:the U-Boot “boot” command

power-cycle the DVEVM

5. After Linux boots, log in to the DVEVM target as “root”

What U-Boot param's do I need?

Page 34: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 3 : Booting Linux 7

Configuring U-BootCommon Uboot Commands:

printenv - prints one or more uboot variablessetenv - sets a uboot variablesaveenv - save uboot variable(s)run - evaluate a uboot variable expressionping - (debug) use to see if Uboot can access NFS server

Common Uboot Variables:You can create whatever variables you want, though some are defined either by Linux or common style

bootcmd - where Linux kernel should boot frombootargs - string passed when booting Linux kernel

e.g. tells Linux where to find the root filesystemserverip - IP address of root file system for NFS bootnfspath - Location on serverip for root filesystem

Boot Variations

setenv bootcmd “mmc init; fatload mmc 0 ${loadaddr} uImage; run mmcargs; bootm ${loadaddr}”

MMC

setenv bootcmd 'dhcp;bootm'TFTP

setenv bootcmd bootm 0x2050000Flash

NFSTFTPdhcp4. MMCMMCdhcp5.

HDDTFTPdhcp3. NFSFlashdhcp2.HDDFlashdhcp1.

IP Root FilesystemLinux KernelMode

U-Boot’s bootcmd variable specifies the root filesystem

Page 35: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 3 : Booting Linux 8

Boot Variations

NFSTFTPdhcp4. MMCMMCdhcp5.

HDDTFTPdhcp3. NFSFlashdhcp2.HDDFlashdhcp1.

IP Root FilesystemLinux KernelMode

setenv bootargs console=ttyS0,115200n8 noinitrd root=/dev/mmcblk0p2 rootfstype=ext3 rootwait nolock mem=120M

MMC

setenv bootargs console=ttyS0,115200n8 noinitrd rw ip=dhcp root=/dev/nfs nfsroot=$(serverip):$(nfspath),nolock mem=120M

NFS

setenv bootargs console=ttyS0,115200n8 noinitrd rw ip=dhcp root=/dev/hda1, nolock mem=120MHDD

U-Boot’s bootargs variable specifies the root filesystem

Using Tera Term Macros

U-boot strings can be very precise, one wrong character could prevent bootingTeraTerm Pro (freeware) provides a simple macro languageVery convenient for setting up U-Boot, if you change settings frequently

Page 36: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 4 : Working in Linux 1

Getting Started with Linux Workshop

Copyright © 2010 Texas Instruments. All rights reserved.

Welcome Workshop GoalsAgendaWhere to Get More Info

Device/Tools Overview TI Devices with Linux SupportHardware Development PlatformsSoftware Development Kits

Linux What Is It?Where Do I Get It?How Do I Build It?

Booting Linux Tracing the Boot ProcessCustomizing Boot for Your BoardDas U-Boot

Working In Linux X-WindowsGNOMENetworking

Linux Desktop Environment

x11(server)

Linux

AM3517

GNOME

Page 37: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 4 : Working in Linux 2

x11 (a.k.a. X, X window)

• x11 is the most common Linux display manager• x11 also manages Human Interface Devices (HIDs) • Various applications send graphical data to x11, which

displays each in an independent, resizable window

x11 Display

xterm

mplayer

Desktop Managers• Gnome is one of many Linux display managers• Display managers provide a “Desktop” or similar

environment (i.e. for handheld device)• Applications (such as mplayer or xterm) typically

interface directly to x11 and are therefore independent of the Display Manager

• Gnome display manager is “just another client”to x11

• A display manager isn’t required to run Linux• x11 isn’t required to run Linux, though it is

required by many graphical applications

Page 38: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 4 : Working in Linux 3

Terminal vs. Desktop• A terminal is a text-based interface to Linux O/S• Commands are interpreted by a shell program

(such as BASH)• A terminal may connect via RS-232, IP, etc.• xterm is a terminal which connects via the X

window server, i.e. receives input via x11 HID and outputs to x11 display

• Most applications which can be launched from the Desktop (i.e. a drop-down menu) can be equivalently launched by typing a command into a Linux terminal

Exported Desktop

x11(server)

Linux

x11(client)

LinuxIP

AM3517 PC

GNOMEGNOME

(Exported)

Page 39: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 4 : Working in Linux 4

x11 (a.k.a. X, X window)

• As many Linux packages, x11 was designed from beginning with networking in mind (client/server)

• x11 may export Human Interface Device (HID) I/O in addition to Display

• Exporting a desktop is handled by x11. (Destopmanagers are “just another client” to x11)

x11 Display

xterm

mplayer(remote Linux)

mplayer(remote Linux)

Client or Server ?• x11 service is considered a server (xserver) even

though it doesn’t generate graphical content• x11 “serves the display” to applications (clients)

• For exported displays, the remote xserver additionally acts as a client to the local xserver

• In Linux world, a server is a standalone (“daemon”) process which responds to requests from clients

Physical Display

Local xserver(server)

Remote xserver(server)

IP

Remote xterm(client)

Page 40: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 4 : Working in Linux 5

Exporting x11 Display

# startx &# export DISPLAY=192.168.1.10:0.0# gedit myfile.txt

Most applications launched from a terminal will query terminal’s DISPLAY environment variable

# startx &# gnome-session –display=192.168.1.10:0.0

Processes such as the Gnome display manager which exist outside the context of the terminal may take a display argument

Lab Exercise

x11(server)

Linux

x11(client)

LinuxIP

AM3517 PC

GNOMEGNOME

(Exported)

Page 41: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 4 : Working in Linux 6

Copyright © 2010 Texas Instruments. All rights reserved.

Lab ExercisesLab 1: Connect and boot the AM3517 EVM

Boot the AM3517 from an SD/MMC card.Lab 2: Start Gnome (Linux GUI) desktop running on the AM3517 EVM

There are four parts to this lab which correspond to the four different ways that you can invoke Gnome:

a. Automatically start GNOME on the AM3517 EVM’s LCDb. Manually start GNOME on the AM3517 EVM’s LCDc. Display the GNOME GUI remotely on the host PC via secure SSH connectiond. Export the GNOME GUI onto the host PC

Lab 3: Running video (and audio) on the AM3517a. Play a .wmv video movie trailerb. (Take Home Lab) View video from a USB Webcam c. (Take Home Lab) Listen to audio via USB speakers

Lab 4: Investigating Linux Networking with the AM3517a. Configure Linux Ethernet connection, both temporarily and permanentlyb. Configure a Samba Serverc. Configure an HTML Server

Lab Setup (HW)Logic PD Zoom

IP

USB

AM3517

FBTIRS-232

Page 42: Getting Started with Linux Sitara On TI’s ARM …software-dl.ti.com/trainingTTO/trainingTTO_public_sw/am...2010/04/21  · Lab 3: Running video (and audio) on the AM3517 a. Play

Getting Started with Linux 4/21/2010

Chapter 4 : Working in Linux 7

Lab Setup (SW)

AM3517 Windows XP

Terra Term(COM4)

VMware (ubuntu_x11_client)

Linux

x11

Gnome(exported)

Linux

x11

Gnome

USB

IP