9768 views|6 replies

9

Posts

2

Resources
The OP
 

Domestic M0 chip transplantation FreeRTOS notes 1 [Copy link]

 This post was last edited by LONGSHEN1 on 2020-9-10 17:14

The author took advantage of his free time to port FreeRTOS to a domestic MCU. FreeRTOS is very easy to port, and there are many reference materials on the Internet. FreeRTOS has always been the most widely used small embedded operating system in the global embedded market analysis report. The following is the porting record:

1. Preliminary preparation

Prepare a simple project template, such as a program to light up an LED;

2. Source code download

Download V8.2.3 from https://sourceforge.net/projects/freertos/files/FreeRTOS/V8.2.3/
Version, this is the highest version in the 8.X series. Version 9.0 is still in the testing stage and we will not use it yet.
3. File Import
1. Create a FreeRTOS folder in the project template to store the FreeRTOS source files
2. Copy all the following files in the FreeRTOSV8.2.3 software package path: FreeRTOSV8.2.3\FreeRTOS\Source to the project template FreeRTOS folder

3. Copy FreeRTOSConfig.h to the project template. The file is in the path of the FreeRTOSV8.2.3 software package:
FreeRTOSV8.2.3\FreeRTOS\Demo\CORTEX_STM32F103_Keil, this is the official configuration file.
4. Add the source code file to the MDK project. The effect after adding is as follows
The heap_4.c file path is: FreeRTOS\Source\portable\MemMang
The path of the port.c and portmacro.h files is: FreeRTOS\Source\portable\RVDS\ARM_CM0 . Since the author uses the M0 kernel, the porting file must also add the M0 kernel. This kernel file selects the corresponding file according to different platforms.
5. Create a new includes.h file and put all header files under this header file.
6. Add the corresponding header file path
7. The last step, and also the most important step, is to modify the FreeRTOSConfig.h configuration file ( users modify it according to their own configuration )
8. The heap size is defined in the FreeRTOSConfig.h file. The FreeRTOS kernel, user dynamic memory application, task stack, etc. all need this space. Users need to fill in the appropriate value according to the MCU memory size they use.
9. Interrupt service routines are mapped to standard names defined by CMSIS
#define vPortSVCHandler SVC_Handler
#define xPortPendSVHandler PendSV_Handler
In addition, users need to map the xPortSysTickHandler(void) tick timer to the MCU timer
10. The transplantation is now completed. Since many details are not described in detail, we can communicate together to improve it.

Latest reply

This type of operating system is suitable for those with low real-time requirements, but if the real-time requirements are high, execution omissions are likely to occur.   Details Published on 2022-12-8 09:15
 

310

Posts

5

Resources
2
 

Which brand is this domestically produced M0?

 
 
 

7462

Posts

2

Resources
3
 

10.3 is out, what year is this article from...

 
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 
 

9

Posts

2

Resources
4
 
freebsder posted on 2020-9-16 22:26 10.3 is out, what year is this article from...

I transplanted it early, and didn't pay much attention to the official website updates.

 
 
 

13

Posts

0

Resources
5
 

The transplantation is now complete. Since many details are not described in detail, everyone can communicate and improve it together.

 
 
 

224

Posts

0

Resources
6
 

What kind of mysterious chip is this, Lianshengde or something else?

By the way, can systems like LiteOS be easily ported to various chips?

 
 
 

12

Posts

0

Resources
7
 

This type of operating system is suitable for those with low real-time requirements, but if the real-time requirements are high, execution omissions are likely to occur.

 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list