1 / 27

Micrium’s μ C/OS for Makers A Hands-on Course

Micrium’s μ C/OS for Makers A Hands-on Course. Class 1: Introduction to μ C/OS II/III. January 30, 2017 Charles J. Lord, PE President, Consultant, Trainer Blue Ridge Advanced Design and Automation. This Week’s Agenda. 1/30 Introduction to μ C/OS II/III 1/31 The Micrium Maker Program

Download Presentation

Micrium’s μ C/OS for Makers A Hands-on Course

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Micrium’s μC/OS for Makers A Hands-on Course Class 1: Introduction to μC/OS II/III January 30, 2017 Charles J. Lord, PEPresident, Consultant, TrainerBlue Ridge Advanced Design and Automation

  2. This Week’s Agenda 1/30 Introduction to μC/OS II/III1/31 The Micrium Maker Program 2/1 Setting up our Development System 2/2 Writing Our Tasks and Establishing Scheduling 2/3Mutexes, Messages, and Semaphores, Oh My!

  3. This Week’s Agenda 1/30 Introduction to μC/OS II/III1/31 The Micrium Maker Program 2/1 Setting up our Development System 2/2 Writing Our Tasks and Establishing Scheduling 2/3Mutexes, Messages, and Semaphores, Oh My!

  4. Real-Time Operating Systems • We hear a lot about the proliferation of RTOS on myriad processors, even some 8-bit machines, but when do we need a real-time operating system (RTOS)? • Just how critical is timing and interoperation? • Cost of chip size, power consumption • “small ARM” vs 8/16 bit • “Free” RTOS and many paid ones, plus alternatives (kernels, etc) Question 1 – Experience with RTOS? Which one(s)?

  5. RTOS Tasks • A Task in an RTOS is a self-contained process that is called by the OS • Each task has its own stack and may have dedicated RAM (at least for the duration of its active time) • Tasks run for a finite time and then go back to an inactive state • Tasks can send and receive messages

  6. Scheduling Tasks • An RTOS (or multi-tasking system) uses either one or both of the following methods to switch between tasks: • Event-driven – switches tasks only when an event of higher priority needs servicing; called preemptive priority, or priority scheduling. • Time-sharing – switches tasks on a regular clocked interrupt, and on events; called round robin.

  7. Simplest Round Robin for (;;) { taskA(); taskB(); taskC(); //etc } // Note that this gives each task the opportunity to take over! Very simple but also dangerous!

  8. Reasons for Round Robin • Assures every task gets a chance to run • Time slots are a simple way to prevent runaway • Early microprocessors took a ‘long’ time to switch tasks • Appearance that all tasks are running concurrently

  9. Reasons for Preemptive Priority • Not all tasks need a time slot • RR takes time from high-priority tasks • Totally priority (and time ready) driven • More complex • Sometimes you need both…

  10. μC/OS • Like much of great software, was written by an engineer who needed a better tool • Written by Jean Labrosse ca 1991 • Original version – 64 tasks, fairly core-specific • μC/OS II – 255 tasks, purely preemptive, one task per priority level • μC/OS III – unlimited tasks and priorities, added round robin capabilities (and more)

  11. Question 2 – What is the “FS” and what does it do?

  12. Complete Family RTOS

  13. https://doc.micrium.com/display/osiiidoc/uC-OS-III+Documentation+Homehttps://doc.micrium.com/display/osiiidoc/uC-OS-III+Documentation+Home

  14. Freescale FRDM-K64 • K64 Cortex-M4 • 120 MHz • 1 MB flash • 256 KB RAM • mbed • Arduino™ R3 pin layout - we can add shields Debug connector – next to RESET Question 3 – Will you be doing the ‘hands on’ part? What board?

  15. Board Pinout NOTE – our Arduino shield only uses the outside rows!

  16. Update the MBED driver if needed • Connect your FRDM-K64F board via the programming USB connector (next to the reset button) • Once Windows recognizes it, you should have a new drive called MBED. Open this folder. • If there is a DETAILS.TXT file on the MBED device, read it. Otherwise open mbed.htm with a text editor and look for the version number. It should be 0226. • If not, follow the directions at: http://developer.mbed.org/handbook/Firmware-FRDM-K64Fhttps://developer.mbed.org/media/uploads/sam_grove/0226_k20dx128_k64f_0x5000.bin

  17. Updated Board Should Be 0226

  18. Install the Windows Driver if Needed NOT NEEDED FOR WIN 10 • Plug the FRDM board into the PC • Open Device Manager • Check ports – if you don’t see a mbed port, you need to install the Windows driver

  19. Installing the Driver • http://developer.mbed.org/handbook/Windows-serial-configuration • Follow the directions on steps 1 and 2 • Note that this installer needs to be run for every mbed board that you use – it sets up a device driver for each individual serial number

  20. After installing the serial port driver, you should see these four devices

  21. References • Jean Labrosse’s CEC on Micrium μC/OS II/IIIhttps://www.designnews.com/continuing-education-center/introduction-real-time-kernels • My CEC on Multitaskinghttps://www.designnews.com/continuing-education-center/multitasking-scratch • My CEC on MQXhttps://www.designnews.com/continuing-education-center/hands-on-develop-rtos-application-using-freescale-mqx • My CEC on FreeRTOShttps://www.designnews.com/continuing-education-center/hands-on-develop-rtos-application-using-freertos

  22. This Week’s Agenda 1/30 Introduction to μC/OS II/III1/31 The Micrium Maker Program 2/1 Setting up our Development System 2/2 Writing Our Tasks and Establishing Scheduling 2/3Mutexes, Messages, and Semaphores, Oh My!

  23. Please stick around as I answer your questions! • Please give me a moment to scroll back through the chat window to find your questions • I will stay on chat as long as it takes to answer! • I am available to answer simple questions or to consult (or offer in-house training for your company)c.j.lord@ieee.orghttp://www.blueridgetechnc.comhttp://www.linkedin.com/in/charleslordTwitter: @charleslordhttps://www.github.com/bradatraininghttps://www.charleslord.info (bio and what I’m up to)

More Related