[acm press the 11th international conference - beijing, china (2012.04.16-2012.04.20)] proceedings...

2
Demo Abstract: MiDebug: Microcontroller Integrated Development and Debugging Environment * Chenguang Shen Software School Fudan University No. 825 Zhangheng Road Shanghai, 201203, China [email protected] Henry Herman, Zainul Charbiwala, Mani B. Srivastava Networked and Embedded Systems Laboratory Electrical Engineering Department University of California, Los Angeles Los Angeles, 90095, CA, USA {hherman,zainul,mbs}@ucla.edu ABSTRACT We present MiDebug, a web-based Integrated Development Environment (IDE) for embedded system programming with in-browser debugging capabilities. This web application greatly reduces the time and effort required for rapid prototyping of microcontroller based devices. Categories and Subject Descriptors D.2.6 [Software Engineering]: Programming Environments— Integrated Environments ; D.2.5 [Software Engineering]: Testing and Debugging—Debugging aids General Terms Design, Experimentation Keywords Microcontroller Programming, Debugging, Integrated De- velopment Environment 1. INTRODUCTION Cyber-physical systems have become ubiquitous, completely changing how we interact and sense the world. With the continuing drop in price of mass produced integrated de- vices that contain processors, sensors and radio transceivers the major cost of early development and deployment of sen- sor networks has shifted from hardware design to software design. Early cloud-based development systems are showing promise in lowering the barriers of entry to microcontroller software development. MiDebug is a convenient browser-based IDE that allows remote debugging of deeply networked embedded systems with limited physical access, while minimizing the required time for workstation toolchain installation. * This research was conducted while Chenguang Shen was a research intern at the Networked and Embedded Systems Laboratory, UCLA. Copyright is held by the author/owner(s). IPSN’12, April 16–20, 2012, Beijing, China. ACM 978-1-4503-1227-1/12/04. 2. BACKGROUND There are primarily two approaches to creating binaries for a microcontroller application; cross-compiling on a lo- cal client workstation or a server based approached via an Online IDE. 2.1 Local Cross-compile Cross-compiling requires a local toolchain on the devel- oper’s workstation. However, the installation of a toolchain can be complex and time consuming. Setting up a toolchain requires proficient understanding of the interrelated compo- nents (compiler, linker, debugger, driver libraries and etc.). For a software engineer unfamiliar with a hardware archi- tecture a significant time investment is needed to overcome the required learning curve. 2.2 Online IDE NXP and ARM have sponsored a project that utilizes web 2.0 technologies to create an online compiler and IDE - mbed.org [8]. Users can write code and compile through a web browser, then download and flash the executable file onto the microcontroller. Moving the toolchain to the cloud greatly reduces the installation time required for microcon- troller programming. While easy to use, the mbed IDE has limitations. It lacks hardware debugging capability as the microcontroller is sep- arated from the IDE when running programs. Therefore the JTAG debugging interface of the target processor is not ex- posed to the engineer, eliminating the possibility of using this industry standard debugging interface. As a result, a developer must write extra code (e.g. blink the LED) to show the running state of the microcontroller. The mbed platform is hardware specific - only supporting two devel- opment boards with two processors (NXP LPC17XX and LPC11u24). In contrast, by using the JTAG debugging interface, the architecture of MiDebug allows the system to easily support other common microcontroller platforms. MiDebug also has JTAG debugging capabilities. 3. SYSTEM DESIGN 3.1 Overview Figure 1 shows the overall system architecture of MiDe- bug. MiDebug consists of the server-based toolchain, the web-based code editor shown in Figure 2, and the local 133

Upload: mani-b

Post on 28-Feb-2017

216 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: [ACM Press the 11th international conference - Beijing, China (2012.04.16-2012.04.20)] Proceedings of the 11th international conference on Information Processing in Sensor Networks

Demo Abstract: MiDebug: Microcontroller IntegratedDevelopment and Debugging Environment ∗

Chenguang ShenSoftware SchoolFudan University

No. 825 Zhangheng RoadShanghai, 201203, China

[email protected]

Henry Herman, Zainul Charbiwala,Mani B. Srivastava

Networked and Embedded Systems LaboratoryElectrical Engineering Department

University of California, Los AngelesLos Angeles, 90095, CA, USA

{hherman,zainul,mbs}@ucla.edu

ABSTRACTWe present MiDebug, a web-based Integrated DevelopmentEnvironment (IDE) for embedded system programming within-browser debugging capabilities. This web application greatlyreduces the time and effort required for rapid prototypingof microcontroller based devices.

Categories and Subject DescriptorsD.2.6 [Software Engineering]: Programming Environments—Integrated Environments; D.2.5 [Software Engineering]:Testing and Debugging—Debugging aids

General TermsDesign, Experimentation

KeywordsMicrocontroller Programming, Debugging, Integrated De-velopment Environment

1. INTRODUCTIONCyber-physical systems have become ubiquitous, completely

changing how we interact and sense the world. With thecontinuing drop in price of mass produced integrated de-vices that contain processors, sensors and radio transceiversthe major cost of early development and deployment of sen-sor networks has shifted from hardware design to softwaredesign. Early cloud-based development systems are showingpromise in lowering the barriers of entry to microcontrollersoftware development.MiDebug is a convenient browser-based IDE that allows

remote debugging of deeply networked embedded systemswith limited physical access, while minimizing the requiredtime for workstation toolchain installation.

∗This research was conducted while Chenguang Shen wasa research intern at the Networked and Embedded SystemsLaboratory, UCLA.

Copyright is held by the author/owner(s).IPSN’12, April 16–20, 2012, Beijing, China.ACM 978-1-4503-1227-1/12/04.

