4051 views|6 replies

158

Posts

0

Resources
The OP
 

[GD32L233C-START Review] - Transplanting Freertos real-time system [Copy link]

GD32L233C system resources are configured with 256KB flash and 32KB SRAM , and Freertos can be used , which makes it convenient to operate the module in a real-time system. Let's transplant this real-time system first.

  1. Source files can be downloaded from the FreeRTOS official website. Download the FreeRTOSv202112.00.zip version. The package name has changed, and the internal version number is FreeRTOS Kernel V10.4.6 .

https://www.freertos.org/

  1. There are only 6 files related to the FreeRTOS kernel , namely list.c queue.c tasks.c croutine.c timers.c , event_groups.c. This file is located in FreeRTOS\Source
  2. For the file related to memory allocation, GD32L233C selects heap_4.c . This file is located in Source\portable\ MemMang .
  3. The codes related to porting include port.c and portmacro.h . These codes are not only related to the compiler but also to the platform ( MCU ). FreeRTOS first classifies the compiler as a major category and then the platform ( MCU ) as a minor category. Here, the Keil compiler is selected and the platform is the Cortex-M23 kernel . The FreeRTOS kernel provides ARMv8-M and ARM _ CM23 porting codes under GCC , which can be run on the secure or non-secure side . When running on the non-secure side, the user task can call the functions exported by the secure side software . I use the non-secure mode, so the selected file is located in FreeRTOS\Source\portable\GCC\ARM_CM23_NTZ\non_secure .
  4. In addition to the above content, FreeRTOS kernel related header files are also included. The file FreeRTOS\Source\include .
  1. Add FreeRTOS files to the project .

  1. Add the header file path of FreeRTOS file to the project

  1. Compile and it will prompt an error, saying there is no FreeRTOSConfig.h file . To write this file to configure the kernel , you need the relevant macro definitions in FreeRTOSConfig.h . Copy a FreeRTOSConfig.h from the demo to the project directory and modify it.
  2. Recompile

These functions are defined in gd32123x.it.c. Remove them from gd32123x.it.c and recompile .

  1. The following error occurred

1 ), vApplicationGetIdleTaskMemory is used when we use static methods to create tasks . After using static methods to create tasks, the configSUPPORT_STATIC_ALLOCATION macro is defined as 1 .

2 ) There is a macro configCHECK_FOR_STACK_OVE RF LOW in FreeRTOS to detect stack overflow. If it is configured to 0 , you don't need to worry about it. If it is configured to other values, you need to call the hook function after detecting stack overflow. This is very useful for debugging and should be enabled.

Add the hook function in the main.c file .

There is no problem in compiling

  1. Add a task

Realize LED control tasks

The 4 LEDs light up back and forth, forming a back and forth running pattern.

Compile and download to achieve the expected result.


This post is from GD32 MCU

Latest reply

Hello, has the deep sleep mode been tested? I am currently facing this problem.   Details Published on 2022-10-11 19:34
 

6742

Posts

2

Resources
2
 

Porting FreeRTOS well can be a good preparation for the follow-up!

This post is from GD32 MCU

Comments

Yes. With it, everything becomes simple  Details Published on 2022-2-22 08:36
 
 
 

158

Posts

0

Resources
3
 
wangerxian posted on 2022-2-21 13:32 Transplanting FreeRTOS can be a good preparation for the follow-up!

Yes. With it, everything becomes simple

This post is from GD32 MCU
 
 
 

1181

Posts

0

Resources
4
 

I learned a lot. Not bad.

This post is from GD32 MCU
 
 
 

8

Posts

0

Resources
5
 

Can you try to see if this project can enter deep sleep mode? I configured a timer and it won't work.

This post is from GD32 MCU

Comments

I'll give it a try  Details Published on 2022-3-2 07:57
 
 
 

158

Posts

0

Resources
6
 
xiaoming668 posted on 2022-2-24 11:14 Big man, can you try to see if this project can enter deep sleep mode? I configured a timer and it can't enter.

I'll give it a try

This post is from GD32 MCU
 
 
 

1

Posts

0

Resources
7
 

Hello, has the deep sleep mode been tested? I am currently facing this problem.

This post is from GD32 MCU
 
 
 

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