Skip to content

Commit e0882da

Browse files
Merge branch 'main' into stm32-networkinterface-bugfixes
2 parents 9402542 + f7f7b9d commit e0882da

File tree

23 files changed

+207
-108
lines changed

23 files changed

+207
-108
lines changed

.github/.cSpellWords.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ ACTLR
77
ADDAR
88
ADDRH
99
ADDRL
10+
ADIN
1011
AFECR
1112
AFSR
1213
AFVALID

.github/workflows/release-candidate.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
description: 'Release Version Number (Eg, v1.0.0-rc1)'
1111
required: true
1212

13+
# Workflow permissions block
14+
permissions:
15+
contents: write # This grants write access to repository content, including pushing commits/tags and creating releases.
16+
1317
jobs:
1418
tag-commit:
1519
name: Tag commit

.github/workflows/release.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
description: 'Release Version Number (Eg, v1.0.0)'
1111
required: true
1212

13+
# Workflow permissions block
14+
permissions:
15+
contents: write # This grants write access to repository content, including pushing commits/tags and creating releases.
16+
1317
jobs:
1418
tag-commit:
1519
name: Tag commit
@@ -140,6 +144,8 @@ jobs:
140144
ref: ${{ github.event.inputs.version_number }}
141145
add_release: "true"
142146
create-release:
147+
permissions:
148+
id-token: write
143149
needs:
144150
- create-zip
145151
- deploy-doxygen
@@ -171,6 +177,11 @@ jobs:
171177
asset_path: ./FreeRTOS-Plus-TCP-${{ github.event.inputs.version_number }}.zip
172178
asset_name: FreeRTOS-Plus-TCP-${{ github.event.inputs.version_number }}.zip
173179
asset_content_type: application/zip
180+
- name: Backup Release Asset
181+
uses: FreeRTOS/CI-CD-Github-Actions/artifact-backup@main
182+
with:
183+
artifact_path: ./FreeRTOS-Plus-TCP-${{ github.event.inputs.version_number }}.zip
184+
release_tag: ${{ github.event.inputs.version_number }}
174185
cleanup:
175186
needs:
176187
- create-release

source/FreeRTOS_DNS_Parser.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@
262262
uint16_t x;
263263
BaseType_t xReturn = pdTRUE;
264264
uint32_t ulIPAddress = 0U;
265-
BaseType_t xDNSHookReturn;
265+
BaseType_t xDNSHookReturn = 0U;
266266

267267
( void ) memset( &( xSet ), 0, sizeof( xSet ) );
268268
xSet.usPortNumber = usPort;

