This repository contains the port of FreeRTOS for Renesas RH850/U2x microcontrollers using the GHS compiler. The following sections provide instructions on how to use this port, a link to the test project, and other relevant information.
| Device | FPU | FXU | SMP |
|---|---|---|---|
| U2A6 | Yes | No | Yes |
| U2A8 | Yes | No | Yes |
| U2A16 | Yes | No | Yes |
| U2B6 | Yes | Yes | Yes |
| U2B10 | Yes | Yes | Yes |
The test project can be found in RH850_U2Ax_GHS and RH850_U2Bx_GHS. These projects contain example tasks and configurations to help you get started with FreeRTOS on the RH850/U2Ax and RH850/U2Bx.
Allocate the Stack area in Linker Script:
- In the Linker configuration, create a dedicated Stack (memory region) for the Vector Table of each Processing Element (PE).
For example:
Declare the Vector Table in the source code:
- In the application source code, define the Vector Table.
- Map this Vector Table to the Stack region that was created in the Linker Script.
For example, in main.c file, add:
Assign the Vector Table into the INTBP register in Startup:
- In System Startup, assign the Vector Table address into the INTBP register so that the Processor knows where to fetch Interrupt Vectors.
For example, in Startup file, add:
Interrupt Vector Configuration:
- Interrupt handling must be configured using the Direct Vector method, e.g. by configuring EBASE or EICn registers.
The FXU Unit is available only on RH850 U2Bx devices.
To ensure correct operation, any task requiring FXU must run on an FXU-enabled core. In SMP systems, the core assignment shall be fixed using CPU affinity via the vTaskCoreAffinitySet() function.
By default, the FPU and FXU operations are enabled, which may introduce redundant code and impact performance.
If they are not required by the application, FPU and FXU related code can be disabled by defining the macros configDISABLE_FPU and configDISABLE_FXU respectively.
Additionally, -DconfigDISABLE_FPU and -DconfigDISABLE_FXU should be added to the build flags.
For example, in make file of GHS, add the CPU Flag:
Refer this formula to estimate the minimal stack size (configMINIMAL_STACK_SIZE) used: [(task_context_size) * 2] + stack_required_for_taskcode.
In which, task_context_size is calculated as 36 * 4 bytes = 144 bytes.
Users need to create a memory section named mev_address in CRAM for Exclusive Control functionality. Users should initialize the mev_address section in the startup file.
For example:
This port supports both U2Ax and U2Bx devices. The User must configure configDEVICE_NAME with the value U2Bx_DEVICES or U2Ax_DEVICES to specify which device is being used.
This port also supports the configuration of contiguous CPU cores in FreeRTOS SMP, allowing the User to set task affinity for execution on specific cores or subsets of cores.
Documentation:
Support:
Contributing: