DEVELOP AN RTOS- BASED APPLICATION IN LESS THAN 30 MINUTES

Similar documents
the high-performance embedded kernel User Guide Version 5.0 Express Logic, Inc Toll Free 888.THREADX FAX

Using ThreadX With Freescale s MCF51MM, CodeWarrior IDE, and the EKG Medical Application Demo

The Real-Time Operating System ucos-ii

File Transfer Protocol (FTP) User Guide Express Logic, Inc.

SYSTEM ecos Embedded Configurable Operating System

Embedded Component Based Programming with DAVE 3

Chapter 12. Development Tools for Microcontroller Applications

Renesas Synergy Software Package Redefines Software Development for the Industrial and IoT Market

快 速 porting μc/os-ii 及 driver 解 說

Chapter 6, The Operating System Machine Level

Complete Integrated Development Platform Copyright Atmel Corporation

Lecture 25 Symbian OS

White Paper. Real-time Capabilities for Linux SGI REACT Real-Time for Linux

REAL TIME OPERATING SYSTEMS. Lesson-10:

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

1. Computer System Structure and Components

Page 1 of 5. IS 335: Information Technology in Business Lecture Outline Operating Systems

Computer-System Architecture

REAL TIME OPERATING SYSTEM PROGRAMMING-II: II: Windows CE, OSEK and Real time Linux. Lesson-12: Real Time Linux

Chapter 13. PIC Family Microcontroller

EE8205: Embedded Computer System Electrical and Computer Engineering, Ryerson University. Multitasking ARM-Applications with uvision and RTX

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

Embedded C Programming, Linux, and Vxworks. Synopsis

MQX Lite Real-Time Operating System User Guide

Outline: Operating Systems

Real-Time Systems Prof. Dr. Rajib Mall Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

POSIX. RTOSes Part I. POSIX Versions. POSIX Versions (2)

Keil C51 Cross Compiler

theguard! ApplicationManager System Windows Data Collector

RTOS Debugger for ecos

USB 3.0 Connectivity using the Cypress EZ-USB FX3 Controller

Operating System Manual. Realtime Communication System for netx. Kernel API Function Reference.

Special FEATURE. By Heinrich Munz

Linux Driver Devices. Why, When, Which, How?

Data Transfer between Serial Link and TCP/IP Link Using ez80f91 MCU

8051 MICROCONTROLLER COURSE

Chapter 3: Operating-System Structures. System Components Operating System Services System Calls System Programs System Structure Virtual Machines

TEST CHAPTERS 1 & 2 OPERATING SYSTEMS

Helping you avoid stack overflow crashes!

Lesson Objectives. To provide a grand tour of the major operating systems components To provide coverage of basic computer system organization

EUCIP IT Administrator - Module 2 Operating Systems Syllabus Version 3.0

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

Operating Systems 4 th Class

Mobile Operating Systems Lesson 05 Windows CE Part 1

Embedded Programming in C/C++: Lesson-1: Programming Elements and Programming in C

Device Management Functions

Why Threads Are A Bad Idea (for most purposes)

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC Microprocessor & Microcontroller Year/Sem : II/IV

S7 for Windows S7-300/400

An Introduction to MPLAB Integrated Development Environment

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

ASSEMBLY PROGRAMMING ON A VIRTUAL COMPUTER

Real-time processing the basis for PC Control

Chapter 11 I/O Management and Disk Scheduling

Chapter 8 Objectives. Chapter 8 Operating Systems and Utility Programs. Operating Systems. Operating Systems. Operating Systems.

Comparing RTOS to Infinite Loop Designs

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

An introduction to nxpusblib. March 2012

Introduction to Embedded Systems. Software Update Problem

C Programming. for Embedded Microcontrollers. Warwick A. Smith. Postbus 11. Elektor International Media BV. 6114ZG Susteren The Netherlands

Real-Time Operating Systems With Example PICOS18. What is an Operating System?

SKP16C62P Tutorial 1 Software Development Process using HEW. Renesas Technology America Inc.

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

E-Blocks Easy Internet Bundle

How to design and implement firmware for embedded systems

Design of a High Speed Communications Link Using Field Programmable Gate Arrays

Real Time Programming: Concepts

Project 11: FreeRTOS TM Real-Time Control of a Stepper Motor

Operating System Software

CS 377: Operating Systems. Outline. A review of what you ve learned, and how it applies to a real operating system. Lecture 25 - Linux Case Study

APPLICATION NOTE. AT04056: Getting Started with FreeRTOS on Atmel SAM Flash MCUs. Atmel SMART. Introduction

Debugging A MotoHawk Application using the Application Monitor

8. MicroC/OS-II Real-Time Operating System

Network Scanning: A New Feature for Digital Copiers

Linux A multi-purpose executive support for civil avionics applications?

Chapter 3. Operating Systems

Getting Started. Building Applications with RL-ARM. For ARM Processor-Based Microcontrollers.

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

Linux Process Scheduling Policy

Module 8. Industrial Embedded and Communication Systems. Version 2 EE IIT, Kharagpur 1

