FreeRTOS — A Real Real-Time TV Transmissions

Fundamental Understanding about FreeRTOS Apps — IoT — Episode #05

J3
Jungletronics
6 min readJan 6, 2020

--

Hi, in this post I hope I can transmit these pieces of information:

  • Real-Time System: what is it really?
  • How to install FreeRTOS support libraries — SDK-ESP32;
  • How to create your first hello world app;

But first, one question: A F-1 Grand-Prix is always transmitted in real-time?

Mostly certainly not, and I will explain why:

Let us begin with the old days' processors.

In the late 1950s, International Business Machines (IBM) on their 7030 mainframe computers create this Minimal instruction set computers (MISC) that could execute instructions in one cycle with no need for pipelines.

A similar idea introduced only a few years ago was to execute multiple instructions in parallel on separate arithmetic logic units (ALUs). Instead of operating on only one instruction at a time, the CPU will look for several similar instructions that do not depend on each other and execute them in parallel. This approach is called superscalar processor design.

Shifting our focus to the present day and we have desktop computers running over a multitasking OS.

Windows is one example and it is multitasking!

To ensure the best user experience these modern computers should respond to each input within a preferred time limit — but a response falling outside of this limit will not render the computer inoperative.

As an example, key presses must be visibly registered within a certain time the key is pressed. Registering a keypress outside of this time could result in the system seeming unresponsive, but not unusable.

A user may run a word processor, a spreadsheet, an email client, and a WEB browser all at the same time and would expect each application to respond adequately to input at all the time. Input processing on a desktop computer can be classified as soft real-time.

But how about embedded systems?

It has a completely different objective: it is a pre-deterministic system!

Hard real-time functions must complete within a given time limitfailure to do so will result in absolute failure of the system. The airbag triggering mechanism in a car is an example of a hard real-time function. The airbag must deploy within a given time limit of an impact. A response falling outside of this time limit can result in the driver sustaining injuries that would otherwise have been avoided

Fig 1. airbag triggering mechanism in a car must deploy within a given time limit of an impact or will make a bad, very bad job…

So, an embedded system is conceptually similar to multitasking in a desktop system to the point that it describes multiple threads of execution using a single processor. However, the objectives of real-time embedded systems are likely to be quite different from that of desktops — especially when the embedded system is expected to provide hard real-time behavior. Hard real-time functions must complete within a given time limit — failure to do so will result in absolute failure of the system.

So here is the answer to this first question, A F-1 Grand-Prix is always transmitted in real-time?

Yes, it is. If the ABC, ESPN, and ESPN 2 guarantee the delay within a given time limit, say, one millisecond and maintain that requirement for all the transmission, then it is transmitting F-1 Grand-Prix in real-time. But otherwise, if the delay varies during transmission, then they failed to provide hard real-time behavior and will result in absolute failure of the system, making system instable — well not actually — but you get the idea;b

Fig 2. Always there will be a delay, but how much delay time to Stream 2019 F1 live? here this post.

Now, How to get started on FreeRTOS for ESP-32?

If you don’t know how to get started, look no further… just open this very page: Steps to install Arduino ESP32 support on Windows. This is where I get started and I can assure you it is awesome!

I will not replicate it here. RTOS SDK is based on FreeRTOS and is open-source on GitHub. Go there and prepare your station. If you get stuck please let me know in the comment section below…

Preparing the Hardware, WiFi LoRa 32(v2):

fig 3. WiFi LoRa 32 is a classic IoT dev-board designed & produced by Heltec Automation(TM), it’s a highly integrated product based on ESP32 + SX127x, it has Wi-Fi, BLE, LoRa functions, also Li-Po battery management system, 0.96″ OLED are also included. It’s my choice 😊.

Here is how my directory is configured:

Fig 4. How my files are distributed : C:\Users\<USER_NAME>\Documents\Arduino\hardware\espressif\esp32

To see the OLED working, please follow this page: https://heltec.org/project/wifi-kit-32/

Here is a simple OLED code test:

Code 1. This will print millis-timestamp onto OLED screen :/
Gif 1. Running the code above \o/ Steps to install Arduino ESP32 support on Windows.

How to Flash to your ESP32 Board via Arduino IDE

Fig 4. Choose TOOLS > BOARD > Heltec ESP32 Arduino > WiFi LoRa32(v2)

Oh, fine, I think this is enough for now.

Until the next episode about real-time apps 😉.

See you soon!

Bye!

IoT Episodes Posts:

1° Episode — IoT — Meet IoT Boards: ESP8266 & ESP32 — Which are the best? ESPs or RPis or Arduino Boards?

2° Episode — IoT — FreeRTOS Why To Use It? — IoT Projects? What is it?

3º Episode — IoT — FreeRTOS — We are all Preemptive Scheduler! — Some Important Concepts for Real-Time Operating Systems (RTOS)

4° Episode — IoT — FreeRTOS — More About it! — The Essence of FreeRTOS

5° Episode — IoT — FreeRTOS A Real Real-Time TV Transmissions - Fundamental Understanding of FreeRTOS Apps (this one:)

ESP-IDF Programming Guide + WiFi LoRa 32 (v2) — How To Get Started — ESP_IDF_Series Episode #00

Credits & References

Microgênios — Treinamento em Sistemas Embarcados — Microchip Regional Partner certified Training Courses a Simplício-owned enterprise

Steps to install Arduino ESP32 support on Windows
Installing Silicon CP210X
Heltec ESP32-Based Dev-boards Develop Environment
Online Image Converter and Heltec Examples and Heltec Automation

LILYGO®4 m byte (32 m bit) pro esp32 oled v2.0 ttgo & esp32 oled wifi

Edited @ dez/2020 — Adding step-by-step for Arduino Flashing procedure :)

Edited @ feb/2024 — fixing links :)

--

--

J3
Jungletronics

😎 Gilberto Oliveira Jr | 🖥️ Computer Engineer | 🐍 Python | 🧩 C | 💎 Rails | 🤖 AI & IoT | ✍️