Notes on cstyle, detailed explanation of freertos kernel, 0th

Source: Internet
Author: User
Freertos is a hard real-time kernel that supports a wide range of microprocessor architectures. From its official website (www. freertos. download its sourcecode. At the same time, we can see that it supports dozens of microprocessor architectures. The reason why I chose to study this is to always make every bottom-layer software developer's wish to look into the inside story of the RTOS kernel. I have chosen several types of RTOS, but some of them need to be charged, and some are not mature enough to be a system, some systems are too large for research although they are more mature than others. Freertos is different. Apart from the main things required by RTOS, freertos has the biggest feature: Open Source + simple and supports many MCU, it also provides a large number of demos for us to take the test. Its core connotation is only three files, and other functions can gradually enrich its kernel functions through some plus. Freertos's latest version is 8.0.1. After downloading it from its official website, we can gradually analyze its kernel implementation. Start with the folder structure.
+-FreeRTOS-Plus    Contains Freertos+ components and demo projects.+-FreeRTOS         Contains the FreeRTOS real time kernel sourcefiles and demo projects
    +-Demo      Contains the demo application projects.
        +-Common    The demo application files that are used by all the demos.        +-Dir x     The demo application build files for port x        +-Dir y     The demo application build files for port y
+-Source Contains the real time kernel source code.
        +-include   The core FreeRTOS kernel header files        |        +-Portable  Processor specific code.            |            +-Compiler x    All the ports supported for compiler x            +-Compiler y    All the ports supported for compiler y            +-MemMang       The sample heap implementations
The folder structure of the kernel is as follows. We can see that the structure of the kernel is very clear, and the core code of the kernel is reasonably separated from the processor hardware, so we can very easy to transplant freertos to other hardware platform, we are based on at91sam3x/A Atmel arm cortex-m3 kernel MCU at91sam3x/a to carefully study the kernel architecture and implementation. Its code is in the freertosv8.0.1 \ freertos \ demo \ cortex_atsam3x_atmel_studio folder, double-click the batch processing under the project root folder to manually copy the required code to the relevant folder under the project root folder, and then use Si to create the project read code, you can also use the ateml studio tool officially provided by ateml to open the project file to compile the project. However, note that an error is reported during compilation. This is normal, it's just a good reminder that we can just stare at the error.
At first glance, it seems that there are a lot of kernel code. In fact, there are very few files required by the smallest system, such as the following:
1.tasks.c,queue.cAndRequired by list. c
2. timers.cImplement software timer optional
3. andcroutine.c  implement Co-routine functionality (optional)
4. heap_x.c is required,The files below the memmang folder provide the memory management function. We recommend that you implement it by yourself. At the same time, the kernel provides three test schemes, customers can use the built-in mollac library in our development tools or implement it by themselves.
5. For the MCU we selected, we also need to have other HW-related items, such as configuration files of cmsis for a specific development tool, such as makfile and configuration files. All the development tools we know are supported: IAR, MDK, and GCC.

Reprinted please indicate the source [email protected] // http://blog.csdn.net/CStyle_0x007

Notes on cstyle, detailed explanation of freertos kernel, 0th

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.