Skip to content

Commit 1435c3a

Browse files
committed
update 10.5.1+ - minor updates
1 parent eb88db0 commit 1435c3a

29 files changed

+775
-230
lines changed

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=FreeRTOS
2-
version=10.5.0-1
2+
version=10.5.1-0
33
author=Richard Barry <[email protected]>
44
maintainer=Phillip Stevens <[email protected]>
55
sentence=FreeRTOS Real Time Operating System implemented for AVR (Uno, Nano, Leonardo, Mega).

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ My other [AVRfreeRTOS Sourceforge Repository](https://sourceforge.net/projects/a
1313

1414
This library was the genesis of [generalised support for the ATmega platform within FreeRTOS](https://github.com/FreeRTOS/FreeRTOS-Kernel/pull/48).
1515

16-
Over the past few years freeRTOS development has become increasingly 32-bit orientated, with little change or improvement for the 8-bit world. As such I'm treating this 16th September 2022 10.5.0 release as my LTS release.
16+
Over the past few years freeRTOS development has become increasingly 32-bit orientated, with little change or improvement for the 8-bit world. As such I'm treating this FreeRTOS V10.5.x (released May 1 2023) as my LTS release.
1717

1818

1919
## General

src/Arduino_FreeRTOS.h

Lines changed: 81 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* FreeRTOS Kernel V10.5.0
2+
* FreeRTOS Kernel V10.5.1+
33
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
44
*
55
* SPDX-License-Identifier: MIT
@@ -55,9 +55,32 @@
5555
#endif
5656
/* *INDENT-ON* */
5757

58+
/* Acceptable values for configTICK_TYPE_WIDTH_IN_BITS. */
59+
#define TICK_TYPE_WIDTH_16_BITS 0
60+
#define TICK_TYPE_WIDTH_32_BITS 1
61+
#define TICK_TYPE_WIDTH_64_BITS 2
62+
5863
/* Application specific configuration options. */
5964
#include "FreeRTOSConfig.h"
6065

66+
#if !defined( configUSE_16_BIT_TICKS ) && !defined( configTICK_TYPE_WIDTH_IN_BITS )
67+
#error Missing definition: One of configUSE_16_BIT_TICKS and configTICK_TYPE_WIDTH_IN_BITS must be defined in FreeRTOSConfig.h. See the Configuration section of the FreeRTOS API documentation for details.
68+
#endif
69+
70+
#if defined( configUSE_16_BIT_TICKS ) && defined( configTICK_TYPE_WIDTH_IN_BITS )
71+
#error Only one of configUSE_16_BIT_TICKS and configTICK_TYPE_WIDTH_IN_BITS must be defined in FreeRTOSConfig.h. See the Configuration section of the FreeRTOS API documentation for details.
72+
#endif
73+
74+
/* Define configTICK_TYPE_WIDTH_IN_BITS according to the
75+
* value of configUSE_16_BIT_TICKS for backward compatibility. */
76+
#ifndef configTICK_TYPE_WIDTH_IN_BITS
77+
#if ( configUSE_16_BIT_TICKS == 1 )
78+
#define configTICK_TYPE_WIDTH_IN_BITS TICK_TYPE_WIDTH_16_BITS
79+
#else
80+
#define configTICK_TYPE_WIDTH_IN_BITS TICK_TYPE_WIDTH_32_BITS
81+
#endif
82+
#endif
83+
6184
/* Basic FreeRTOS definitions. */
6285
#include "projdefs.h"
6386

@@ -71,9 +94,45 @@
7194

7295
/* Required if struct _reent is used. */
7396
#if ( configUSE_NEWLIB_REENTRANT == 1 )
74-
#include <reent.h>
97+
98+
#include "newlib-freertos.h"
99+
100+
#endif /* if ( configUSE_NEWLIB_REENTRANT == 1 ) */
101+
102+
/* Must be defaulted before configUSE_PICOLIBC_TLS is used below. */
103+
#ifndef configUSE_PICOLIBC_TLS
104+
#define configUSE_PICOLIBC_TLS 0
105+
#endif
106+
107+
#if ( configUSE_PICOLIBC_TLS == 1 )
108+
109+
#include "picolibc-freertos.h"
110+
111+
#endif /* if ( configUSE_PICOLIBC_TLS == 1 ) */
112+
113+
#ifndef configUSE_C_RUNTIME_TLS_SUPPORT
114+
#define configUSE_C_RUNTIME_TLS_SUPPORT 0
75115
#endif
76116

117+
#if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 )
118+
119+
#ifndef configTLS_BLOCK_TYPE
120+
#error Missing definition: configTLS_BLOCK_TYPE must be defined in FreeRTOSConfig.h when configUSE_C_RUNTIME_TLS_SUPPORT is set to 1.
121+
#endif
122+
123+
#ifndef configINIT_TLS_BLOCK
124+
#error Missing definition: configINIT_TLS_BLOCK must be defined in FreeRTOSConfig.h when configUSE_C_RUNTIME_TLS_SUPPORT is set to 1.
125+
#endif
126+
127+
#ifndef configSET_TLS_BLOCK
128+
#error Missing definition: configSET_TLS_BLOCK must be defined in FreeRTOSConfig.h when configUSE_C_RUNTIME_TLS_SUPPORT is set to 1.
129+
#endif
130+
131+
#ifndef configDEINIT_TLS_BLOCK
132+
#error Missing definition: configDEINIT_TLS_BLOCK must be defined in FreeRTOSConfig.h when configUSE_C_RUNTIME_TLS_SUPPORT is set to 1.
133+
#endif
134+
#endif /* if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) */
135+
77136
/*
78137
* Check all the required application specific macros have been defined.
79138
* These macros are application specific and (as downloaded) are defined
@@ -104,8 +163,10 @@
104163
#error Missing definition: configUSE_TICK_HOOK must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
105164
#endif
106165

107-
#ifndef configUSE_16_BIT_TICKS
108-
#error Missing definition: configUSE_16_BIT_TICKS must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
166+
#if ( ( configTICK_TYPE_WIDTH_IN_BITS != TICK_TYPE_WIDTH_16_BITS ) && \
167+
( configTICK_TYPE_WIDTH_IN_BITS != TICK_TYPE_WIDTH_32_BITS ) && \
168+
( configTICK_TYPE_WIDTH_IN_BITS != TICK_TYPE_WIDTH_64_BITS ) )
169+
#error Macro configTICK_TYPE_WIDTH_IN_BITS is defined to incorrect value. See the Configuration section of the FreeRTOS API documentation for details.
109170
#endif
110171

111172
#ifndef INCLUDE_vTaskPrioritySet
@@ -195,7 +256,11 @@
195256
#endif
196257

197258
#ifndef INCLUDE_xTaskGetCurrentTaskHandle
198-
#define INCLUDE_xTaskGetCurrentTaskHandle 0
259+
#define INCLUDE_xTaskGetCurrentTaskHandle 1
260+
#endif
261+
262+
#if ( defined( configUSE_CO_ROUTINES ) && configUSE_CO_ROUTINES != 0 )
263+
#warning Co-routines have been removed from FreeRTOS-Kernel versions released after V10.5.1. You can view previous versions of the FreeRTOS Kernel at github.com/freertos/freertos-kernel/tree/V10.5.1 .
199264
#endif
200265

201266
#ifndef configUSE_DAEMON_TASK_STARTUP_HOOK
@@ -820,6 +885,10 @@
820885
#define portDONT_DISCARD
821886
#endif
822887

888+
#ifndef portNORETURN
889+
#define portNORETURN
890+
#endif
891+
823892
#ifndef configUSE_TIME_SLICING
824893
#define configUSE_TIME_SLICING 1
825894
#endif
@@ -930,12 +999,6 @@
930999
#endif
9311000

9321001
/* Sanity check the configuration. */
933-
#if ( configUSE_TICKLESS_IDLE != 0 )
934-
#if ( INCLUDE_vTaskSuspend != 1 )
935-
#error INCLUDE_vTaskSuspend must be set to 1 if configUSE_TICKLESS_IDLE is not set to 0
936-
#endif /* INCLUDE_vTaskSuspend */
937-
#endif /* configUSE_TICKLESS_IDLE */
938-
9391002
#if ( ( configSUPPORT_STATIC_ALLOCATION == 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 0 ) )
9401003
#error configSUPPORT_STATIC_ALLOCATION and configSUPPORT_DYNAMIC_ALLOCATION cannot both be 0, but can both be 1.
9411004
#endif
@@ -1059,6 +1122,12 @@
10591122
#define configENABLE_FPU 1
10601123
#endif
10611124

1125+
/* Set configENABLE_MVE to 1 to enable MVE support and 0 to disable it. This is
1126+
* currently used in ARMv8M ports. */
1127+
#ifndef configENABLE_MVE
1128+
#define configENABLE_MVE 0
1129+
#endif
1130+
10621131
/* Set configENABLE_TRUSTZONE to 1 enable TrustZone support and 0 to disable it.
10631132
* This is currently used in ARMv8M ports. */
10641133
#ifndef configENABLE_TRUSTZONE
@@ -1218,7 +1287,7 @@ typedef struct xSTATIC_TCB
12181287
#if ( configGENERATE_RUN_TIME_STATS == 1 )
12191288
configRUN_TIME_COUNTER_TYPE ulDummy16;
12201289
#endif
1221-
#if ( ( configUSE_NEWLIB_REENTRANT == 1 ) || ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) )
1290+
#if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 )
12221291
configTLS_BLOCK_TYPE xDummy17;
12231292
#endif
12241293
#if ( configUSE_TASK_NOTIFICATIONS == 1 )

src/FreeRTOSConfig.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* FreeRTOS Kernel V10.5.0
2+
* FreeRTOS Kernel V10.5.1+
33
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
44
*
55
* SPDX-License-Identifier: MIT
@@ -56,7 +56,7 @@
5656
#define configCHECK_FOR_STACK_OVERFLOW 1
5757

5858
#define configUSE_TRACE_FACILITY 0
59-
#define configUSE_16_BIT_TICKS 1
59+
#define configTICK_TYPE_WIDTH_IN_BITS TICK_TYPE_WIDTH_16_BITS
6060

6161
#define configUSE_MUTEXES 1
6262
#define configUSE_RECURSIVE_MUTEXES 1

src/FreeRTOSVariant.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2022 Phillip Stevens All Rights Reserved.
2+
* Copyright (C) 2023 Phillip Stevens All Rights Reserved.
33
*
44
* Permission is hereby granted, free of charge, to any person obtaining a copy of
55
* this software and associated documentation files (the "Software"), to deal in

src/History.txt

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
Changes between FreeRTOS V10.4.6 and FreeRTOS V10.5.0 released September 16 2022
2-
31
Documentation and download available at https://www.FreeRTOS.org/
42

3+
Changes between FreeRTOS V10.5.0 and FreeRTOS V10.5.1 released May 3 2023
4+
+ Updated the kernel version in manifest and SBOM
5+
+ Updates from repo, mainly typos and minor additions
6+
7+
Changes between FreeRTOS V10.4.6 and FreeRTOS V10.5.0 released September 16 2022
8+
59
+ Heap improvements:
610
- Add a check to heap_2 to track if a memory block is allocated to
711
the application or not. The MSB of the size field is used for this
@@ -23,11 +27,11 @@ Documentation and download available at https://www.FreeRTOS.org/
2327
The feature can be controlled by setting the configuration option
2428
configUSE_SB_COMPLETED_CALLBACK in FreeRTOSConfig.h. When the option is set to 1,
2529
APIs xStreamBufferCreateWithCallback() or xStreamBufferCreateStaticWithCallback()
26-
(and likewise APIs for message buffer) can be used to create a stream buffer
30+
(and likewise APIs for message buffer) can be used to create a stream buffer
2731
or message buffer instance with application provided callback overrides. When
2832
the option is set to 0, then the default callbacks as defined by
29-
sbSEND_COMPLETED() and sbRECEIVE_COMPLETED() macros are invoked. To maintain
30-
backwards compatibility, configUSE_SB_COMPLETED_CALLBACK defaults to 0. The
33+
sbSEND_COMPLETED() and sbRECEIVE_COMPLETED() macros are invoked. To maintain
34+
backwards compatibility, configUSE_SB_COMPLETED_CALLBACK defaults to 0. The
3135
functionality is currently not supported for MPU enabled ports.
3236
+ Generalize the FreeRTOS's Thread Local Storage (TLS) support so that it
3337
is not tied to newlib and can be used with other c-runtime libraries also.

src/atomic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* FreeRTOS Kernel V10.5.0
2+
* FreeRTOS Kernel V10.5.1+
33
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
44
*
55
* SPDX-License-Identifier: MIT

src/event_groups.c

Lines changed: 50 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* FreeRTOS Kernel V10.5.0
2+
* FreeRTOS Kernel V10.5.1+
33
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
44
*
55
* SPDX-License-Identifier: MIT
@@ -49,17 +49,22 @@
4949
/* The following bit fields convey control information in a task's event list
5050
* item value. It is important they don't clash with the
5151
* taskEVENT_LIST_ITEM_VALUE_IN_USE definition. */
52-
#if configUSE_16_BIT_TICKS == 1
52+
#if ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_16_BITS )
5353
#define eventCLEAR_EVENTS_ON_EXIT_BIT 0x0100U
5454
#define eventUNBLOCKED_DUE_TO_BIT_SET 0x0200U
5555
#define eventWAIT_FOR_ALL_BITS 0x0400U
5656
#define eventEVENT_BITS_CONTROL_BYTES 0xff00U
57-
#else
57+
#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_32_BITS )
5858
#define eventCLEAR_EVENTS_ON_EXIT_BIT 0x01000000UL
5959
#define eventUNBLOCKED_DUE_TO_BIT_SET 0x02000000UL
6060
#define eventWAIT_FOR_ALL_BITS 0x04000000UL
6161
#define eventEVENT_BITS_CONTROL_BYTES 0xff000000UL
62-
#endif
62+
#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_64_BITS )
63+
#define eventCLEAR_EVENTS_ON_EXIT_BIT 0x0100000000000000ULL
64+
#define eventUNBLOCKED_DUE_TO_BIT_SET 0x0200000000000000ULL
65+
#define eventWAIT_FOR_ALL_BITS 0x0400000000000000ULL
66+
#define eventEVENT_BITS_CONTROL_BYTES 0xff00000000000000ULL
67+
#endif /* if ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_16_BITS ) */
6368

6469
typedef struct EventGroupDef_t
6570
{
@@ -516,15 +521,15 @@ EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup,
516521

517522
EventBits_t xEventGroupGetBitsFromISR( EventGroupHandle_t xEventGroup )
518523
{
519-
UBaseType_t uxSavedInterruptStatus;
524+
BaseType_t xSavedInterruptStatus;
520525
EventGroup_t const * const pxEventBits = xEventGroup;
521526
EventBits_t uxReturn;
522527

523-
uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();
528+
xSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();
524529
{
525530
uxReturn = pxEventBits->uxEventBits;
526531
}
527-
portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );
532+
portCLEAR_INTERRUPT_MASK_FROM_ISR( xSavedInterruptStatus );
528533

529534
return uxReturn;
530535
} /*lint !e818 EventGroupHandle_t is a typedef used in other functions to so can't be pointer to const. */
@@ -533,7 +538,8 @@ EventBits_t xEventGroupGetBitsFromISR( EventGroupHandle_t xEventGroup )
533538
EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup,
534539
const EventBits_t uxBitsToSet )
535540
{
536-
ListItem_t * pxListItem, * pxNext;
541+
ListItem_t * pxListItem;
542+
ListItem_t * pxNext;
537543
ListItem_t const * pxListEnd;
538544
List_t const * pxList;
539545
EventBits_t uxBitsToClear = 0, uxBitsWaitedFor, uxControlBits;
@@ -671,6 +677,42 @@ void vEventGroupDelete( EventGroupHandle_t xEventGroup )
671677
}
672678
/*-----------------------------------------------------------*/
673679

680+
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
681+
BaseType_t xEventGroupGetStaticBuffer( EventGroupHandle_t xEventGroup,
682+
StaticEventGroup_t ** ppxEventGroupBuffer )
683+
{
684+
BaseType_t xReturn;
685+
EventGroup_t * pxEventBits = xEventGroup;
686+
687+
configASSERT( pxEventBits );
688+
configASSERT( ppxEventGroupBuffer );
689+
690+
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
691+
{
692+
/* Check if the event group was statically allocated. */
693+
if( pxEventBits->ucStaticallyAllocated == ( uint8_t ) pdTRUE )
694+
{
695+
*ppxEventGroupBuffer = ( StaticEventGroup_t * ) pxEventBits;
696+
xReturn = pdTRUE;
697+
}
698+
else
699+
{
700+
xReturn = pdFALSE;
701+
}
702+
}
703+
#else /* configSUPPORT_DYNAMIC_ALLOCATION */
704+
{
705+
/* Event group must have been statically allocated. */
706+
*ppxEventGroupBuffer = ( StaticEventGroup_t * ) pxEventBits;
707+
xReturn = pdTRUE;
708+
}
709+
#endif /* configSUPPORT_DYNAMIC_ALLOCATION */
710+
711+
return xReturn;
712+
}
713+
#endif /* configSUPPORT_STATIC_ALLOCATION */
714+
/*-----------------------------------------------------------*/
715+
674716
/* For internal use only - execute a 'set bits' command that was pended from
675717
* an interrupt. */
676718
void vEventGroupSetBitsCallback( void * pvEventGroup,

0 commit comments

Comments
 (0)