919 views|8 replies

224

Posts

0

Resources
The OP
 

【ACM32G103RCT6】3-Porting FreeRTOS to ACM32 [Copy link]

 
This post was last edited by qiao--- on 2023-12-30 03:20

In this video, we will transplant the rtos system to acm32. acm32 is compatible with M33 and M4 instruction sets, so it is relatively easy to transplant. There are engineering attachments at the end of the article.

First download the official source code of FreeRTOS, given the URL FreeRTOS - Market leading RTOS (Real Time Operating System) for embedded systems with Internet of Things extensions

After downloading, enter the source code folder FreeRTOSv202212.01\FreeRTOSv202212.01\FreeRTOS

The source directory contains some official source codes, which are the highlights of our porting. The demo folder contains some board-based porting routines. Our subsequent porting will also be mainly based on these two folders.

We open our project directory and create a new FreeRTOS file to install the FreeRTOS source code of our project, as shown below:

Go to the source folder in the source code directory we downloaded and copy the include folder and dot c file to our FreeRTOS folder, and create a new portable file to install the architecture's porting code, as shown below.

Copy the ARM_CM4F folder under the FreeRTOS\Source\portable\RVDS folder to the portable folder, and copy the heap_4.c folder under the FreeRTOS\Source\portable\MemMang folder to the portable folder. See the figure below

Copy the FreeRTOSConfig.h file of the same architecture in the demo directory to the user directory of our project. I copied the FreeRTOSConfig.h file in the FreeRTOSv202212.01\FreeRTOSv202212.01\FreeRTOS\Demo\CORTEX_M4F_CEC1302_Keil_GCC folder.

The code migration is now complete, and the next step is to build the project. Enter keil to create the corresponding RTOS file and add the c file, as shown below

After adding, let's compile it

One reason for the error is that the system frequency is not defined. We change line 44 under the FreeRTOSConfig.h folder to the following code

Compile again, three errors

We delete the two interrupts under the it folder and modify the SysTick_Handler interrupt because they redefine the interrupt name with the rtos file.

Compile again, 0 errors, 0 warnings.

Next, we create two tasks and run them simply.

Open the serial port to check the status. The system has been transplanted successfully and can run normally.

rtos.7z (1.28 MB, downloads: 2)
This post is from Domestic Chip Exchange

Latest reply

I am here to mine. I am interested in this post and want to learn it. It would be nice if there is a more detailed explanation, such as software programming logic. I am a novice and don't understand it very well. Please don't laugh at me if the description is inaccurate.   Details Published on 2023-12-30 13:22
 
 

6841

Posts

11

Resources
2
 
Thanks to the boss for installing the FreeRTOS operating system on Hangxin Technology.
This post is from Domestic Chip Exchange
 
 
 

6841

Posts

11

Resources
3
 

What I am curious about is how the heartbeat packet of FreeRTOS is connected to the system?

This post is from Domestic Chip Exchange

Comments

I use the systick interrupt to provide the heartbeat for it, and the hal library heartbeat I use the timer 6 interrupt to provide it. By the way, I read your post last night and I didn't understand the system clock. I use g_SystemCoreClock.[attachimg]769212[/attachimg]   Details Published on 2023-12-30 14:13
 
 
 

6841

Posts

11

Resources
4
 

The systickhandle is also modified to provide the heartbeat packet. Is it true that Freertos has fewer files than tobudos?

This post is from Domestic Chip Exchange
 
 
 

623

Posts

0

Resources
5
 

Because the Cortex-M series kernels are now designed with RTOS in mind, porting is very convenient.

This post is from Domestic Chip Exchange

Comments

That's right, transplantation is very convenient now  Details Published on 2023-12-30 14:14
 
 
 

73

Posts

0

Resources
6
 

I am here to mine. I am interested in this post and want to learn it. It would be nice if there is a more detailed explanation, such as software programming logic. I am a novice and don't understand it very well. Please don't laugh at me if the description is inaccurate.

This post is from Domestic Chip Exchange

Comments

Haha thanks for the support  Details Published on 2023-12-30 14:15
 
 
 

224

Posts

0

Resources
7
 
lugl4313820 posted on 2023-12-30 08:58 I am curious about how the heartbeat packet of FreeRTOS is connected to the system?

I use the systick interrupt to provide the heartbeat for it, and the hal library heartbeat I use the timer 6 interrupt to provide it. By the way, I read your post last night and I didn't understand the system clock. I use g_SystemCoreClock.

This post is from Domestic Chip Exchange
 
 
 

224

Posts

0

Resources
8
 
jobszheng5 posted on 2023-12-30 09:46 Because the Cortex-M series kernels are now designed with a tendency to target RTOS, porting is very convenient.

That's right, transplantation is very convenient now

This post is from Domestic Chip Exchange
 
 
 

224

Posts

0

Resources
9
 
haocede posted on 2023-12-30 13:22 I am here to mine. I am interested in this post and want to learn it. It would be nice if there were more detailed explanations, such as software programming logic. I am a small...

Haha thanks for the support

This post is from Domestic Chip Exchange
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

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