CSC 2405: Computer Systems II

Multiprogramming. IT 3123 Hardware and Software Concepts. Program Dispatching. Multiprogramming. Program Dispatching. Program Dispatching

Real Time Operating Systems. Tajana Simunic Rosing Department of Computer Science and Engineering University of California, San Diego.

IAR C-SPY Hardware Debugger Systems User Guide. for Renesas PC7501 Emulator and ROM-monitor

Have both hardware and software. Want to hide the details from the programmer (user).

Implementing Software on Resource- Constrained Mobile Sensors Experience with Impala and ZebraNet

IPv6 Challenges for Embedded Systems István Gyürki

Tutorial for MPLAB Starter Kit for PIC18F

Porting ecos to the Analog Devices BLACKfin DSP

Microtronics technologies Mobile:

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

Operating Systems. 05. Threads. Paul Krzyzanowski. Rutgers University. Spring 2015

Board also Supports MicroBridge

Enhancing Hypervisor and Cloud Solutions Using Embedded Linux Iisko Lappalainen MontaVista

USER GUIDE EDBG. Description

Embedded Systems. 6. Real-Time Operating Systems

INtime 4.0 Software September 2009

STUDY GUIDE CHAPTER 4

Mobile Operating Systems. Week I

E-Blocks Easy RFID Bundle

Transcription:

DEVELOP AN RTOS- BASED APPLICATION IN LESS THAN 30 MINUTES Renesas Synergy Engineering Conference LAKE GARDA 7-8 April 2016 2016 Renesas Electronics Corporation. All rights reserved.

AGENDA Products without an Operating System Why use an Operating System? Benefits of using an Operating System What is a Thread/Process/Task? Pre-emptive Kernel e2 studio, ThreadX & X-Ware Summary & conclusions 2016 Renesas Electronics Corporation. All rights reserved. Page 2

PRODUCTS WITHOUT AN OPERATING SYSTEM 2016 Renesas Electronics Corporation. All rights reserved. Page 3

PRODUCTS WITHOUT AN OPERATING SYSTEM Foreground #2 ISR #2 Foreground #1 ISR #1 ISR #1 Background thread #1 thread #2 thread #3 Infinite loop Time 2016 Renesas Electronics Corporation. All rights reserved. Page 4

TYPICAL IMPLEMENTATION WITHOUT AN RTOS /* Background */ void main (void) { Initialization; FOREVER { Read analog inputs; Read discrete inputs; Perform monitoring functions; Perform control functions; Update analog outputs; Update discrete outputs; Scan keyboard; Handle user interface; Update display; Handle communication requests; Other... } } /* Foreground */ ISR (void) { Handle asynchronous event; } 2016 Renesas Electronics Corporation. All rights reserved. Page 5

DISADVANTAGES OF NO OPERATING SYSTEM Background response time is the background execution time Non-deterministic Affected by if, for, while... May not be responsive enough Changes as you change your code Affected by if, for, while Poll to see if ISR occurred ISR #1 thread #1 thread #2 thread #3 thread #4 2016 Renesas Electronics Corporation. All rights reserved. Page 6

DISADVANTAGES OF NO OPERATING SYSTEM (CONT.) All threads have the same priority! Code executes in sequence If an important event occurs it s handled at the same priority as everything else! You may need to execute the same code often to avoid missing an event. thread #1 thread #2 thread #3 thread #4 Infinite loop 2016 Renesas Electronics Corporation. All rights reserved. Page 7

WHY USE AN OPERATING SYSTEM? 2016 Renesas Electronics Corporation. All rights reserved. Page 8

WHY USE AN OPERATING SYSTEM? An Operating System is software which manages the time of a microprocessor or microcontroller. Ensures that the most important code runs first! Allows Multithreading: Do more than one thing at the same time. Application is broken down into multiple threads each handling one aspect of your application It s like having multiple CPUs! Provides valuable services to your application: Time delays Resource sharing Inter-thread communication and synchronization 2016 Renesas Electronics Corporation. All rights reserved. Page 9

WHY USE AN OPERATING SYSTEM? (CONT.) Operating System vendors are usually able to provide a wealth of other modules required in the latest applications. Tested and guaranteed saving many man hours of development time and cost. TCP/IP File systems GUI Audio/video drivers USB etc. 2016 Renesas Electronics Corporation. All rights reserved. Page 10

BENEFITS OF USING AN OPERATING SYSTEM Allows the system to be more responsive to real-time events Allows the work (application threads) to be prioritized Simplifies system expansion Adding low-priority threads generally does not change the responsiveness of higher priority threads! Reduce development time Allows the application to be distributed between programmers Can simplify debugging Documentation easier to maintain Allows the application to take advantage of useful services from the Operating System Services that you would want to provide to your application code 2016 Renesas Electronics Corporation. All rights reserved. Page 11

DISADVANTAGES OF USING AN RTOS Increased RAM footprint Each thread requires separate stack RTOS internal structures e.g. TCB (thread control block) ThreadX RAM usage from 0.5-2K bytes ROM footprint RTOS functions ThreadX FLASH usage from 2K bytes Cost Unless of course, you use Synergy, when it is all included 2016 Renesas Electronics Corporation. All rights reserved. Page 12

