Skip to content

Commit

Permalink
Upload freertos 10.4.306.558 [1771]
Browse files Browse the repository at this point in the history
  • Loading branch information
gitlab-runner committed Sep 5, 2023
1 parent 085ab13 commit a358c5e
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 7 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ FreeRTOS is supplied as standard C source files built along with the other C fil

**Note:** Cortex®-R4 (CR4) is currently supported only on GCC_ARM

**Note:** Currently only GCC_ARM and ARM compilers are supported On CYW920829M2EVK-02 (20829B0 CM33) kit

See the FreeRTOS API documentation at <a href="https://www.freertos.org/a00106.html" target="_blank">FreeRTOS web page</a>.

## Features
Expand Down Expand Up @@ -211,7 +213,7 @@ This parameter specifies the total amount of RAM available for the FreRTOS heap.
### `configMINIMAL_STACK_SIZE`
This parameter specifies the size of the stack used by the idle task. It is not recommended to reduce the default parameter value.
This parameter specifies the size of the stack used by the idle task. It is not recommended to reduce the default parameter value. Please note that when DS-RAM feature is enabled, the minimum value of this parameter should be 256.
### `configUSE_TICKLESS_IDLE`
Expand Down
7 changes: 7 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,19 @@
- Ports for GCC, IAR, Arm&reg; compilers and Cortex&reg;-M0 (CM0), Cortex&reg;-M0+ (CM0P), Cortex&reg;-M4 (CM4), Cortex&reg;-M33 (CM33), Cortex&reg;-R4 (CR4) and Cortex&reg;-M7 (CM7) CPUs
- *FreeRTOSConfig.h* template with the recommended configuration options
- Cortex&reg;-R4 (CR4) is currently supported only on GCC_ARM
- Currently only GCC_ARM and ARM compilers are supported On CYW920829M2EVK-02 (20829B0 CM33) kit

See [README.md](./README.md) for a complete description of FreeRTOS.


## Changelog

### v10.4.306

- Modified the FreeRTOSConfig.h of CR4 port to fix the issue with debugger
- Fixed MISRA warnings
- DSRAM support added for CM33 ARM port

### v10.4.305

- Added functions to save and restore context before sleep for CM33
Expand Down
3 changes: 2 additions & 1 deletion Source/portable/COMPONENT_CM33/FreeRTOSConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ extern uint32_t SystemCoreClock;
#define configCPU_CLOCK_HZ SystemCoreClock
#define configTICK_RATE_HZ ((TickType_t ) 1000)
#define configMAX_PRIORITIES 7
#define configMINIMAL_STACK_SIZE 128
/* Increase the stack size to 256 to support ds-ram feature */
#define configMINIMAL_STACK_SIZE 256
#define configMAX_TASK_NAME_LEN 16
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
Expand Down
56 changes: 54 additions & 2 deletions Source/portable/COMPONENT_CM33/TOOLCHAIN_ARM/portdsram.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,65 @@
/* Standard includes. */
#include "portdsram.h"

/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE ensures that PRIVILEGED_FUNCTION
* is defined correctly and privileged functions are placed in correct sections. */
#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE

void vStoreDSRAMContextWithWFI( void )
/* Portasm includes. */
#include "portasm.h"

/* MPU_WRAPPERS_INCLUDED_FROM_API_FILE is needed to be defined only for the
* header files. */
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE

FREERTOS_COMMON_SECTION_BEGIN
void vStoreDSRAMContextWithWFI( void ) /* __attribute__ (( naked )) PRIVILEGED_FUNCTION */
{
__asm volatile
(
" .syntax unified \n"
" stmdb sp!, {r1-r11, lr} \n" /* Store reg on the stack*/
" mrs r1, psplim \n" /* r1 = PSPLIM. */
" mrs r2, control \n" /* r2 = Control. */
" adr r3, wfi_exit + 1 \n"
" stmdb sp!, {r1-r3} \n" /* Store on the stack - PSPLIM, Control Return Address */
" \n"
" ldr r2, =pxCurrentTCB \n" /* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
" ldr r1, [r2] \n" /* Read pxCurrentTCB. */
" mrs r0, psp \n" /* Read PSP in r0. */
" str r0, [r1] \n" /* Save the new top of stack in TCB. */
" wfi \n"
" isb \n"
" add sp, sp, #12 \n" /* We we do not enter DSRAM pop-out PSPLIM, Control Return Address*/
"wfi_exit: dsb \n"
" ldmia sp!, {r1-r11, pc} \n"
);
}
FREERTOS_COMMON_SECTION_END

FREERTOS_COMMON_SECTION_BEGIN
void vRestoreDSRAMContext( void )
{
__asm volatile
(
" ldr r2, pxCurrentTCBConstE1 \n" /* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */
" ldr r1, [r2] \n" /* Read pxCurrentTCB. */
" ldr r0, [r1] \n" /* The first item in pxCurrentTCB is the task top of stack. r0 now points to the top of stack. */
" \n"
" ldmia r0!, {r1-r3} \n" /* Read from stack - r1 = PSPLIM, r2 = CONTROL, r3 = LR */
" \n"
" msr psplim, r1 \n" /* Restore the PSPLIM register value for the task. */
" msr psp, r0 \n" /* restore stacks */
" ldr r0, MSPStackTop \n"
" msr msp, r0 \n"
" msr CONTROL, r2 \n"
" isb \n"
" bx r3 \n"
" \n"
" .align 4 \n"
"pxCurrentTCBConstE1: .word pxCurrentTCB \n"
"MSPStackTop: .word Image$$ARM_LIB_STACK$$ZI$$Limit \n"
);
}

