VM Application Debugging via JTAG: Android TRACE32 JTAG Debug Bridge ADB Architecture Stop-Mode implications for ADB JTAG Transport Outlook



Similar documents
Android Development: a System Perspective. Javier Orensanz

Linux. Reverse Debugging. Target Communication Framework. Nexus. Intel Trace Hub GDB. PIL Simulation CONTENTS

Reminders. Lab opens from today. Many students want to use the extra I/O pins on

As shown, the emulator instance connected to adb on port 5555 is the same as the instance whose console listens on port 5554.

ADB (Android Debug Bridge): How it works?

An Introduction to Android. Huang Xuguang Database Lab. Inha University

The power of root on Android emulators

Development With ARM DS-5. Mervyn Liu FAE Aug. 2015

Android Programming and Security

Running a Program on an AVD

EXPLORING LINUX KERNEL: THE EASY WAY!

What else can you do with Android? Inside Android. Chris Simmonds. Embedded Linux Conference Europe Copyright 2010, 2net Limited.

An Introduction to Android

Graduate presentation for CSCI By Janakiram Vantipalli ( Janakiram.vantipalli@colorado.edu )

Lab 4 In class Hands-on Android Debugging Tutorial

Android Development. Marc Mc Loughlin

Islamic University of Gaza. Faculty of Engineering. Computer Engineering Department. Mobile Computing ECOM Eng. Wafaa Audah.

Introduction to Android Development. Jeff Avery CS349, Mar 2013

Software development. Development requirements. Java. Android SDK. Eclipse IDE (optional)

Introduction to Android. CSG250 Wireless Networks Fall, 2008

Example of Standard API

How To Develop Android On Your Computer Or Tablet Or Phone

Smartphone market share

Visualizing gem5 via ARM DS-5 Streamline. Dam Sunwoo ARM R&D December 2012

Технологии Java. Android: Введение. Кузнецов Андрей Николаевич. Санкт-Петербургский Государственный Политехнический Университет

Example Connection between USB Host and Android

Training Android Debugging

Android, Bluetooth and MIAC

STLinux Software development environment

Security Issues in Android Custom ROMs

ODROID Multithreading in Android

ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I)

Introduction to Android

Android Application for Accessing KNX Devices via IP Connection

IOTIVITY AND EMBEDDED LINUX SUPPORT. Kishen Maloor Intel Open Source Technology Center

l What is Android? l Getting Started l The Emulator l Hello World l ADB l Text to Speech l Other APIs (camera, bitmap, etc)

The "Eclipse Classic" version is recommended. Otherwise, a Java or RCP version of Eclipse is recommended.

Review from last time. CS 537 Lecture 3 OS Structure. OS structure. What you should learn from this lecture

Real-Time KVM for the Masses Unrestricted Siemens AG All rights reserved

Friendly ARM MINI2440 & Dalvik Virtual Machine with Android

Wave Relay System and General Project Details

AllJoyn Android Environment Setup Guide

GETTING STARTED WITH ANDROID DEVELOPMENT FOR EMBEDDED SYSTEMS

CS378 -Mobile Computing. Android Overview and Android Development Environment

Understand and Build Android Programming Environment. Presented by: Che-Wei Chang

Module Title: Software Development A: Mobile Application Development

Title: Appium Automation for Mac OS X. Created By: Prithivirajan M. Abstract. Introduction

Lecture 1 Introduction to Android

DB2 Connect for NT and the Microsoft Windows NT Load Balancing Service

ELEC 377. Operating Systems. Week 1 Class 3

MuL SDN Controller HOWTO for pre-packaged VM

Tutorial on Basic Android Setup

Practical Android Projects Lucas Jordan Pieter Greyling

Board also Supports MicroBridge

DS-5 ARM. Using the Debugger. Version 5.7. Copyright 2010, 2011 ARM. All rights reserved. ARM DUI 0446G (ID092311)

Development. SriSeshaa Technologies. Table of Contents

CSE 120 Principles of Operating Systems. Modules, Interfaces, Structure

Introducing the Adafruit Bluefruit LE Sniffer

Introduction to Android

Android Environment Emulator

Introduction to Android Android Architecture Software Development Purpose of the project Location Based Service (LBS) Android. Location class Google

Overview of CS 282 & Android

DS-5 ARM. Using the Debugger. Version Copyright ARM. All rights reserved. ARM DUI 0446M (ID120712)

AlienVault Unified Security Management (USM) 4.x-5.x. Deploying HIDS Agents to Linux Hosts

IO Visor: Programmable and Flexible Data Plane for Datacenter s I/O

Application-Level Debugging and Profiling: Gaps in the Tool Ecosystem. Dr Rosemary Francis, Ellexus

Programmable Networking with Open vswitch

ICS 351: Today's plan. IP addresses Network Address Translation Dynamic Host Configuration Protocol Small Office / Home Office configuration

Developing Web Services with Eclipse and Open Source. Claire Rogers Developer Resources and Partner Enablement, HP February, 2004

Automation of Smartphone Traffic Generation in a Virtualized Environment. Tanya Jha Rashmi Shetty

Building a Continuous Integration Pipeline with Docker

Introduction to Android: Hello, Android! 26 Mar 2010 CMPT166 Dr. Sean Ho Trinity Western University

Use Cases for Target Management Eclipse DSDP-Target Management Project

Intel Integrated Native Developer Experience (INDE): IDE Integration for Android*

Smart Shopping- An Android Based Shopping Application

Android (in)security. Having fun with Android. Sarantis Makoudis

TCP Labs. WACREN Network Monitoring and Measurement Workshop Antoine Delvaux perfsonar developer

Introduction to TIZEN SDK

Android Auto PoC. October Oct-15. Maxim Ovchinnikov Architect Harman

Android Development Tools for Eclipse

Allow Installation from Unknown Sources

Course Project Documentation

Eddy Integrated Development Environment, LemonIDE for Embedded Software System Development

Fahim Uddin 1. Java SDK

file://d:\webs\touch-base.com\htdocs\documentation\androidplatformnotes52.htm

i.mx USB loader A white paper by Tristan Lelong

Network Licensing. White Paper 0-15Apr014ks(WP02_Network) Network Licensing with the CRYPTO-BOX. White Paper

Virtual Private Networks

Mobile Application Hacking for Android and iphone. 4-Day Hands-On Course. Syllabus

Using Chroot to Bring Linux Applications to Android

Introduction to Android

Virtualization System Vulnerability Discovery Framework. Speaker: Qinghao Tang Title:360 Marvel Team Leader

ELIXIR LOAD BALANCER 2

Android Architecture. Alexandra Harrison & Jake Saxton

Platform as a Service and Container Clouds

Programming with Android: SDK install and initial setup. Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna

Android Security for Enterprise App Developers Jon Preedy

CT LANforge WiFIRE Chromebook a/b/g/n WiFi Traffic Generator with 128 Virtual STA Interfaces

VoIP support on Qtopia. Vladimir Minenko, Ph.D.

FioranoMQ 9. High Availability Guide

Transcription:

VM Application Debugging via JTAG: Android TRACE32 JTAG Debug Bridge ADB Architecture Stop-Mode implications for ADB JTAG Transport Outlook TRACE32 JTAG Debug Bridge Hagen Patzke 2011-06-16 www.lauterbach.com 1

VM Application Debugging with ADB Host Android Target Eclipse application debugging DVM DVM TCP/IP TCP/IP server daemon USB physical connection USB TCP/IP TCP/IP TRACE32 JTAG Debug Bridge Hagen Patzke 2011-06-16 www.lauterbach.com 2

Application Debugging (Run-Mode) Host Eclipse IDE ADT server TCP/IP or USB stack Android Target daemon TCP/IP or USB stack Virtual Machine Process Dalvik VM VM Debug Support Memory Model VM Control VM Interpreter VM Application Code + Objects VM Core Libraries Code + Objects TRACE32 JTAG Debug Bridge Hagen Patzke 2011-06-16 www.lauterbach.com 3

Architecture system/core//overview.txt [...] As a whole, everything works through the following components: 1. The ADB server [...] runs on the host [and] is really one giant multiplexing loop whose purpose is to orchestrate the exchange of data (packets, really) between clients, services and devices. 2. The ADB daemon (d) [runs on a] device or emulated system [and connects] to the ADB server (through USB for devices, through TCP for emulators) and provide[s] a few services for clients that run on the host. 3. The ADB command-line client [...] is used to run commands from a shell or a script. It first tries to locate the ADB server on the host machine, and will start one automatically if none is found. Currently, a single '' binary is used for both the server and client. [This] makes distribution and starting the server easier. [...] TRACE32 JTAG Debug Bridge Hagen Patzke 2011-06-16 www.lauterbach.com 4

Architecture system/core//protocol.txt --- a replacement for aproto ------------------------------------------- When it comes down to it, aproto's primary purpose is to forward various streams between the host computer and client device (in either direction). This replacement further simplifies [this concept]. The host side becomes a simple comms bridge with no "UI", which will be used by either commandline or interactive tools to communicate with a device or emulator that is connected to the bridge. The protocol is designed to be straightforward and well-defined [...]. The protocol discards the layering aproto has and should allow the implementation to be much more robust. [...] TRACE32 JTAG Debug Bridge Hagen Patzke 2011-06-16 www.lauterbach.com 5

