Hands-On Embedded Programming with C++17
eBook - ePub

Hands-On Embedded Programming with C++17

Create versatile and robust embedded solutions for MCUs and RTOSes with modern C++

Maya Posch

Share book
  1. 458 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Hands-On Embedded Programming with C++17

Create versatile and robust embedded solutions for MCUs and RTOSes with modern C++

Maya Posch

Book details
Book preview
Table of contents
Citations

About This Book

Build safety-critical and memory-safe stand-alone and networked embedded systems

Key Features

  • Know how C++ works and compares to other languages used for embedded development
  • Create advanced GUIs for embedded devices to design an attractive and functional UI
  • Integrate proven strategies into your design for optimum hardware performance

Book Description

C++ is a great choice for embedded development, most notably, because it does not add any bloat, extends maintainability, and offers many advantages over different programming languages. Hands-On Embedded Programming with C++17 will show you how C++ can be used to build robust and concurrent systems that leverage the available hardware resources.

Starting with a primer on embedded programming and the latest features of C++17, the book takes you through various facets of good programming. You'll learn how to use the concurrency, memory management, and functional programming features of C++ to build embedded systems. You will understand how to integrate your systems with external peripherals and efficient ways of working with drivers. This book will also guide you in testing and optimizing code for better performance and implementing useful design patterns. As an additional benefit, you will see how to work with Qt, the popular GUI library used for building embedded systems.

By the end of the book, you will have gained the confidence to use C++ for embedded programming.

What you will learn

  • Choose the correct type of embedded platform to use for a project
  • Develop drivers for OS-based embedded systems
  • Use concurrency and memory management with various microcontroller units (MCUs)
  • Debug and test cross-platform code with Linux
  • Implement an infotainment system using a Linux-based single board computer
  • Extend an existing embedded system with a Qt-based GUI
  • Communicate with the FPGA side of a hybrid FPGA/SoC system

Who this book is for

If you want to start developing effective embedded programs in C++, then this book is for you. Good knowledge of C++ language constructs is required to understand the topics covered in the book. No knowledge of embedded systems is assumed.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Hands-On Embedded Programming with C++17 an online PDF/ePUB?
Yes, you can access Hands-On Embedded Programming with C++17 by Maya Posch in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming in C++. We have over one million books available in our catalogue for you to explore.

Information

Year
2019
ISBN
9781788834322
Edition
1

Section 1: The Fundamentals - Embedded programming and the role of C++

In this section the reader should become familiar with the many embedded platforms out there, along with a basic practical example project.
The following chapters will be covered in this section:
  • Chapter 1, What Are Embedded Systems?
  • Chapter 2, C++ as an Embedded Language
  • Chapter 3, Developing for Embedded Linux and Similar Systems
  • Chapter 4, Resource-Restricted Embedded Systems
  • Chapter 5, Example - Soil Humidity Monitor with Wi-Fi

What Are Embedded Systems?

Essentially , the embedded part of an embedded system refers to the state of being embedded into a larger system. The system that has been embedded is a computer system of some description, which has one or more very specific functions in the overall system, rather than being a general-purpose component. This larger system can be digital, mechanical, or analog in nature, while the additional integrated digital circuitry tightly interacts with data from and to interfaces, sensors and memory to implement the actual system functionality.
In this chapter, we will look at the following topics:
  • Different categories of embedded platforms
  • Examples of each category
  • Development challenges of each category

The many faces of embedded systems

Every computerized function in today's devices is implemented using one or multiple microprocessors, meaning a computer processor (central processing unit, or CPU) usually contained in a single integrated circuit (IC). The microprocessor comprises at least the arithmetic logic unit (ALU) and control circuitry, but logically also registers, and input/output (I/O) banks, in addition to more advanced features commonly tailored to a specific product category (wearables, low power sensors, mixed signal, ...) or market (consumer, medical, automotive, ...).
At this point in history, almost all microprocessors are found in embedded systems. Even though people are likely to possess a computer, laptop, and smartphone, maybe even a tablet, the number of embedded microprocessors in a given household far dwarfs the number of general-purpose microprocessors.
Even within a laptop or PC, there are a number of embedded microprocessors in addition to its general-purpose CPU. These microprocessors have tasks like handling keyboard or mouse input, processing touch-screen inputs, converting streams of data into Ethernet packages, or creating video or audio output.
In older systems, such as the Commodore 64, this same pattern can be seen, with a CPU IC, sound IC, video IC, and so on. Whereas the CPU runs whatever code the application developer has written, the other chips in the system have very specific purposes, down to the controller IC for the floppy or hard disk drive.
Outside of general-purpose computers, we find embedded microprocessors everywhere, often in the form of even further integrated MCUs. They control kitchen devices, washing machines, and the engines of our cars, in addition to the higher-level functions and the processing of sensor information.
While the first microwaves were analog devices, using mechanical timers and variable resistors to set power level and duration, today's microwaves contain at least one microcontroller, which is responsible for handling user input, driving a display of some type, and configuring the microwave's systems. The display itself can have its own microcontroller, depending on the complexity of the chosen configuration.
Perhaps more excitingly, embedded systems also provide monitoring, automation and fail-safe features that keep airplanes flying, ensure that guided missiles and space rockets perform as intended, and enable ever-increasing possibilities in areas such as medicine and robotics. The avionics of an airplane constantly monitor countless parameters from a multitude of sensors, running the same code on its triple-redundant configuration to detect any possible glitches.
Tiny yet powerful microprocessors enable the rapid analysis of chemicals and DNA or RNA strands, which would have taken racks of equipment before. With the progress of technology, an embedded system has become small enough that it can be sent through the human body to monitor its health.
Beyond Earth, space probes and rovers on Mars, the Moon, and asteroids are performing a myriad of duties every day, again with the courtesy of well-tested embedded systems. The Moon missions themselves were made possible due to the first major example of an embedded system in the form of the Apollo Guidance Computer. This 1966-era embedded system consisted of wire-wrapped boards full of triple-input NOR logic gates, built for the explicit purpose of handling navigation, guidance, and control of the Command Module and Lunar Module launched by the Saturn V rockets.
The ubiquitous and versatile nature of embedded systems has made them an inseparable part of modern life.
For embedded systems, they are usually distinguished between the following categories:
  • Microcontrollers (MCUs)
  • System-on-Chip (SoC), often as a Single-Board Computer (SBC)

Microcontrollers

One of the driving factors of innovation in the field of embedded systems is cost, since the...

Table of contents