WHAT IS A THREAD/PROCESS/TASK? 2016 Renesas Electronics Corporation. All rights reserved. Page 13

WHAT IS A THREAD/PROCESS/TASK? Process/Task Independent executable program with its own memory space Multitasking: running several tasks/processes concurrently A Process can have multiple threads Thread Semi-independent program segment; multiple threads can share the same memory space Multithreading: running several threads concurrently Some RTOS use task to mean thread Each thread has: Its own stack space A priority based on its importance Thread design can be based on modular functional blocks of the application, e.g.: Video thread Audio thread Network stack Motor control thread 2016 Renesas Electronics Corporation. All rights reserved. Page 14

TYPICAL THREAD IMPLEMENTATION #include "tx_api.h" ULONG my_thread_counter = 0; TX_THREAD my_thread; main( ) { } /* Enter the ThreadX kernel. */ tx_kernel_enter( ); void tx_application_define(void *first_unused_memory) { /* Create my_thread! */ tx_thread_create( &my_thread, "My Thread", my_thread_entry, 0x1234, first_unused_memory, 1024, 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); } void my_thread_entry(ulong thread_input) { /* Enter into a forever loop. */ while(1) { /* Increment thread counter. */ my_thread_counter++; } } /* Sleep for 1 tick. */ tx_thread_sleep(1); Thread Definition 2016 Renesas Electronics Corporation. All rights reserved. Page 15

SPLITTING APPLICATIONS INTO THREADS High Priority thread thread 1 Each thread thread 2 Importance Event Event thread 3 thread thread 4 Infinite loop Low Priority thread 2016 Renesas Electronics Corporation. All rights reserved. Page 16

PRE-EMPTIVE KERNEL 2016 Renesas Electronics Corporation. All rights reserved. Page 17

PRE-EMPTIVE KERNEL ISR makes High Priority thread Ready e.g. posts a semaphore ISR Interrupt Occurs Vector to ISR ISR ISR Completes (Switch to HP thread) High Priority thread (HPT) Low Priority thread (LPT) HP thread Completes (Switch back to LP thread) 2016 Renesas Electronics Corporation. All rights reserved. Page 18

TYPICAL RTOS FEATURES tx_queue_send An RTOS typically provides the following features System initialisation Thread control Scheduling/Context switch Inter-thread control/communications Mutexes Semaphores Message queues Event flags Memory management tx (ID) nx gx fx ux queue (Noun) timer mutex semaphore event flag group block pool byte pool... send (Verb) receive create remove delete terminate close... Timers Interrupt control Typical RTOS API 2016 Renesas Electronics Corporation. All rights reserved. Page 19

E 2 STUDIO, SSP, THREADX & X-WARE 2016 Renesas Electronics Corporation. All rights reserved. Page 20

SYNERGY, THREADX & X-WARE ThreadX RTOS Small memory footprint Fast real-time response and performance NetX/NetX Duo Dual IPv4/IPv6 TCP/IP stack USBX USB Host/Device/OTG FileX MS-DOS FAT file system for embedded systems GUIX Graphics toolkit for embedded GUI development TraceX RTOS and application event viewer Analyze real-time system behavior 2016 Renesas Electronics Corporation. All rights reserved. Page 21

SYNERGY SSP INTEGRATION Fully integrated into e2 studio RTOS and middleware configuration, task table views in debugger and extensive context switching / object tracing with TraceX Synergy Hardware Stack Monitor initialisation for each context switch Removes the need to manually code ThreadX and X-Ware components by hand Priority, stack size, Preemption-Threshold etc. Possible to re-configure during project Reduced learning curve for new engineers In depth knowledge of the RTOS not necessary to start development A few clicks and the RTOS is up and running Focus on application rather than middleware configuration 2016 Renesas Electronics Corporation. All rights reserved. Page 22

TRACEX Analysis tool to examine system events RTOS logs events in trace buffer in target memory Events include RTOS services like queue_send, queue_receive Also internal RTOS operations like internal_suspend Upload Trace Buffer to host as a file Using e2 studio function TraceX reads file and converts to graphical representation Shows all threads Shows all logged events Shows time-ticks Shows context switches 2016 Renesas Electronics Corporation. All rights reserved. Page 23

SUMMARY & CONCLUSIONS 2016 Renesas Electronics Corporation. All rights reserved. Page 24

SUMMARY & CONCLUSIONS X-Ware Platform for Synergy Full RTOS and Middleware functionality Fully integrated with e2studio and Synergy Fully supported by Renesas ThreadX RTOS Small, Fast, with Advanced Technology Easy to use e2 studio integration eases application building and debugging TraceX System Event Trace Powerful tool to show system behavior e2 studio Extensive ThreadX & X-Ware integration 2016 Renesas Electronics Corporation. All rights reserved. Page 25

Thank you for your attention Please complete the feedback form in your smartphone app 2016 Renesas Electronics Corporation. All rights reserved. Page 26