source/FreeRTOS_IP.c

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,13 +1016,28 @@ BaseType_t FreeRTOS_IPInit_Multi( void )
10161016
{
10171017
static StaticTask_t xIPTaskBuffer;
10181018
static StackType_t xIPTaskStack[ ipconfigIP_TASK_STACK_SIZE_WORDS ];
1019-
xIPTaskHandle = xTaskCreateStatic( &prvIPTask,
1020-
"IP-Task",
1021-
ipconfigIP_TASK_STACK_SIZE_WORDS,
1022-
NULL,
1023-
ipconfigIP_TASK_PRIORITY,
1024-
xIPTaskStack,
1025-
&xIPTaskBuffer );
1019+
#if ( ipconfigIP_TASK_AFFINITY > 0 )
1020+
{
1021+
xIPTaskHandle = xTaskCreateStaticAffinitySet( &prvIPTask,
1022+
"IP-Task",
1023+
ipconfigIP_TASK_STACK_SIZE_WORDS,
1024+
NULL,
1025+
ipconfigIP_TASK_PRIORITY,
1026+
xIPTaskStack,
1027+
&xIPTaskBuffer,
1028+
ipconfigIP_TASK_AFFINITY );
1029+
}
1030+
#else /* if ( ipconfigIP_TASK_AFFINITY ) */
1031+
{
1032+
xIPTaskHandle = xTaskCreateStatic( &prvIPTask,
1033+
"IP-Task",
1034+
ipconfigIP_TASK_STACK_SIZE_WORDS,
1035+
NULL,
1036+
ipconfigIP_TASK_PRIORITY,
1037+
xIPTaskStack,
1038+
&xIPTaskBuffer );
1039+
}
1040+
#endif /* ipconfigIP_TASK_AFFINITY */
10261041

10271042
if( xIPTaskHandle != NULL )
10281043
{
@@ -1031,12 +1046,26 @@ BaseType_t FreeRTOS_IPInit_Multi( void )
10311046
}
10321047
#else /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
10331048
{
1034-
xReturn = xTaskCreate( &prvIPTask,
1035-
"IP-task",
1036-
ipconfigIP_TASK_STACK_SIZE_WORDS,
1037-
NULL,
1038-
ipconfigIP_TASK_PRIORITY,
1039-
&( xIPTaskHandle ) );
1049+
#if ( ipconfigIP_TASK_AFFINITY > 0 )
1050+
{
1051+
xReturn = xTaskCreateAffinitySet( &prvIPTask,
1052+
"IP-task",
1053+
ipconfigIP_TASK_STACK_SIZE_WORDS,
1054+
NULL,
1055+
ipconfigIP_TASK_PRIORITY,
1056+
ipconfigIP_TASK_AFFINITY,
1057+
&( xIPTaskHandle ) );
1058+
}
1059+
#else /* if ( ipconfigIP_TASK_AFFINITY ) */
1060+
{
1061+
xReturn = xTaskCreate( &prvIPTask,
1062+
"IP-task",
1063+
ipconfigIP_TASK_STACK_SIZE_WORDS,
1064+
NULL,
1065+
ipconfigIP_TASK_PRIORITY,
1066+
&( xIPTaskHandle ) );
1067+
}
1068+
#endif /* ipconfigIP_TASK_AFFINITY */
10401069
}
10411070
#endif /* configSUPPORT_STATIC_ALLOCATION */
10421071
}

source/FreeRTOS_IPv4.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282

8383
/* Map the buffer onto a IP-Packet struct to easily access the
8484
* fields of the IP packet. */
85-
const IPPacket_t * const pxIPPacket = ( ( const IPPacket_t * const ) pvEthernetBuffer );
85+
const IPPacket_t * const pxIPPacket = ( ( const IPPacket_t * ) pvEthernetBuffer );
8686

8787
DEBUG_DECLARE_TRACE_VARIABLE( BaseType_t, xLocation, 0 );
8888

