MULTI for DaVinci Workshop

Joe Fabbre [email protected] Agenda 1

• Begin install of MULTI tools • Intro to Green Hills Software • INTEGRITY RTOS • MULTI IDE for DaVinci • Why to choose GHS for DaVinci – INTEGRITY –MULTI • Lab: Building a BIOS project for the TI simulator • Demo: BIOS on the DV-EVM • Lab: Building a stand-alone ARM application for the GHS ARM simulator • Demo: Simultaneous dual-core debug on the DV-EVM • Break Agenda 2

• Lab: TimeMachine • Demo: kernel awareness on the DV-EVM – How to rebuild the Linux kernel for MULTI – Freeze mode kernel debug – Linux Kernel Awareness (OSA) – Linux Run Mode debug • Fork debugging – Debugging kernel modules Green Hills Software, Inc. GHS provides embedded software development solutions to produce the most reliable products, with the highest quality, in the shortest time

• 25 years in embedded software industry – Averaging 30% per year – Profitable each year in business – Privately held • Largest RTOS market share growth three years in a row • #2 in total RTOS revenue worldwide in only five years • 35 offices worldwide (20 U.S. FAEs, 15 ROTW) Green Hills Software: Overview Worldwide, single-source leader with total software development solutions and services for embedded systems – Royalty Free Real-Time for systems that require total reliability, including full memory protection, POSIX.1 conformance, and the highest levels of safety, reliability and security, to systems needing small, fast and simple-to-use capabilities. – Optimizing /C++/MISRA C/Ada for many for the fastest, smallest code. – MULTI Integrated Development Environment including the C/C++/MISRA C/Ada Source-Level , Event and Performance Analyzer, Memory Leak Detector and other code quality features for building the most reliable applications in the shortest time.

– Hardware Probes for the industry’s fastest download time to your embedded targets optionally connecting up to 1GB of trace data to make sure you don’t miss anything running on your targets. – Custom Engineering and Services providing, for example, porting services to selected RTOS, custom BSPs, device drivers, middleware integration and validation, feasibility studies rapid prototyping and more. Green Hills RTOS Solutions

• Royalty-free, innovative and proven deterministic real-time operating system that includes support for processors MMU • Mature technology – shipping for 7+ years • Designed for products demanding robust reliability and security • Ecosystem shared with velOSity – 100% common API with velOSity – Shares services and middleware support with velOSity – Shares tools integration and debug features support with velOSity The Green Hills RTOS Pedigree

Green Hills is dedicated to continued development and availability of the most reliable and secure Royalty-Free RTOS products in the industry. INTEGRITY and velOSity • The embedded industry’s leading reliable, scalable and open RTOS solution • Commercially available since 1997 INTEGRITY-178B • FAA DO-178B Level A certification for safety-critical applications in commercial and military avionics • Customer certifications achieved since 2002 INTEGRITY-MLS • EAL 6+ certification to the Protection Profile (SKPP) for high-security applications in government and financial markets • In progress – expected completion in 2006 INTEGRITY-61508 • IEC 61508 SIL 3 certification for industrial automation & control, automotive industries INTEGRITY-MED • Customized package for medical device industry type I to III certifications INTEGRITY Middleware • File Systems – Formats • DOS/FAT, Unix/Linux compatible FFS, CD-ROM, DVD, PJFS – Network file systems: NFS and CIFS (Samba) – Device types – IDE/EIDE/ATAPI (hard disk drives, CD-ROM drives, DVD drives) –RAM disk – Flash memory (wear leveling NAND and NOR flash support) – Compact Flash – USB mass storage – M-Systems •USB 2.0 – Host and device stacks •Networking – IPv4/IPv6 – Security protocols: SSH, SSL, IPSec, firewall, VPN plus many more – WiFi: 802.11 a/b/g with WPA/WPA2 • DSP/BIOS Link • 2D and 3D graphics INTEGRITY Performance

• INTEGRITY on ARM 920T at 184 MHz – Context switch • Between 2 VAS processes: 1.724 usec • Between 2 KS processes: 1.216 usec – Interrupt handler callback latency • 1.015 usec – These times are deterministic!

