470 views|1 replies

55

Posts

0

Resources
The OP
 

[Renesas RA8D1 development board, graphics MCU evaluation based on M85 core] RA8D1 ported FreeRTOS [Copy link]

Development Environment:
IDE: MKD 5.38a
Development board: CPKCOR-RA8D1B development board
MCU: R7FA8D1BHEC332AS00

1 Introduction

It is very simple to transplant FreeRTOS based on Renesas MCU. You only need to configure it to generate a FreeRTOS project. Here I use Renesas RA Smart Configurator and Keil5 for development.

2 Create a FreeRTOS project

Open RA Smart Configurator, select File->New->FSP Project to create a new project.
Figure 2-1 Create a new FSP Project
First, select the project path. I use the default path here.
Figure 2-2 Project path selection
Next, configure the FSP version, MCU model and other information, and choose according to the actual situation.
Figure 2-3 FSP basic parameter configuration
The next step is to select the security policy. Although RA8D1 supports TrustZone, it is not selected here for the time being.
Figure 2-4 Select whether to support TrustZone
Next, select RTOS support. FSP 5.1.0 supports FreeRTOS and Threadx. Select FreeRTOS here.
Figure 2-5 Select RTOS
The next step is to select a project template.
Figure 2-6 Project Template Selection
Next, create a new empty task. Click "Stacks Configuration->New Thread" to create a new task.
Figure 2-7 Configuration Task
Common is about the configuration of FreeRTOS, and Thread is the configuration parameters of the newly created thread. Here we only focus on the configuration of Thread.
Symbol is the name of the task handle, Name is the name of the task entry, Stack size is the stack size, and Priority is the task priority. Memory Allocation is the memory allocation method, and static allocation is used here. If dynamic allocation is used, you need to enable Dynamic Allocation in Memory Allocation in Common and set the total Heap Size. Other parameters can be left as default.
You also need to configure the clock. The external crystal oscillator is 24MHz, so you need to modify the input clock size. The default MOSC is 20MHz. The main frequency clock is the default 240 MHz, which comes from the 24MHz clock of MOSC, which is multiplied by PLL and flows to the system clock. For details, please refer to the configuration of the RA Smart Configurator file.
Figure 2-8 RA Smart Configurator Clock Configuration
Here the LED is configured as output mode.
Figure 2-9 RA Smart Configurator configures GPIO
Then finally click the “Generate Project Content” icon in the upper right corner to generate the project.
After the configuration is complete, you can generate the project.
Figure 2-10 Project Generation
Finally, open the project directory and the information is as follows.
Figure 2-11 Project Directory

3 Compile the project

Open the software and try to compile the project.
Figure 3-1 MDK Compilation Project
If there are no errors or warnings, it means the project is generated successfully.
Figure 3-2 Compile Log Information
Next, you can develop based on FreeRTOS.
Here I take LED as an example, and the task function is as follows.
#define GPIO_LED1 BSP_IO_PORT_10_PIN_01
/* LED_Thread entry function */
/* pvParameters contains TaskHandle_t */
void led_thread_entry(void * pvParameters)
{
FSP_PARAMETER_NOT_USED(pvParameters);
/* TODO: add your own code here */
while(1)
{
R_IOPORT_PinWrite(&g_ioport_ctrl, GPIO_LED1, BSP_IO_LEVEL_LOW);
vTaskDelay(500);
R_IOPORT_PinWrite(&g_ioport_ctrl, GPIO_LED1, BSP_IO_LEVEL_HIGH);
vTaskDelay(500);
}
}
After recompiling and downloading to the board, the LED will flash continuously.
This post is from Renesas Electronics MCUs

Latest reply

Study and study!   Details Published on 2024-7-9 21:12

9

Posts

0

Resources
2
 

Study and study!

This post is from Renesas Electronics MCUs
 
 

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