Communication Architecture server _main daemon _main transport transport usb socket usb socket Different transport methods active at the same time: usb_init() local_init() Select transport at startup: IF property(service..tcp.port) listen at tcp:port IF access(/dev/android_) listen at USB gadget device DEFAULT listen at tcp:5037 TRACE32 JTAG Debug Bridge Hagen Patzke 2011-06-16 www.lauterbach.com 6

Case A: Using Sockets server _main daemon _main transport transport usb socket usb socket ETH TRACE32 JTAG Debug Bridge Hagen Patzke 2011-06-16 www.lauterbach.com 7

Case B: Using USB server _main daemon _main transport transport usb socket usb socket USB2.0 TRACE32 JTAG Debug Bridge Hagen Patzke 2011-06-16 www.lauterbach.com 8

VM Application Debugging via JTAG: Android TRACE32 JTAG Debug Bridge ADB Architecture Stop-Mode implications for ADB JTAG Transport Outlook TRACE32 JTAG Debug Bridge Hagen Patzke 2011-06-16 www.lauterbach.com 9

Application Debugging via TCP/IP Host Eclipse IDE ADT server TCP/IP Android Target daemon TCP/IP Virtual Machine Process Dalvik VM VM Debug Support Memory Model VM Control VM Interpreter VM Application Code + Objects VM Core Libraries Code + Objects TRACE32 JTAG Debug Bridge Hagen Patzke 2011-06-16 www.lauterbach.com 10

App Debug via TCP/IP (Run-Mode) + JTAG Debug (Stop-Mode) Host Android Target TRACE32 USB/ETH stop-mode debugging PowerDebug JTAG Eclipse server TCP/IP run-mode debugging TCP/IP d TRACE32 JTAG Debug Bridge Hagen Patzke 2011-06-16 www.lauterbach.com 11

Stop-Mode Implications for TCP/IP IP was designed for robustness Host does not detect device presence Communication can be resumed Eclipse can time out but often an ADT reconnect is possible TRACE32 JTAG Debug Bridge Hagen Patzke 2011-06-16 www.lauterbach.com 12

Application Debugging via USB Host Eclipse IDE ADT server USB Android Target daemon USB Virtual Machine Process Dalvik VM VM Debug Support Memory Model VM Control VM Interpreter VM Application Code + Objects VM Core Libraries Code + Objects TRACE32 JTAG Debug Bridge Hagen Patzke 2011-06-16 www.lauterbach.com 13

App Debug via USB (Run-Mode) + JTAG Debug (Stop-Mode) Host Android Target TRACE32 USB/ETH stop-mode debugging PowerDebug JTAG Eclipse server USB run-mode debugging USB d TRACE32 JTAG Debug Bridge Hagen Patzke 2011-06-16 www.lauterbach.com 14

JTAG 'Stop' loss of USB communication Host Eclipse IDE ADT server USB Android Target daemon USB Virtual Machine Process Dalvik VM VM Debug Support Memory Model VM Control VM Interpreter VM Application Code + Objects VM Core Libraries Code + Objects USB comm loss on JTAG 'break' TRACE32 JTAG Debug Bridge Hagen Patzke 2011-06-16 www.lauterbach.com 15

Stop-Mode Implications for USB Host periodically polls USB devices Host detects device presence ADB 'kicks' disconnected devices Host reconnect possible only with USB plug-in event No on-the-fly device reconnect mechanism provided Multiple reconnects per second can be dangerous USB Communication Breakdown TRACE32 JTAG Debug Bridge Hagen Patzke 2011-06-16 www.lauterbach.com 16

VM Application Debugging via JTAG: Android TRACE32 JTAG Debug Bridge ADB Architecture Stop-Mode implications for ADB JTAG Transport Outlook TRACE32 JTAG Debug Bridge Hagen Patzke 2011-06-16 www.lauterbach.com 17

Introduce Case C: Using JTAG server _main daemon _main transport transport usb socket??? usb socket??? JTAG Is this possible? TRACE32 JTAG Debug Bridge Hagen Patzke 2011-06-16 www.lauterbach.com 18

TRACE32 JTAG Bridge Ideas: ARM9 10 11 has Debug Communication Channel - a DCC register (pair) that debugger can r/w via JTAG TRACE32 Fast Data exchange (FDX) can use DCC TRACE32 FDX client can send/receive data via TRACE32 RemoteAPI or via named pipes Try to keep changes limited to system/core/ Must be possible on Linux + Windows hosts Must work on SMP systems Use as working code reference TRACE32 JTAG Debug Bridge Hagen Patzke 2011-06-16 www.lauterbach.com 19

