FreeRTOS learning 01 and mdk5 setting Chinese of punctual atomic Explorer stm32


The method of setting Chinese is directly pulled to the bottom

Before, I always used the front and rear systems to play single-chip microcomputer. Everything was hard connected by modules. After the interruption and cycle were written, I felt that everything could come out with some input and output. However, I always felt that I had no improvement. I felt that the single-chip microcomputer had come to an end. Later, I found that I didn’t understand it. Now I’m going to study the new RTOS system again, Previously, xue32 just bought the STM32 of punctual atom. Just follow the video of brother atom to get started and record some questions

The full name of RTOS system: real time OS real-time operating system, which mainly emphasizes real-time. There are many on the market, such as FreeRTOS, UCOS, RTX, RT thread, djyos, etc

The core content of RTOS operating system is: real-time kernel!

The deprivation kernel can deprive other tasks of CPU usage. It always runs the task with the highest priority among the ready tasks

FreeRTOS system is a tailorable and deprivable multitasking kernel, and there is no limit on the number of tasks. It provides all the functions required by the real-time operating system, and is written in C and assembly. It has simple structure and strong readability! It is very suitable for embedded introductory learning


Double click to download and install, and then these will appear:

Plus is an official expansion function, not an upgraded version of FreeRTOS

Where source is the kernel source code

Start FreeRTOS shift operation

First, open a project template in the atomic library, copy it as a whole and put it on the desktop:

Under its directory, create a folder called FreeRTOS

Copy the source code of FreeRTOS in this folder

Only these are left under the portable file:

Then open the project and add a group:

Add corresponding file:

In the following figure, the port C) in Experiment 1, FreeRTOS shift value \ FreeRTOS \ portable \ RVDS \ arm_ Cm4f} path

About {heap_ 4. C , this file is the memory management of FreeRTOS. There are many kinds. The fourth one is added here and will be learned later

Then add the header file path

Then you need to add the official demo of FreeRTOS

The file path is: \ FreeRTOS source code \ freertosv9 0.0 \ FreeRTOS \ demo find the above folder and open:

This demo is based on IAR, so this We need to make some modifications to the H file, which is shown below

Copy this file into the project

USART C , document, line 47 , at_ sys_ Add {void before exit (int x)

void _ sys_ Exit (int x) this is due to the support problem of the new version of MDK

Since the demo process officially given by FreeRTOS is based on IAR, but the compiler used is mdk5, we just copied FreeRTOS H) yes to modify:

Open FreeRTOS H file, you can see this on line 87

Replace with:

1 #if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__)

Next, the following function enables to close:

Then go here and comment out these functions


At this time, there should be no errors in the compilation

However, it still cannot be used. We will replace the system folder of our newly created project with the system copy of the configured FreeRTOS project

Then mask the macro definition

Then compile again, no error, no warning, success


For the problem of displaying Chinese garbled codes in mdk5, change the following settings:

That’s it