Skip to content

Commit

Permalink
Merge branch 'main' into update-pxcurrentTCB
Browse files Browse the repository at this point in the history
  • Loading branch information
chinglee-iot authored Aug 20, 2024
2 parents 893fcc8 + 2faa8bc commit ba2306d
Show file tree
Hide file tree
Showing 15 changed files with 1,469 additions and 116 deletions.
18 changes: 17 additions & 1 deletion .github/.cSpellWords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ CCNT
CCNTR
CCPN
CCPR
CCRH
CDTY
CDTYR
CFBS
Expand All @@ -86,6 +87,7 @@ CHSR
CICR
CISR
CKDIV
CKDIVMD
CKEY
CKGR
CKLO
Expand Down Expand Up @@ -125,6 +127,7 @@ CODR
comms
COMPA
CONFG
coreid
coremqtt
CORTUS
coverity
Expand All @@ -149,6 +152,7 @@ CPRE
cpsid
cpsie
CPSR
CPUCLK
CPUID
CRCB
crflash
Expand All @@ -164,6 +168,8 @@ csrs
csrw
CTCR
ctest
CTPC
CTPSW
CTRLA
CTSIC
CUPD
Expand Down Expand Up @@ -227,6 +233,7 @@ DTREN
DTXD
DUNITY
DVAR
Dxxx
EABI
ecall
ECIT
Expand All @@ -237,6 +244,7 @@ EEVT
eevtedg
EEVTEDG
EFRHD
EIIC
EINT
EIPC
EIPSW
Expand Down Expand Up @@ -310,6 +318,7 @@ FNTR
FOSC
FPCCR
FPCSR
FPEPC
FPSW
FPUL
FRDY
Expand Down Expand Up @@ -338,6 +347,7 @@ GPTA
HCLK
Hitach
HRESP
HTCFG
HWHSH
HWORD
HWRD
Expand All @@ -353,6 +363,7 @@ ICCR
ICCRPR
ICCRX
ICERST
ICIPI
ICSR
IDCR
IECR
Expand All @@ -372,6 +383,7 @@ INTTM
IODEFINE
IORLW
IPEN
IPIR
IPLB
ipsr
IPSR
Expand All @@ -380,8 +392,8 @@ IRET
IRXFCS
ISRAM
ISRR
ISR's
ISRS
ISR's
ISRTICK
isystem
ITIF
Expand Down Expand Up @@ -564,6 +576,7 @@ OSCEN
OSCOFF
OSCOUNT
OSMC
OSTM
outpw
OVLY
OVRE
Expand All @@ -584,6 +597,7 @@ PCLKSEL
PCSR
PCXI
PDSR
PEID
PEIE
PENDSV
PENDSVCLEAR
Expand Down Expand Up @@ -799,6 +813,8 @@ SWINTR
SWRST
SWTRG
synchronise
SYNCM
syncm
SYSC
sysclk
Sysclk
Expand Down
38 changes: 19 additions & 19 deletions include/queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
* the same size.
*
* @return If the queue is successfully create then a handle to the newly
* created queue is returned. If the queue cannot be created then 0 is
* created queue is returned. If the queue cannot be created then NULL is
* returned.
*
* Example usage:
Expand All @@ -126,15 +126,15 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
*
* // Create a queue capable of containing 10 uint32_t values.
* xQueue1 = xQueueCreate( 10, sizeof( uint32_t ) );
* if( xQueue1 == 0 )
* if( xQueue1 == NULL )
* {
* // Queue was not created and must not be used.
* }
*
* // Create a queue capable of containing 10 pointers to AMessage structures.
* // These should be passed by pointer as they contain a lot of data.
* xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) );
* if( xQueue2 == 0 )
* if( xQueue2 == NULL )
* {
* // Queue was not created and must not be used.
* }
Expand Down Expand Up @@ -292,7 +292,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
* queue is full. The time is defined in tick periods so the constant
* portTICK_PERIOD_MS should be used to convert to real time if this is required.
*
* @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
* @return pdPASS if the item was successfully posted, otherwise errQUEUE_FULL.
*
* Example usage:
* @code{c}
Expand Down Expand Up @@ -375,7 +375,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
* is full. The time is defined in tick periods so the constant
* portTICK_PERIOD_MS should be used to convert to real time if this is required.
*
* @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
* @return pdPASS if the item was successfully posted, otherwise errQUEUE_FULL.
*
* Example usage:
* @code{c}
Expand Down Expand Up @@ -460,7 +460,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
* queue is full. The time is defined in tick periods so the constant
* portTICK_PERIOD_MS should be used to convert to real time if this is required.
*
* @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
* @return pdPASS if the item was successfully posted, otherwise errQUEUE_FULL.
*
* Example usage:
* @code{c}
Expand Down Expand Up @@ -633,7 +633,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
* item at the back of the queue, or queueSEND_TO_FRONT to place the item
* at the front of the queue (for high priority messages).
*
* @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
* @return pdPASS if the item was successfully posted, otherwise errQUEUE_FULL.
*
* Example usage:
* @code{c}
Expand Down Expand Up @@ -723,8 +723,8 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
* xQueuePeek() will return immediately if xTicksToWait is 0 and the queue
* is empty.
*
* @return pdTRUE if an item was successfully received from the queue,
* otherwise pdFALSE.
* @return pdPASS if an item was successfully received from the queue,
* otherwise errQUEUE_EMPTY.
*
* Example usage:
* @code{c}
Expand Down Expand Up @@ -811,8 +811,8 @@ BaseType_t xQueuePeek( QueueHandle_t xQueue,
* @param pvBuffer Pointer to the buffer into which the received item will
* be copied.
*
* @return pdTRUE if an item was successfully received from the queue,
* otherwise pdFALSE.
* @return pdPASS if an item was successfully received from the queue,
* otherwise pdFAIL.
*
* \defgroup xQueuePeekFromISR xQueuePeekFromISR
* \ingroup QueueManagement
Expand Down Expand Up @@ -852,8 +852,8 @@ BaseType_t xQueuePeekFromISR( QueueHandle_t xQueue,
* constant portTICK_PERIOD_MS should be used to convert to real time if this is
* required.
*
* @return pdTRUE if an item was successfully received from the queue,
* otherwise pdFALSE.
* @return pdPASS if an item was successfully received from the queue,
* otherwise errQUEUE_EMPTY.
*
* Example usage:
* @code{c}
Expand Down Expand Up @@ -998,7 +998,7 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
* running task. If xQueueSendToFrontFromISR() sets this value to pdTRUE then
* a context switch should be requested before the interrupt is exited.
*
* @return pdTRUE if the data was successfully sent to the queue, otherwise
* @return pdPASS if the data was successfully sent to the queue, otherwise
* errQUEUE_FULL.
*
* Example usage for buffered IO (where the ISR can obtain more than one value
Expand Down Expand Up @@ -1070,7 +1070,7 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
* running task. If xQueueSendToBackFromISR() sets this value to pdTRUE then
* a context switch should be requested before the interrupt is exited.
*
* @return pdTRUE if the data was successfully sent to the queue, otherwise
* @return pdPASS if the data was successfully sent to the queue, otherwise
* errQUEUE_FULL.
*
* Example usage for buffered IO (where the ISR can obtain more than one value
Expand Down Expand Up @@ -1235,7 +1235,7 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
* running task. If xQueueSendFromISR() sets this value to pdTRUE then
* a context switch should be requested before the interrupt is exited.
*
* @return pdTRUE if the data was successfully sent to the queue, otherwise
* @return pdPASS if the data was successfully sent to the queue, otherwise
* errQUEUE_FULL.
*
* Example usage for buffered IO (where the ISR can obtain more than one value
Expand Down Expand Up @@ -1318,7 +1318,7 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
* item at the back of the queue, or queueSEND_TO_FRONT to place the item
* at the front of the queue (for high priority messages).
*
* @return pdTRUE if the data was successfully sent to the queue, otherwise
* @return pdPASS if the data was successfully sent to the queue, otherwise
* errQUEUE_FULL.
*
* Example usage for buffered IO (where the ISR can obtain more than one value
Expand Down Expand Up @@ -1389,8 +1389,8 @@ BaseType_t xQueueGiveFromISR( QueueHandle_t xQueue,
* to unblock *pxTaskWoken will get set to pdTRUE, otherwise *pxTaskWoken will
* remain unchanged.
*
* @return pdTRUE if an item was successfully received from the queue,
* otherwise pdFALSE.
* @return pdPASS if an item was successfully received from the queue,
* otherwise pdFAIL.
*
* Example usage:
* @code{c}
Expand Down
46 changes: 46 additions & 0 deletions portable/CCRH/F1Kx/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# RH850/F1K and F1Kx FreeRTOS Port with CC-RH Compiler

## Introduction

This repository contains the port of FreeRTOS for Renesas RH850/F1K and F1Kx microcontrollers using the CC-RH compiler. The following sections provide instructions on how to use this port, a link to the test project, and other relevant information.

## Prerequisites
- Compiler: CC-RH
- FreeRTOS version 11.1.0

| Device | FPU | SMP |
|----------|-----|-----|
| F1K | Yes | No |
| F1KM-S1 | Yes | No |
| F1KM-S2 | Yes | No |
| F1KM-S4 | Yes | No |
| F1KH-D8 | Yes | Yes |

## Link to Test Project

The test project can be found [here](https://github.com/FreeRTOS/FreeRTOS-Community-Supported-Demos) (`RH850_F1Kx_CCRH`). This project contains example tasks and configurations to help you get started with FreeRTOS on the RH850/F1K and F1Kx.

## Note
1. Configure IPIR Interrupt: Ensure that the bit specifying the destination for binding (requesting) an interrupt is enabled (e.g: IBDxxx register of F1KH-D8) (1)
2. `Channel 0` and address `0xFFFEEC00` are used as default configuration for configIPIR_CHANNEL and configEXCLUSIVE_ADDRESS, in case of resource confliction other channel/address can be used. (2)
3. The minimal stack size (configMINIMAL_STACK_SIZE) must be included the reserved memory for nested interrupt. This formula can be referred: `(task_context_size) * (1 + configMAX_INT_NESTING) + Stack_depth_of_taskcode`
In which, `task_context_size` is calculated as `36*4bytes = 144bytes` (when FPU enabled) or `34*4bytes = 136` (when FPU disabled), configMAX_INT_NESTING is 02 as default.
4. `configTIMER_PRESCALE`: This value is required in order to correctly configure clock for `CPUCLK_L`. Refer to Hardware Manual at `Table 44.22` for `option byte`: If the user sets the option byte `CKDIVMD to 1`, then `configTIMER_PRESCALE = 4`. Otherwise, if `CKDIVMD is set to 0`, then `configTIMER_PRESCALE = 2`.

(1) This is applicable for F1KH-D8 with SMP only.

(2) This is optional and applicable for SMP only.

## Other Relevant Information

- **Documentation:**
- Refer to the official [FreeRTOS documentation](https://www.freertos.org/Documentation/RTOS_book.html) for detailed information on configuring and using FreeRTOS.
- Consult the [RH850 F1K group user manual hardware manual](https://www.renesas.com/us/en/document/mah/rh850f1k-group-users-manual-hardware?r=1170166) for specific details about the microcontroller.
- For more information about Renesas RH850/F1K and F1Kx, please visit [this website](https://www.renesas.com/us/en/products/microcontrollers-microprocessors/rh850-automotive-mcus)
- The CC-RH compiler can be downloaded [here](https://www.renesas.com/us/en/software-tool/c-compiler-package-rh850-family#downloads)

- **Support:**
- If you encounter any issues or have questions about this port, please open an issue in this repository or contact the maintainer.

- **Contributing:**
- Contributions to improve this port are welcome. Please fork the repository, make your changes, and submit a pull request.
Loading

0 comments on commit ba2306d

Please sign in to comment.