FREERTOS_COMMON_SECTION_END
/*-----------------------------------------------------------*/
3 changes: 3 additions & 0 deletions Source/portable/COMPONENT_CR4/FreeRTOSConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,7 @@ extern void vApplicationSleep( uint32_t xExpectedIdleTime );
*/
#define configUSE_NEWLIB_REENTRANT 1

/* To enable debugging in CR4, return address of task should be set to zero */
#define configTASK_RETURN_ADDRESS 0

#endif /* FREERTOS_CONFIG_H */
15 changes: 14 additions & 1 deletion Source/queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,7 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength,

#if ( configUSE_RECURSIVE_MUTEXES == 1 )

FREERTOS_COMMON_SECTION_BEGIN
BaseType_t xQueueGiveMutexRecursive( QueueHandle_t xMutex )
{
BaseType_t xReturn;
Expand Down Expand Up @@ -662,12 +663,14 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength,

return xReturn;
}
FREERTOS_COMMON_SECTION_END

#endif /* configUSE_RECURSIVE_MUTEXES */
/*-----------------------------------------------------------*/

#if ( configUSE_RECURSIVE_MUTEXES == 1 )

FREERTOS_COMMON_SECTION_BEGIN
BaseType_t xQueueTakeMutexRecursive( QueueHandle_t xMutex,
TickType_t xTicksToWait )
{
Expand Down Expand Up @@ -705,6 +708,7 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength,

return xReturn;
}
FREERTOS_COMMON_SECTION_END

#endif /* configUSE_RECURSIVE_MUTEXES */
/*-----------------------------------------------------------*/
Expand Down Expand Up @@ -768,6 +772,7 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength,
#endif /* ( ( configUSE_COUNTING_SEMAPHORES == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) */
/*-----------------------------------------------------------*/

FREERTOS_COMMON_SECTION_BEGIN
BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
const void * const pvItemToQueue,
TickType_t xTicksToWait,
Expand Down Expand Up @@ -978,6 +983,7 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
}
} /*lint -restore */
}
FREERTOS_COMMON_SECTION_END
/*-----------------------------------------------------------*/

FREERTOS_COMMON_SECTION_BEGIN
Expand Down Expand Up @@ -1464,6 +1470,7 @@ BaseType_t xQueueReceive( QueueHandle_t xQueue,
FREERTOS_COMMON_SECTION_END
/*-----------------------------------------------------------*/

FREERTOS_COMMON_SECTION_BEGIN
BaseType_t xQueueSemaphoreTake( QueueHandle_t xQueue,
TickType_t xTicksToWait )
{
Expand Down Expand Up @@ -1681,6 +1688,7 @@ BaseType_t xQueueSemaphoreTake( QueueHandle_t xQueue,
}
} /*lint -restore */
}
FREERTOS_COMMON_SECTION_END
/*-----------------------------------------------------------*/

BaseType_t xQueuePeek( QueueHandle_t xQueue,
Expand Down Expand Up @@ -1984,6 +1992,7 @@ BaseType_t xQueuePeekFromISR( QueueHandle_t xQueue,
}
/*-----------------------------------------------------------*/

FREERTOS_COMMON_SECTION_BEGIN
UBaseType_t uxQueueMessagesWaiting( const QueueHandle_t xQueue )
{
UBaseType_t uxReturn;
Expand All @@ -1998,6 +2007,7 @@ UBaseType_t uxQueueMessagesWaiting( const QueueHandle_t xQueue )

return uxReturn;
} /*lint !e818 Pointer cannot be declared const as xQueue is a typedef not pointer. */
FREERTOS_COMMON_SECTION_END
/*-----------------------------------------------------------*/

UBaseType_t uxQueueSpacesAvailable( const QueueHandle_t xQueue )
Expand Down Expand Up @@ -2404,6 +2414,7 @@ BaseType_t xQueueIsQueueEmptyFromISR( const QueueHandle_t xQueue )
} /*lint !e818 xQueue could not be pointer to const because it is a typedef. */
/*-----------------------------------------------------------*/

FREERTOS_COMMON_SECTION_BEGIN
static BaseType_t prvIsQueueFull( const Queue_t * pxQueue )
{
BaseType_t xReturn;
Expand All @@ -2423,6 +2434,7 @@ static BaseType_t prvIsQueueFull( const Queue_t * pxQueue )

return xReturn;
}
FREERTOS_COMMON_SECTION_END
/*-----------------------------------------------------------*/

BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
Expand Down Expand Up @@ -2823,7 +2835,7 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
/*-----------------------------------------------------------*/

#if ( configUSE_TIMERS == 1 )

FREERTOS_COMMON_SECTION_BEGIN
void vQueueWaitForMessageRestricted( QueueHandle_t xQueue,
TickType_t xTicksToWait,
const BaseType_t xWaitIndefinitely )
Expand Down Expand Up @@ -2858,6 +2870,7 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )

prvUnlockQueue( pxQueue );
}
FREERTOS_COMMON_SECTION_END

#endif /* configUSE_TIMERS */
/*-----------------------------------------------------------*/
Expand Down
2 changes: 1 addition & 1 deletion Source/stream_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ static size_t prvReadMessageFromBuffer( StreamBuffer_t * pxStreamBuffer,
size_t xBytesToStoreMessageLength )
{
size_t xOriginalTail, xReceivedLength, xNextMessageLength;
configMESSAGE_BUFFER_LENGTH_TYPE xTempNextMessageLength;
configMESSAGE_BUFFER_LENGTH_TYPE xTempNextMessageLength = 0;

if( xBytesToStoreMessageLength != ( size_t ) 0 )
{
Expand Down
2 changes: 1 addition & 1 deletion version.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<version>10.4.305.482</version>
<version>10.4.306.558</version>

0 comments on commit a358c5e

Please sign in to comment.