• Linux on ARM926 at 200 MHz – Context switch is non-deterministic • Varies from ~100 usec to ~350 usec – Source: http://linuxdevices.com/articles/AT2598317046.html MULTI for DaVinci DaVinci Software Architecture

A/ process

Video thread Audio Video Application Audio codec codec process thread Codec engine Operating Systems INTEGRITY Kernel DSP/BIOS velOSity module u-velOSity DSP/BIOS Link Linux

ARM DSP MULTI: Complete Integrated Solution for DaVinci Program Development Target Host System Connection Targets GHS Optimizing MULTI ToolSuite CompilerSuite Ethernet MPserv ICEPick (GHS Probe) or USB C TI DaVinci TIserv Freeze Mode DM644x Misra C Debug

Global TI Target PCI/USB XDS560 Optimization Server ICEPick C++ TI DaVinci DM644x EC++ Ethernet LINUXserv Linux TI Optimizing Ethernet CompilerSuite RTserv TI DaVinci DM644x C Debug INDRT TI Info TIserv C64x+ Conver- INTEGRITY sion C++ TI Target TI DaVinci Run Mode DM644xi Server Debug ARM TI C64x+ Simulator Simulator DaVinci C64x+ DSP/BIOS Support • Create and manage a project • Build standard TI DSP/BIOS examples • C64x+ target connection options – Green Hills probe – TI XDS560 probe – TI simulator – BlackHawk XDS560 – Spectrum Digital XDS560 • Advanced MULTI debug features – BIOS kernel awareness (GUI) Freeze Mode Debugging • Uses JTAG for run control of processor cores • When a breakpoint is hit, execution on the entire core is stopped • Good for: – Low-level debugging – Board bring-up – Device driver development – Kernel aware application development • Process-specific breakpoints possible through “hiccup” debugging – When breakpoint is hit, MULTI checks current process context Where Can I Use Freeze Mode?

A/V process

Video thread Audio Video Application Audio codec codec process thread Codec engine Operating Systems INTEGRITY Kernel DSP/BIOS velOSity module u-velOSity DSP/BIOS Link Linux

ARM DSP Simultaneous Dual-Core ARM/C64x+ Freeze Mode Debugging

• Loading and debugging images on both cores • Multi-core debug – Individual core instruction stepping – Processor context debugging and viewing (e.g., registers, variables, etc.) • Single instance of MULTI debugger • Kernel aware debugging on all cores – Green Hills Software: INTEGRITY, velOSity and u-velOSity –MontavistaLinux – TI DSP/BIOS Simultaneous Dual-Core Debugging What Does “Kernel Awareness” Mean? • Object Structure Awareness (OSA) – Ability to explore the internal data structures of the operating system •Processes • Semaphores • Message queues • Dynamically loaded kernel modules •Etc. – In-depth look at the current state of the OS • Thread/Task/Process Aware Debugging – Debugger controls system based on thread-level events – Thread-level break points • Stop the system when thread “a” hits a common break point, but not if thread “b” hits the same break point. – Thread-specific variable and register views – Thread-specific call stack and local variables Debugging the Linux Kernel Object Structure Awareness Explorer Object Structure Awareness Explorer (Kernel Modules) Run-Mode Debugging • Uses target resident debug agent (linuxserv or rtserv) to perform run control. • MULTI gains run-control at the individual thread or process level. – Start and stop individual threads while the rest of the system continues to run uninterrupted. – Stop an arbitrary number of threads, controlling each independently. • Not limited to one thread at a time. – Threads can be grouped or managed independently. • Good for application developers who need visibility of interaction between processes and threads. Where Can I Use Run Mode?

A/V process

Video thread Audio Video Application Audio codec codec process thread Codec engine Operating Systems INTEGRITY Kernel DSP/BIOS velOSity module u-velOSity DSP/BIOS Link Linux

ARM DSP Run-Mode Application Debugging (ARM) Low-Level Debugging and Custom Board Bring Up

• Connect to hardware and access memory and registers without a program. – Low-intrusion mode disables MULTI’s cache. • Debug and perfect setup scripts with MULTI’s setup script debugger and script creation mechanism. • Create register view windows on the fly for custom devices. • Program flash memory using custom drivers. Register Viewer

Advanced Register Visualization • Databook look and feel • Integrated bitfield descriptions • Graphically add new descriptions on the fly • Search for register window Integrated Memory Test Tool