Communication Architecture server _main daemon _main transport transport usb socket pipe usb socket DCC On the host: TRACE32 FDX using JTAG (named pipe) transport On the target: TRACE32 FDX using JTAG (ARM DCC) transport TRACE32 JTAG Debug Bridge Hagen Patzke 2011-06-16 www.lauterbach.com 20

Introduce Case C: Using JTAG server _main daemon _main transport transport usb socket pipe usb socket DCC JTAG This is possible! TRACE32 JTAG Debug Bridge Hagen Patzke 2011-06-16 www.lauterbach.com 21

Communication Architecture New Version server daemon _main _main transport transport usb socket pipe usb socket DCC Different transport methods active at the same time: jtag_init() usb_init() local_init() IF property(service..jtag) > 0 listen at DCC register IF property(service..tcp.port) listen at tcp:port IF access(/dev/android_) listen at USB gadget device DEFAULT listen at tcp:5037 TRACE32 JTAG Debug Bridge Hagen Patzke 2011-06-16 www.lauterbach.com 22

Assisted Run-Mode Debugging via JTAG bridge Host Eclipse IDE ADT server TRACE32 JTAG bridge Android Target daemon TRACE32 JTAG bridge Virtual Machine Process Dalvik VM VM Debug Support Memory Model VM Control VM Interpreter VM Application Code + Objects VM Core Libraries Code + Objects TRACE32 JTAG Debug Bridge Hagen Patzke 2011-06-16 www.lauterbach.com 23

Application Debugging via TRACE32 JTAG Bridge Host Eclipse application debugging Android Target DVM DVM server FDX PIPE TCP/IP USB run-mode debugging daemon ARM DCC TRACE32 stop-mode debugging USB/ETH PowerDebug JTAG TRACE32 JTAG Debug Bridge Hagen Patzke 2011-06-16 www.lauterbach.com 24

TRACE32 JTAG Bridge Initial Implementation git patch for server (host) and d (target) adds JTAG transport to (Run-Mode), tested on FroYo TRACE32 FDX in ARM9 10 11 DCC4D mode for d data TRACE32 FDX in Named Pipe mode for server data tested on Linux + Windows hosts and on SMP target on/off switch for d JTAG bridge mode (setprop, d restart) not very fast, but only alternative if ETH or USB are not available working reference code + open source: customers and 3 rd parties can adapt the patch, e.g. for non-arm target platforms TRACE32 JTAG Debug Bridge Hagen Patzke 2011-06-16 www.lauterbach.com 25

TRACE32 JTAG Bridge Patch Timeline 2011-04-08 initial Linux version (tested on MEP6410) 2011-05-24 reworked pipe system to support Windows 2011-06-10 SMP support (tested on PandaBoard) Available Today! TRACE32 JTAG Debug Bridge Hagen Patzke 2011-06-16 www.lauterbach.com 26

VM Application Debugging via JTAG: Android TRACE32 JTAG Debug Bridge ADB Architecture Stop-Mode implications for ADB JTAG Transport Outlook TRACE32 JTAG Debug Bridge Hagen Patzke 2011-06-16 www.lauterbach.com 27

TRACE32 JTAG Bridge What Can Be Done? introduce Linux Kernel JTAG Communication Device encapsulate target-specific communciation code, different platforms expose the same JTAG interface could provide multiple JTAG communication channels for Terminal, System Trace, ADB and Customer Use test on more target platforms make d transport channel easily runtime-switchable git-push code changes to Android and Linux Kernel repos to improve JTAG debugging + transport awareness profile TRACE32 FDX pipe connection, maybe add TCP/IP mode TRACE32 JTAG Debug Bridge Hagen Patzke 2011-06-16 www.lauterbach.com 28

TRACE32 JTAG Bridge Who Can Do It? introduce Linux Kernel JTAG Communication Device encapsulate target-specific communciation code, different platforms expose the same JTAG interface could provide multiple JTAG communication channels for Terminal, System Trace, ADB and Customer Use test on more target platforms make d transport channel easily runtime-switchable git-push code changes to Android and Linux Kernel repos to improve JTAG debugging + transport awareness everyone can do this (Customer, 3 rd Party, You!) profile TRACE32 FDX pipe connection, maybe add TCP/IP mode only possible for Lauterbach TRACE32 JTAG Debug Bridge Hagen Patzke 2011-06-16 www.lauterbach.com 29

Thank You! Hagen Patzke hagen.patzke@lauterbach.com http://www.lauterbach.com/vmandroid.html TRACE32 JTAG Debug Bridge Hagen Patzke 2011-06-16 www.lauterbach.com 30