STM32JAVA. Embedded Java Solutions for STM32



Similar documents
Java Embedded Applications

Fachbereich Informatik und Elektrotechnik SunSPOT. Ubiquitous Computing. Ubiquitous Computing, Helmut Dispert

The BSN Hardware and Software Platform: Enabling Easy Development of Body Sensor Network Applications

Development of Java ME

Lecture 1 Introduction to Android

Practical Performance Understanding the Performance of Your Application

The Java Virtual Machine and Mobile Devices. John Buford, Ph.D. Oct 2003 Presented to Gordon College CS 311

Effective Java Programming. efficient software development

Programación de Sistemas Empotrados y Móviles (PSEM)

Java Embedded Applications Development and Manufacturing

Implementação. Interfaces Pessoa Máquina 2010/ Salvador Abreu baseado em material Alan Dix. Thursday, June 2, 2011

Application Note: AN00141 xcore-xa - Application Development

Mobility Introduction Android. Duration 16 Working days Start Date 1 st Oct 2013

STLinux Software development environment

Embedded Software development Process and Tools:

System Structures. Services Interface Structure

Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives

Chapter 1. Introduction to ios Development. Objectives: Touch on the history of ios and the devices that support this operating system.

Copyright 2014, Oracle and/or its affiliates. All rights reserved.

Selection Criteria for ZigBee Development Kits

Digitale Signalverarbeitung mit FPGA (DSF) Soft Core Prozessor NIOS II Stand Mai Jens Onno Krah

An Easier Way for Cross-Platform Data Acquisition Application Development

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Complete Integrated Development Platform Copyright Atmel Corporation

10 STEPS TO YOUR FIRST QNX PROGRAM. QUICKSTART GUIDE Second Edition

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

KURA M2M/IoT Gateway. reducing the distance between embedded and enterprise technologies. Tiziano Modotti, October 28 th, 2014

Open Source building blocks for the Internet of Things. Benjamin Cabé JFokus 2013

Embedded Component Based Programming with DAVE 3

Q N X S O F T W A R E D E V E L O P M E N T P L A T F O R M v Steps to Developing a QNX Program Quickstart Guide

Keys To Developing an Embedded UA Server

CSC230 Getting Starting in C. Tyler Bletsch

Enhanced Project Management for Embedded C/C++ Programming using Software Components

Building Applications Using Micro Focus COBOL