Test memory on new hardware with memory test tool. • Address walking • Data walking • Data patterns • CRC computation • Specify access size STL/Container Visualization • Display STL containers as arrays in view windows and when printing. • Customizable for custom- written C or C++ containers. TimeMachine: Revolutionary Debugging

• Currently supported on Green Hills operating systems: INTEGRITY, velOSity and u-velOSity. • CodeReplay allows programs to step forward or backward through execution inside the MULTI debugger. • View Functions/Events/Call Stack vs. Time. • Non-intrusive real-time profiling and code coverage information. • EventAnalyzer to visualize RTOS events. • Analyze long-term changes in variables. • Debug virtual address spaces from trace data (INTEGRITY only). CodeReplay Debugger Debug collected trace data as though it were a live target, plus: • Step backward • Run backward (with break- points) • View registers and memory • Hardware BPs! Why Choose GHS?

INTEGRITY vs. Linux • GPL issues • Certification requirements – Avionics (DO-178B, level A) – Medical (FDA approval, class 1-3) – Industrial controls (IEC 61508, SIL3) • Software-defined radio • Complete SCA reference platform from Lyrtech on DM6446 • Security reasons • Performance reasons Why Choose GHS? MULTI • CCS is known and loved by DSP developers. They should continue using it. • MULTI is for all ARM developers and system integrators who want: – Reduced time to market. – Increased developer productivity. – Best-in-class debug technology. – Board and OS bring-up tools. – Superior Linux kernel awareness. – Run mode and freeze mode support. – Linux-hosted tools that support freeze mode JTAG debug. – Simultaneous dual-core visibility and control. Why Choose GHS?

MULTI covers all phases of DaVinci development • Board bring up • DSP development • ARM BSP/LSP development • ARM application development (Linux and RTOS) • System integration MULTI for DaVinci

Labs and Demos Lab 1: BIOS Programs

• Goal: Build, run, and debug a BIOS program in MULTI. – Get familiar with basic MULTI features, running programs on the C64x+ simulator and BIOS awareness. • Step 1: Create a new project. – File->Create New Project New Project Wizard BIOS Project Creation BIOS Project Creation MULTI Builder Setting Build Options • Target connection chooser BIOS Program Debugging BIOS OSA Explorer • MULTI> osasetup BIOS • MULTI> osaexplorer – Or from menus: View-> OSA Explorer Code Browsing • Single click on variable • Double click on variable • Single click on function • Double click on function • Right click on variable (check out Browse References) Lab 2: Creating a Standalone ARM Program Basic Debug Example You Know the Routine…

• Build project • Debug • Connect to target (simarm) Register Viewing Mixed Assembly Mode

Browsing buttons move forward and back through code like a Web browser. Browse->Static Calls Lab 3: TimeMachine New project, ARM, standalone Lab 3: TimeMachine Lab 3: Path Analyzer TimeMachine Dual-Core Connection Window

Simultaneous Dual-Core Debugging • First run the target setup script. • Highlight both cores in the connection window. • Single step into the first line of main on both cores by clicking this button. Debug away! Rebuilding the Linux Kernel with Debug Info and Translating Debug Info for MULTI

• Follow all the instructions in sprue66.pdf (TI Getting Started Guide) for installation and building the kernel. • When making the uImage use the following command line: – > make ARCH=arm CROSS_COMPILE=arm_v5t_le- CONFIG_DEBUG_INFO=1 uImage • The next step is to translate the debug information into something that MULTI understands: – > dblink --scan_source -auto_translate vmlinux Freeze Mode Linux Kernel Debugging

Make probe connection in attach mode. Connection Details Linux Kernel Freeze Mode Debug OSA Explorer Install linuxserv on the Target

• Details in the linux_arm.pdf manual. • linux_serv for DaVinci is located in: – /lib/lnxarm_davinci5/linuxserv • This needs to be copied into the target root directory. • I put mine in /opt/ghs. Making a New Linux Application • More setup… • Create a Linux Build directory that contains cross tools and libraries. • Follow the instructions from the linux_arm.pdf section “Setting up a Linux Build Directory” (on page 22). – I used the softlink method. • Alternatively, you can run the setup script in Linux that sets this up automatically (dvevm_debug.sh). Linux_build_dir Here is what mine looks like: Making a New Linux Application

