freertos 学习 资源整理

1 freertos 官方网站

freertos 官方网站
https://www.freertos.org/index.html

这里写图片描述

源码下载:
https://sourceforge.net/projects/freertos

2 如何下载旧版本的 freertos

https://sourceforge.net/projects/freertos/files/FreeRTOS/
这里写图片描述

https://sourceforge.net/projects/freertos/files/FreeRTOS/V9.0.0/

这里写图片描述

3 freertos的书 和手册

https://www.freertos.org/Documentation/RTOS_book.html
这里写图片描述

4 Nano100B 开发板上的freertos

https://download.csdn.net/download/wowocpp/10608149

5 FRDM-KL25Z 板子上带的例程

E:\nano130FreeRtos\SDK_2.2_FRDM-KL25Z\boards\frdmkl25z\rtos_examples
这里写图片描述

6 LPCXpresso54114 板子上带的例程

E:\freescale\LPC54114\SDK_2_0_LPC54113J_Windows\SDK_2.0_LPC54113J_Windows\boards\lpcxpresso54114\rtos_examples
这里写图片描述

7 kl43_MAPS 板子上带的例程

E:\freescale\kl43_MAPS\SDK_2.1_MAPS-KL43\boards\mapskl43z\rtos_examples
同上

8 freertos 在PC上 通过 visual studio 2010 编译运行

FreeRTOSv9.0.0\FreeRTOSv9.0.0\FreeRTOS\Demo\WIN32-MSVC\
需要vs2015

错误  1   error MSB8020: The build tools for v140 (Platform Toolset = 'v140') cannot be found. To build using the v140 build tools, please install v140 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Upgrade Solution...".  C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets   64  5   RTOSDemo

FreeRTOSV8.2.3\FreeRTOSV8.2.3\FreeRTOS\Demo\WIN32-MSVC\WIN32.sln
需要vs2010 即可

source-code-for-book-examples\source-code-for-book-examples\Win32-simulator-MSVC\RTOSDemo.sln
需要vs2010 即可 对应的是v9.0.0 ,书的例子

9 freertos windows 下的移植 FreeRTOS Windows Port

FreeRTOS Windows Port
For Visual Studio or Eclipse and MingW

https://www.freertos.org/FreeRTOS-Windows-Simulator-Emulator-for-Visual-Studio-and-Eclipse-MingW.html

10 freertos 入门

Getting Started with Simple FreeRTOS Projects
https://www.freertos.org/simple-freertos-demos.html

[See also the Quick Start Guide and the hardware independent starter functions provided.]
https://www.freertos.org/FreeRTOS-quick-start-guide.html
https://www.freertos.org/Hardware-independent-RTOS-example.html

11 freertos vs2010 编译 运行demo

FreeRTOSV8.2.3\FreeRTOSV8.2.3\FreeRTOS\Demo\WIN32-MSVC\WIN32.sln
这里写图片描述
运行:
这里写图片描述

/*
 * main_blinky() is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 1.
 * main_full() is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 0.
 */
 *
 * main_blinky() creates one queue, one software timer, and two tasks.  It then
 * starts the scheduler.
 *
 * The Queue Send Task:
 * The queue send task is implemented by the prvQueueSendTask() function in
 * this file.  It uses vTaskDelayUntil() to create a period task that sends the
 * value 100 to the queue every 200 milliseconds (please read the notes above
 * regarding the accuracy of timing under Windows).
 *
 * The Queue Send Software Timer:
 * The timer is a one-shot timer that is reset by a key press.  The timer's
 * period is set to two seconds - if the timer expires then its callback
 * function writes the value 200 to the queue.  The callback function is
 * implemented by prvQueueSendTimerCallback() within this file.
 *
 * The Queue Receive Task:
 * The queue receive task is implemented by the prvQueueReceiveTask() function
 * in this file.  prvQueueReceiveTask() waits for data to arrive on the queue.
 * When data is received, the task checks the value of the data, then outputs a
 * message to indicate if the data came from the queue send task or the queue
 * send software timer.  As the queue send task writes to the queue every 200ms,
 * the queue receive task will print a message indicating that it received data
 * from the queue send task every 200ms.  The queue receive task will print a
 * message indicating that it received data from the queue send software timer
 * 2 seconds after a key was last pressed.

启动了两个任务 和 一个定时器
这里写图片描述
运行过程中,按下键盘上的任意按键,
会触发 定时器任务 给读任务发送消息
log为:Message received from software timer

写任务会定时给读任务发送消息:log为:Message received from task

还是有点问题,可能和 uiTraceStart(); 有关

12 Creating a New FreeRTOS Project

https://www.freertos.org/Creating-a-new-FreeRTOS-project.html

Source Files
As a minimum, the following source files must be included in your project:

FreeRTOS/Source/tasks.c
FreeRTOS/Source/queue.c
FreeRTOS/Source/list.c
FreeRTOS/Source/portable/[compiler]/[architecture]/port.c.
FreeRTOS/Source/portable/MemMang/heap_x.c where ‘x’ is 1, 2, 3, 4 or 5.
If the directory that contains the port.c file also contains an assembly language file, then the assembly language file must also be used.

Optional Source Files

If you need software timer functionality, then add FreeRTOS/Source/timers.c to your project.

If you need event group functionality, then add FreeRTOS/Source/event_groups.c to your project.

If you need steam buffer or message buffer functionality, then add FreeRTOS/Source/stream_buffer.c to your project.

If you need co-routine functionality, then add FreeRTOS/Source/croutine.c to your project (note co-routines are deprecated and not recommended for new designs).

Header Files

The following directories must be in the compiler’s include path (the compiler must be told to search these directories for header files):
FreeRTOS/Source/include
FreeRTOS/Source/portable/[compiler]/[architecture].
Whichever directory contains the FreeRTOSConfig.h file to be used - see the Configuration File paragraph below.
Depending on the port, it may also be necessary for the same directories to be in the assembler’s include path.

Configuration File

Every project also requires a file called FreeRTOSConfig.h. FreeRTOSConfig.h tailors the RTOS kernel to the application being built. It is therefore specific to the application, not the RTOS, and should be located in an application directory, not in one of the RTOS kernel source code directories.
If heap_1, heap_2, heap_4 or heap_5 is included in your project, then the FreeRTOSConfig.h definition configTOTAL_HEAP_SIZE will dimension the FreeRTOS heap. Your application will not link if configTOTAL_HEAP_SIZE is set too high.

The FreeRTOSConfig.h definition configMINIMAL_STACK_SIZE sets the size of the stack used by the idle task. If configMINIMAL_STACK_SIZE is set too low, then the idle task will generate stack overflows. It is advised to copy the configMINIMAL_STACK_SIZE setting from an official FreeRTOS demo provided for the same microcontroller architecture. The FreeRTOS demo projects are stored in sub directories of the FreeRTOS/Demo directory. Note that some demo projects are old, so do not contain all the available configuration options.

Interrupt Vectors

[Cortex-M users: Information on installing interrupt handers is provided in the “The application I created compiles, but does not run” FAQ]
Every RTOS port uses a timer to generate a periodic tick interrupt. Many ports use additional interrupts to manage context switching. The interrupts required by an RTOS port are serviced by the provided RTOS port source files.

The method used to install the interrupt handlers provided by the RTOS port is dependent on the port and compiler being used. Refer to, and if necessary copy, the provided official demo application for the port being used. Also refer to the documentation page provided for the official demo application.

猜你喜欢

转载自blog.csdn.net/wowocpp/article/details/81741886