2. BACKGROUNDThere are primarily two approaches to creating binaries

for a microcontroller application; cross-compiling on a lo-cal client workstation or a server based approached via anOnline IDE.

2.1 Local Cross-compileCross-compiling requires a local toolchain on the devel-

oper’s workstation. However, the installation of a toolchaincan be complex and time consuming. Setting up a toolchainrequires proficient understanding of the interrelated compo-nents (compiler, linker, debugger, driver libraries and etc.).For a software engineer unfamiliar with a hardware archi-tecture a significant time investment is needed to overcomethe required learning curve.

2.2 Online IDENXP and ARM have sponsored a project that utilizes

web 2.0 technologies to create an online compiler and IDE- mbed.org [8]. Users can write code and compile througha web browser, then download and flash the executable fileonto the microcontroller. Moving the toolchain to the cloudgreatly reduces the installation time required for microcon-troller programming.

While easy to use, the mbed IDE has limitations. It lackshardware debugging capability as the microcontroller is sep-arated from the IDE when running programs. Therefore theJTAG debugging interface of the target processor is not ex-posed to the engineer, eliminating the possibility of usingthis industry standard debugging interface. As a result, adeveloper must write extra code (e.g. blink the LED) toshow the running state of the microcontroller. The mbedplatform is hardware specific - only supporting two devel-opment boards with two processors (NXP LPC17XX andLPC11u24).

In contrast, by using the JTAG debugging interface, thearchitecture of MiDebug allows the system to easily supportother common microcontroller platforms. MiDebug also hasJTAG debugging capabilities.

3. SYSTEM DESIGN

3.1 OverviewFigure 1 shows the overall system architecture of MiDe-

bug. MiDebug consists of the server-based toolchain, theweb-based code editor shown in Figure 2, and the local

133

Page 2: [ACM Press the 11th international conference - Beijing, China (2012.04.16-2012.04.20)] Proceedings of the 11th international conference on Information Processing in Sensor Networks

Figure 1: System Architecture of MiDebug

browser plug-in. On the server side MiDebug aggregatestoolchains for different hardware architectures, enabling thesoftware engineer to choose the target platform. MiDebugalso provides the interfaces to add additional platforms, andusers can simply install programming support for other ar-chitectures by logging into the administration console. Theweb-based code editor is written purely in JavaScript basedon the CodeMirror project [1]. Users can write their codein the editor, then click a button to compile, run or debuga program.In order to flash and debug an executable file on the target

microcontroller, an additional interface between the serverand the target is required. We divided the target devices intotwo categories: network-connected devices and local work-station attached devices.Scientists and engineers often need to program and debug

the microcontrollers in deployed nodes. If these nodes areconnected to the developer’s network, the MiDebug servercan program and debug them through the client computerslocal network connection. MiDebug is flexible and can accessUSB hardware directly connected to the client workstation.Cloud based development tools can be an asset in embed-

ded systems courses. With a microcontroller-based devicewhich supports JTAG, students can log into the MiDebugwebsite to compile, run, and debug their programs. Cloudbased tools are inherently platform independent and can eas-ily support multiple operating systems. This allows studentsto focus on the program itself instead of setting up the en-vironment.

3.2 Network-Connected DeviceTo debug a network-connected device, we utilized the Gum-

stix Overo Fire Computer-on-Module [5] and the GumstixRoboVero [6] base board. The RoboVero has a FT2232D IC[3] that enables USB-JTAG programming the target micro-controller. Ubuntu is run on the Overo, as well as OpenOCD[7], providing a programming interface between the Overoand the target microprocessor.On the other end, the Overo communicates with the server

through the onboard LAN and WIFI module. The cross-GDB on MiDebug server can therefore interact with theOpenOCD on Overo.

3.3 Local DeviceDue to JavaScript security restrictions, we use the Fire-

Breath plug-in framework [2] to achieve debugging of local

Figure 2: Code Editor of MiDebug

devices. This framework enables native system calls throughthe JSAPI. The browser plug-in connects to OpenOCD run-ning on the local computer and the cross-GDB running onserver. The WebSocket protocol is used to transmit databetween the plug-in and the server. The plug-in supportsmultiple operating systems and browsers. We are currentlyintegrating OpenOCD into the plug-in so that no additionalinstallation is required.

3.4 GitHub SupportA notable trend today is the emerging programmer com-

munity, such as GitHub [4]. We have integrated MiDebugwith GitHub; programmers can use GitHub as a versioncontrol tool, and share their code on GitHub with others.Currently MiDebug uses GitHub’s OAuth to authenticateusers, making GitHub repositories accessible to logged inusers.

4. CONCLUSION AND FUTURE WORKMiDebug is a convienent tool for microcontroller program-

ming. Users can simply develop and debug firmware for mi-crocontrollers on a client workstation through a web-browser.To the best of our knowledge, MiDebug is the first cloud-based microcontroller integrated development environmentto support debugging of local devices. In the future, we aregoing to release MiDebug for testing and feedback. We areadding support for additional platforms and MiDebug willbe evaluated as a development platform in an embeddedsystems course.

5. REFERENCES[1] Codemirror. http://codemirror.net/.

[2] Firebreath framework. http://www.firebreath.org/.

[3] Ft2232d - dual usb uart/fifo ic. http://www.ftdichip.com/Products/ICs/FT2232D.htm.

[4] Github: Social coding. https://github.com/.

[5] Gumstix overo. https://www.gumstix.com/store/product_info.php?products_id=227.

[6] Gumstix robovero. https://www.gumstix.com/store/product_info.php?products_id=262.

[7] Open on-chip debugger. http://openocd.sourceforge.net/.

[8] Rapid prototyping for microcontrollers | mbed. http://mbed.org.

134