source/FreeRTOS_IPv6.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ const struct xIPv6_Address FreeRTOS_in6addr_loopback = { { 0U, 0U, 0U, 0U, 0U, 0
9999
size_t uxMinimumLength;
100100
size_t uxExtHeaderLength = 0;
101101
const IPExtHeader_IPv6_t * pxExtHeader = NULL;
102-
const uint8_t * const pucEthernetBuffer = ( const uint8_t * const ) pvEthernetBuffer;
102+
const uint8_t * const pucEthernetBuffer = ( const uint8_t * ) pvEthernetBuffer;
103103

104104
/* Map the buffer onto a IPv6-Packet struct to easily access the
105105
* fields of the IPv6 packet. */
106-
const IPPacket_IPv6_t * const pxIPv6Packet = ( const IPPacket_IPv6_t * const ) pucEthernetBuffer;
106+
const IPPacket_IPv6_t * const pxIPv6Packet = ( const IPPacket_IPv6_t * ) pucEthernetBuffer;
107107

108108
DEBUG_DECLARE_TRACE_VARIABLE( BaseType_t, xLocation, 0 );
109109

source/FreeRTOS_ND.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,6 @@
9797
/** @brief The ND cache. */
9898
static NDCacheRow_t xNDCache[ ipconfigND_CACHE_ENTRIES ];
9999

100-
/** @brief The time at which the last unsolicited ND was sent. Unsolicited NDs are used
101-
* to ensure ND tables are up to date and to detect IP address conflicts. */
102-
/* MISRA Ref 8.9.1 [File scoped variables] */
103-
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/MISRA.md#rule-89 */
104-
/* coverity[misra_c_2012_rule_8_9_violation] */
105-
static TickType_t xLastUnsolicitedNDTime = 0U;
106100

107101
/*-----------------------------------------------------------*/
108102

@@ -1405,19 +1399,4 @@
14051399
}
14061400

14071401
/*-----------------------------------------------------------*/
1408-
1409-
/**
1410-
* @brief Send an unsolicited ND packet to allow this node to announce the IP-MAC
1411-
* mapping to the entire network.
1412-
*/
1413-
void vNDSendUnsolicited( void )
1414-
{
1415-
/* Setting xLastUnsolicitedNDTime to 0 will force an unsolicited ND the next
1416-
* time vNDAgeCache() is called. */
1417-
xLastUnsolicitedNDTime = ( TickType_t ) 0;
1418-
1419-
/* Let the IP-task call vARPAgeCache(). */
1420-
( void ) xSendEventToIPTask( eNDTimerEvent );
1421-
}
1422-
/*-----------------------------------------------------------*/
14231402
#endif /* ipconfigUSE_IPv6 */

source/FreeRTOS_RA.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -329,12 +329,14 @@
329329

330330
case ndICMP_MTU_OPTION: /* 5 */
331331
{
332-
uint32_t ulMTU;
333-
( void ) ulMTU;
334-
335-
/* ulChar2u32 returns host-endian numbers. */
336-
ulMTU = ulChar2u32( &( pucBytes[ uxIndex + 4U ] ) );
337-
FreeRTOS_printf( ( "RA: MTU = %u\n", ( unsigned int ) ulMTU ) );
332+
#if ipconfigHAS_PRINTF == 1
333+
uint32_t ulMTU;
334+
( void ) ulMTU;
335+
336+
/* ulChar2u32 returns host-endian numbers. */
337+
ulMTU = ulChar2u32( &( pucBytes[ uxIndex + 4U ] ) );
338+
FreeRTOS_printf( ( "RA: MTU = %u\n", ( unsigned int ) ulMTU ) );
339+
#endif /* ipconfigHAS_PRINTF == 1 */
338340
}
339341
break;
340342

source/include/FreeRTOSIPConfigDefaults.h

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,6 +1139,46 @@ STATIC_ASSERT( pdMS_TO_TICKS( ipconfigPHY_LS_LOW_CHECK_TIME_MS ) <= portMAX_DELA
11391139

11401140
/*---------------------------------------------------------------------------*/
11411141

1142+
/*
1143+
* ipconfigIP_TASK_AFFINITY
1144+
*
1145+
* https://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_IP_Configuration.html#ipconfigIP_TASK_AFFINITY
1146+
*
1147+
* Type: UBaseType_t
1148+
* Unit: task affinity
1149+
* Minimum: 0
1150+
* Maximum: (2 ^ configNUMBER_OF_CORES) - 1
1151+
*
1152+
* When running using a SMP kernel, task affinity can be used to prevent
1153+
* concurrent execution of code that does not fully support SMP. Until
1154+
* the TCP library and ports fully supports SMP, it is necessary to set
1155+
* the affinity of all tasks which use TCP functions to the same core in
1156+
* order to prevent concurrent execution.
1157+
*
1158+
* An alternative to setting task affinity is to set configRUN_MULTIPLE_PRIORITIES
1159+
* to 0.
1160+
*
1161+
* Task affinity is defined as shifting a bit by the core number.
1162+
*
1163+
* Example:
1164+
* (1U << 0U) //run only on core 0
1165+
* (1U << 1U) //run only on core 1
1166+
*/
1167+
1168+
#ifndef ipconfigIP_TASK_AFFINITY
1169+
#define ipconfigIP_TASK_AFFINITY ( 0 )
1170+
#endif
1171+
1172+
#if ( ipconfigIP_TASK_AFFINITY < 0 )
1173+
#error ipconfigIP_TASK_AFFINITY must be at least 0
1174+
#endif
1175+
1176+
#if ( ipconfigIP_TASK_AFFINITY > 0 && configUSE_CORE_AFFINITY == 0 )
1177+
#error configUSE_CORE_AFFINITY must be 1 in order to use ipconfigIP_TASK_AFFINITY
1178+
#endif
1179+
1180+
/*---------------------------------------------------------------------------*/
1181+
11421182
/*
11431183
* ipconfigIP_TASK_STACK_SIZE_WORDS
11441184
*

0 commit comments

Comments
 (0)