Code snippetsSrc folder list: here zip of all code in the folder above About Freertos (copied from their youtube channel)A real-time operating system (RTOS) is an operating system that runs multi-threaded applications and can meet real-time deadlines. See this article to read more about them:
An RTOS is often a lightweight operating system (OS) designed to run on microcontrollers. Much like general purpose operating systems, they offer a scheduler to run multiple threads or tasks, resource management (such as file I/O), and device drivers. An RTOS is necessary when embedded engineers need to run several threads at the same time on a processor. The “real-time” part of an RTOS means that such software can meet real-time deadlines. Note that this does not mean “fast,” but rather, it can guarantee that task execution time can be calculated prior to runtime. Embedded programmers often use a “bare-metal” or “super loop” structure instead of an RTOS when concurrency is not needed. This is the familiar “setup” and “loop forever” style of embedded code where no OS is employed. Many embedded applications can be written in this format, and they are often easier to debug. In the rest of the series, we will cover various RTOS concepts and provide demonstrations on the ESP32 using Arduino. After each video, excluding this one, we will issue a challenge and the solution can be found in a Maker.IO link provided in the video’s description. We encourage you to try the challenge without looking at the solution. Product Links:
Link to Shawn Hymel DigikeyMemory management is important in a multi-threaded environment, as threads (or tasks) can quickly consume all of the allocated memory, causing bizarre effects such as overwritten memory locations or random processor resets. The solution to the challenge in the video can be found here: https:www.digikey.comenmaker/proj… In this video, we look at various ways to allocate memory to a task and how to monitor memory usage in FreeRTOS. Most C programs rely on 3 different types of memory. Static memory is set aside prior to program execution and used for things like static variables, constants, and global variables. Stack is allowed to grow dynamically and consists of local variables declared at the function level. Finally, heap may also grow dynamically and must be specifically allocated and deallocated by the programmer (e.g. using the malloc() and free() functions, respectively). Whenever we create a new task in FreeRTOS, we must assign it a set amount of stack memory to use out of the global, available heap. Note that each task also requires another section of heap for the Task Control Block (TCB), which stores various attributes about the task, such as its state and priority. We demonstrate ways to monitor the stack in each thread as well as the total amount of heap available to the system. We also show what happens when you overrun the stack or heap! Videos: An overview of all the realtime-freertos film is here Direct links to the …
Links on digikeys projectstag rtos All projects og digikey by ShawnHymel - fpga,rtos,… ju name it All the lectures movies on digikeys hpCode examples (repeated from above)Code examples from freertos install to esp32 for arduino ide Src folder list: here |