• More setup… • Follow the directions for libc.so in linux_arm.pdf. – Modify libc.so – you will need to modify your linux_build_dir/usr/lib/libc.so file to remove the /lib/ prefix from pathnames. – libc.so is located in linux_build_dir/lib/usr. You must change it to: – GROUP ( ../../lib/libc.so.6 ../../lib/libc_nonshared.a ) Build the Executable Fork Debug Project File-> Create New Project Building a Linux App

• Choose the fork debugging example. • Make sure to store it somewhere in your target filesystem hierarchy. Building a Linux App

Specify the Linux build directory that you created. Build the Application Start linuxserv on the Target Create linuxserv Connection Debug the Example DaVinci Technology Support Summary • Green Hills delivers complete support for TI’s DaVinci multicore processors. – Complete IDE support for both cores – Linux, Windows and Solaris hosted – Multicore C64x+/ARM debugging support – OS aware development and debugging for DSP/BIOS, Linux and INTEGRITY, velOSity and u-velOSity – Multi-threaded, multi-process application development and debugging – Advanced back-in-time debugging – Low-level debugging support – A proven-in-use INTEGRITY RTOS that is the foundation for our customers’ most critical applications and devices • Green Hills: a trusted partner to our customers with 24+ years of expertise in the embedded market Additional Resources

• Visit the Green Hills Web site at http://www.ghs.com – For more information and to download the Quick Start Guide for DaVinci™ Technology. – Request free evaluation CD of MULTI and INTEGRITY from our Web site. • Visit www.ti.com/davinci for: – Technical documentation –Benchmarks – White papers – TI and Green Hills software training –And more… Thanks!

MULTI for DaVinci Workshop

Joe Fabbre [email protected] IMPORTANT NOTICE

Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, modifications, enhancements, improvements, and other changes to its products and services at any time and to discontinue any product or service without notice. Customers should obtain the latest relevant information before placing orders and should verify that such information is current and complete. All products are sold subject to TI’s terms and conditions of sale supplied at the time of order acknowledgment.

TI warrants performance of its hardware products to the specifications applicable at the time of sale in accordance with TI’s standard warranty. Testing and other quality control techniques are used to the extent TI deems necessary to support this warranty. Except where mandated by government requirements, testing of all parameters of each product is not necessarily performed.

TI assumes no liability for applications assistance or customer product design. Customers are responsible for their products and applications using TI components. To minimize the risks associated with customer products and applications, customers should provide adequate design and operating safeguards.

TI does not warrant or represent that any license, either express or implied, is granted under any TI patent right, copyright, mask work right, or other TI intellectual property right relating to any combination, machine, or process in which TI products or services are used. Information published by TI regarding third-party products or services does not constitute a license from TI to use such products or services or a warranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual property of the third party, or a license from TI under the patents or other intellectual property of TI.

Reproduction of information in TI data books or data sheets is permissible only if reproduction is without alteration and is accompanied by all associated warranties, conditions, limitations, and notices. Reproduction of this information with alteration is an unfair and deceptive business practice. TI is not responsible or liable for such altered documentation.

Resale of TI products or services with statements different from or beyond the parameters stated by TI for that product or service voids all express and any implied warranties for the associated TI product or service and is an unfair and deceptive business practice. TI is not responsible or liable for any such statements.

Following are URLs where you can obtain information on other Texas Instruments products and application solutions:

Products Applications Amplifiers amplifier.ti.com Audio www.ti.com/audio Data Converters dataconverter.ti.com Automotive www.ti.com/automotive DSP dsp.ti.com Broadband www.ti.com/broadband Interface interface.ti.com Digital Control www.ti.com/digitalcontrol Logic logic.ti.com Military www.ti.com/military Power Mgmt power.ti.com Optical Networking www.ti.com/opticalnetwork Microcontrollers microcontroller.ti.com Security www.ti.com/security Low Power Wireless www.ti.com/lpw Telephony www.ti.com/telephony Video & Imaging www.ti.com/video Wireless www.ti.com/wireless

Mailing Address: Texas Instruments Post Office Box 655303 Dallas, Texas 75265

Copyright © 2007, Texas Instruments Incorporated