Objectives. Chapter 2: Operating-System Structures. Operating System Services (Cont.) Operating System Services. Operating System Services (Cont.

Board also Supports MicroBridge

Using the TASKING Software Platform for AURIX

Jonathan Worthington Scarborough Linux User Group

Java VM monitoring and the Health Center API. William Smith

Alcatel-Lucent IMS Application Server

Medical Device Design: Shorten Prototype and Deployment Time with NI Tools. NI Technical Symposium 2008

VELOCITY LAB TM Embedded Development Ecosystem

Università Degli Studi di Parma. Distributed Systems Group. Android Development. Lecture 1 Android SDK & Development Environment. Marco Picone

PC Base Adapter Daughter Card UART GPIO. Figure 1. ToolStick Development Platform Block Diagram

Applications to Computational Financial and GPU Computing. May 16th. Dr. Daniel Egloff

Example of Standard API

Freescale Semiconductor, I

Running a Program on an AVD

1/5/2013. Technology in Action

Android Developer Fundamental 1

CSCI E 98: Managed Environments for the Execution of Programs

Java ME & NetBeans Mobility. Petr Suchomel Architect, NetBeans Mobility Sun Microsystems

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

The Future of IoT. Zach Shelby VP Marketing, IoT Feb 3 rd, 2015

How To Develop A Toolstick

INTRODUCTION TO CLOUD COMPUTING CEN483 PARALLEL AND DISTRIBUTED SYSTEMS

Oracle Application Development Framework Overview

ORACLE MOBILE APPLICATION FRAMEWORK DATA SHEET

Best Practices for Deploying, Replicating, and Managing Real-Time and FPGA Applications. ni.com

UM1680 User manual. Getting started with STM32F429 Discovery software development tools. Introduction

Easing embedded Linux software development for SBCs

Customer Experience. Silicon. Support & Professional Eng. Services. Freescale Provided SW & Solutions

Introduction to Virtual Machines

Publishing to TIZEN Using the Automated Conversion/Repackaging of Existing Android Apps. Hyeokgon Ryu, Infraware Technology, Ltd.

Programming the VEX Robot

Operating System Structures

Virtualization and Other Tricks.

Java and Real Time Storage Applications

Getting Started with Tizen SDK : How to develop a Web app. Hong Gyungpyo 洪 競 杓 Samsung Electronics Co., Ltd

Mobile Operating Systems. Week I

How To Develop Android On Your Computer Or Tablet Or Phone

Virtual Platforms Addressing challenges in telecom product development

A Modular Approach to Teaching Mobile APPS Development

12. Introduction to Virtual Machines

Java Monitoring. Stuff You Can Get For Free (And Stuff You Can t) Paul Jasek Sales Engineer

How To Use Java On An Ipa (Jspa) With A Microsoft Powerbook (Jempa) With An Ipad And A Microos 2.5 (Microos)

Android Development. Lecture AD 0 Android SDK & Development Environment. Università degli Studi di Parma. Mobile Application Development

High Performance or Cycle Accuracy?

New Features in XE8. Marco Cantù RAD Studio Product Manager

Lecture 25 Symbian OS

Technical Data Sheet SCADE R17 Solutions for ARINC 661 Compliant Systems Design Environment for Aircraft Manufacturers, CDS and UA Suppliers

Chapter 3 Operating-System Structures

ANDROID PROGRAMMING - INTRODUCTION. Roberto Beraldi

Notes and terms of conditions. Vendor shall note the following terms and conditions/ information before they submit their quote.

picojava TM : A Hardware Implementation of the Java Virtual Machine

Data Transfer between Two USB Flash SCSI Disks using a Touch Screen

Instrumentation Software Profiling

Mobile Application Development Android

BEAJRockit Mission Control. Using JRockit Mission Control in the Eclipse IDE

Design for Success: Designing for the Internet of Things with TiWiConnect

UG103.8 APPLICATION DEVELOPMENT FUNDAMENTALS: TOOLS

System Requirements Table of contents

Know the Difference. Unified Functional Testing (UFT) and Lean Functional Testing (LeanFT) from HP

32F072BDISCOVERY. Discovery kit for STM32F072xx microcontrollers. Features. Description

Decomposition into Parts. Software Engineering, Lecture 4. Data and Function Cohesion. Allocation of Functions and Data. Component Interfaces

An Overview of Java. overview-1

Chapter 2 System Structures

Source Code Translation

UEFI on Dell BizClient Platforms

Transcription:

STM32JAVA Embedded Java Solutions for STM32

What is STM32Java? Solution to develop and to deploy software applications on STM32F0 to STM32F7 microcontrollers using Java Help to reduce the total cost of ownership of embedded system design (development, BOM, maintenance and updates) This solution is designed in partnership with:» STMicroelectronics: STM32 manufacturer» IS2T: Software editor (provider of the MicroEJ software platform)

MicroEJ Overview

MicroEJ MicroEJ SDK lets you use Java for embedded system development Goals of this presentation» Discover MicroEJ

Agenda Embedded Java» Why using Java for embedded system development? MicroEJ SDK» What is MicroEJ? Java platforms» What is the concept of software platform? Execution» How do I execute my Java application? Interactions with the native world» How can C and Java communicate? GUI» How to design a rich graphical application?

Embedded Java

Software Complexity 32-bits MCU with important memory Increasing complexity with GUI and IoT

Java Modern object-oriented language» Loose coupling» Managing complexity Portability Memory management» Garbage collector» Ideal for event driven systems Widely used

Java Platform Concept /** * Java Copyright 2009-2012 IS2T. All rights reserved. * For demonstration purpose only. * IS2T PROPRIETARY. Use is subject to license terms. */ package com.is2t.appnotes.microui.mvc; import java.io.ioexception; import ej.microui.eventgenerator; import ej.microui.io.display; import ej.microui.io.flyingimage; import ej.microui.io.image; import ej.microui.io.pointer; Java language /** * Shows three views (bar, pie, text) that represents the same data model (a percentage value). * It is possible to resize the Java technology RTOS JVM Libs RTOS JVM Libs RTOS JVM Libs Java Virtual Machines (JVM - software processors) Microprocessors IS2T 2012

Software Portability Portability is needed when» You want to use the same code for several projects» Your hardware platform becomes obsolete» You target several hardware platforms with the same application When switching to a new hardware platform» You only change the hardware specific parts» You re-create an isofunctional computing platform» Your software runs the same on this new platform Hardware abstracted software is the key point for portability

MicroEJ SDK

MicroEJ SDK Create platforms and software running on these platforms MicroEJ SDK provides» MicroEJ IDE, based on Eclipse» Tools to build platforms» Tools for application development like code coverage or simulation» Libraries to code with Java as high-level language» Native libraries and mechanism to allow developers to use C and to create interactions between C and Java features

MicroEJ IDE

Supported architectures Available» ARM Cortex-M» Cortex-A» Linux» Android» ios Additional architectures on demand

Optimized JVMs for Embedded Systems 32/64-bit CPU Optimized implementation 32-bit MCU/MPU Java Code quality Productivity Reliability Portability Scalability Maintainability Code density Java High speed execution Tiny footprint Interface C/asm Low power,

Java Runtime Compiler version» Java 7 Runtime library» EDC (Embedded Device Configuration)» Close to Java ME MicroJvm virtual machine

MicroEJ Libraries Available libraries» EDC» B-ON» MicroUI» MWT» NLS» ECOM-COMM» Shielded Plug» SNI». Specifications by ESR Consortium» http://www.e-s-r.net/

Example Washing machine Hardware» STM32F2x (Cortex-M3) 120MHz» 16-bit bpp QVGA LCD» Touchscreen Libraries» B-ON, CLDC, MicroUI, MWT, SNI Boot time < 2 ms Application M em ory Requirem ents Flash 422KB RAM 42KB Virtual Machine (runtime & GC) 28KB Virtual Machine 1KB Libraries (graphics, com, float ) 132KB Native Stack 28KB Graphical resources (images) 228KB Application 34KB Application 13KB

Example Washing machine Hardware» STM32F429 @ 180MHz» 32-bit col. WQVGA LCD» Touchscreen Performance» Refresh rate = 50fps» CPU load = 24 %» Boot time < 2ms Application M em ory Requirem ents FLASH 161KB RAM 11KB Java engine & Smart RAM optimizer 28KB Java engine 1KB Firmware (STUI libs, BSP, ) 114KB C Stack 5KB Graphical resources (images, fonts) 7KB Application 12KB Application 5KB

Java Platforms

Java Platforms JPF = Java PlatForm Java is used to code the application C (or any other native language) is used along with MicroEJ libraries, drivers and operating system to construct the platform Decoupling software from hardware

Application Point of View Application sees the JPF as a framework» It offers several libraries» It executes the application Abstraction barrier hiding hardware details» Application is agnostic to hardware specifications» Application uses high-level functions given by the platform APIs» JPF translates high-level functionalities to level-low operations

Abstraction Example Strong coupling with hardware particularity» Application waits for a push button pressed event to start a motor» What if the order is now sent through a serial link? Bad abstraction! Software not aware of hardware details» Application should be waiting for a start motor even» No matter how the order is given, semantic is not changed Good abstraction!

Target Specific A JPF targets» A specific microcontroller architecture since one JVM is made for one microcontroller specific instruction set» A specific board and how peripherals are connected to the microcontroller A JPF also depends on the compiler» Keil s ARMCC» GCC» IAR Embedded Workbench»

Dual platforms : SimJPF & EmbJPF JPF is composed of two platforms» SimJPF : for simulation (on workstation)» EmbJPF : for embedded execution (on microcontroller) Parallel update» You should update both when adding a new feature» Create mock objects to simulate hardware features

Java Platform Content A JPF includes» MicroJvm Java Virtual Machine» Simulator» Java and native libraries» Drivers» Operating system» Native code provided by developers» Mock objects»

Drag Emb Drop TM

Benefits Keep hardware and software design cycles independent Application prototype ahead of hardware development Simplify design, tests, evolutions Reduce development time

Waterfall Mkt. specs HW ready 1 st integration SW ready Release Marketing Human factors Graphics Hardware dev. Only few changes are possible Software dev. HW/SW integration IS2T 2013 time

Agility Mkt. specs HW ready JPF ready Release Marketing Human factors & Graphics Software dev. (continuous integration and iterative deliveries) Simulated Java Platform Hardware dev. Embedded Java Platform HW/JPF test Changes are possible anytime IS2T 2013

Execution

Execution Flows

Launch Configurations Launch Configurations» Eclipse provides the concept for launch configurations» A launch configuration tells what is executed, what is the runtime environment, what are the execution options» Available through the Run menu A Launch Configuration can be executed as» A Run Configuration to simply run an application» A Debug Configuration to debug this application External Tool Configuration to run an external program

Launch Configurations MicroEJ provides new launch configuration types» MicroEJ Application» MicroEJ Tool

MicroEJ Application A MicroEJ Application configuration lets you» Select the kind of execution (SimJPF or EmbJPF)» Configure libraries and memory usage

Execution Flow on SimJPF Simulator is launched on the workstation Java application is executed Simulator uses mock objects to simulate hardware features

SimJPF Simulator engine is a Java SE application» Works on Windows, Linux and OS X Same byte code is executed by both SimJPF and EmbJPF Features» Debugging inside Eclipse / MicroEJ (JDWP)» Heap dumping for analysis» Code coverage» Partial simulation of the EmbJPF characteristics

Execution Flow on EmbJPF General case» Java application is compiled and link with libraries» An object file is generated» This file is linked with drivers and operating system to produce executable files (done by a 3 rd party tool) Kickstart platforms are a special case» They include precompiled driver and OS» They have special linker scripts» MicroEJ create executable files

MicroEJ and C IDE MicroEJ provides» Java application as an object file» Java runtime environment as library files» Header files with types and functions provided by these libraries C IDE provides» Drivers» Operating system» LLAPI implementation C IDE compiles C code, link application and deploy binary file

C IDE Configuration Modify include path» MicroEJ header files must be on the path Modify linker configuration» MicroEJ libraries and Java application object file must be used during link edition Start Java from your C program» sni.h provides functions to initialize and start the JVM

Low Level API Generic programing and implementation details» JVM and libraries integrate everything that is generic» But some functions cannot be generic since they are specific to the hardware target along with BSP» Platform developers must implement these functions in C Several modules come with Low Level APIs (LLAPIs) to implement» Runtime (LLMJVM)» Display (LLDISPLAY)» Input (LLINPUT)» LED (LLLED)» ECOM-COMM (LLCOMM)»

Executable Generation

Interactions with Native World

Interactions with Native World Not everything can be done in Java» Access to hardware peripherals (registers) Not everything should be done in Java» Intense computation, especially with matrices» Useless to translate legacy code to a new language overall application is in fact composed of Java and C need for interactions between Java and native worlds

Interactions with Native World You may need to create your own API to access your specific hardware peripheral» SNI / HIL to call a C function from a Java method You may need to share data between Java and C» Shielded Plug to create a database to exchange data» B-ON s Immortal Objects to share segments of memory Java application should be hardware agnostic» Design high-level APIs» Find the good abstraction level

SNI

SNI Java Side SNI = Simple Native Interface Java offers the native keyword» Declares a method which is not implemented in Java» Must be static (visibility doesn t matter)» Example: public static native void log(int id); SNI connects a Java native method to a C function» Defines a naming convention to create a symbol» Defines the calling convention at runtime

SNI Native Side Implementation» Developers write the corresponding functions» They name these functions after the ESR naming convention» sni.h provides compatible type definitions Link edition» Java object file generated by MicroEJ contains unresolved symbols» 3 rd party IDE links the Java object file with the C functions» All dependencies are revolved during link edition hence no surprise at runtime

Naming Convention package GPIO; public class Main { public static native void toggle(); } public static void main(string[] a) throws InterruptedException { while(true){ toggle(); Thread.sleep(10); } } #include <sni.h> #include gpio.h void Java_GPIO_Main_toggle(){ GPIOE->ODR ^= GPIO_Pin_2 ; }

Flow Immortals Java methods C functions Call C Java heap C heap Return to Java T I M E

Java threads Green Thread Architecture 1x native task (Java) Native tasks (C/ASM) Shielded Plug (SP) Simple Native Interface (SNI) SP SNI RTOS SP SNI GUI hardware LCD, buttons, Applicative hardware Sensors, actuators, IS2T 2013

SNI-GT SNI and SNI-GT Advantages» Easy integration with OS» Can be used without any OS» Clear separation between native and Java Restrictions» Not possible to call Java from C» Java objects cannot be used as parameters or return values» Calling a native method pauses the VM scheduler

Immortals

Immortal Objects B-ON library Immortal objects» Live in a separate heap (immortal heap)» Are not touched by garbage collector» Have fixed addresses so they can be shared with the native world

Immortal Object Creation Generally, objects are created and then turned into immortal objects» int[] array = new int[10]; Immortals.setImmortal(array); Immortals.isImmortal(array); Objects can be created directly in the immortal heap» public static void run(runnable runnable) Impossible to free memory» OutOfMemoryErrors can be thrown

Share with Native World package com.corp.examples; public class Hello { static int[] array = (int[])immortals.setimmortal(new int[50]); public static native int getdata(int[] array); } public static void main(string[] args){ int nb = getdata(array); } #include <sni.h> jint Java_com_corp_examples_Hello_getData(jint* array){ array[0] = 0xBEEF; return 1 ; }

Flow Immortals Java methods C functions Java heap C heap T I M E

Shielded Plug

Shielded Plug Shielded Plug (often shorten as SP )» Database to exchange data» Publish / subscribe model

Shielded Plug Purpose Isolate processes» Well-defined segregation between producers and consumers» Processes run independently with no interactions except data exchanges» Producers and consumers are not necessarily aware of each others Data exchange» Database is made to share data between several software components» It is neither a one-to-one relation nor a C-to-Java relation only» Can share data from Java to C, from Java to Java, from C to C

GUI

Core of the Framework MicroUI is the core the UI framework» ESR002 MicroUI module provides a Java library that gives access to every feature MicroUI relies on stacks» MicroUI module on its own is just a Java library that offers APIs» Additional modules translate these features to simulated or hardware functions

Stacks EmbJPF relies on several stacks SimJPF relies on the Front Panel, a mock object for these stacks

MicroUI vs. MWT MicroUI (Micro User Interface) = Mechanisms for GUI» Hardware abstraction (screens, joysticks, buttons)» Display and event management management» Low level library MWT (Micro Widget Toolkit) = concepts for widgets on top of MicroUI» High level library» Developers will generally code their applications with MWT

Layers

Widgets Widget = Window + Gadget Widgets are graphical components of applications» Interact with user : display data, receive inputs» Should be reusable Renderable Widget

Renderers Widgets are not responsible for their rendering» They carry only graphical data» They contains the logic to interact with the user Model and Controller of MVC pattern Renderers are responsible for rendering widgets graphically View of MVC pattern

Loose Coupling Widget Controller Application & user events Application Data Model Widget Data Model Data related to the application Data related to representation Widget Renderers Widget Renderers Themes

Composite Widget A composite widget is a widget that contains widgets Allow to lay out widgets Create complex hierarchized structures Widget 1 Widget 2 Composite Widget 3

Widget Hierarchy Display Desktop Panel Composite Widget

Examples

Any Questions?