Skip to content

Commit 99b32b8

Browse files
Update to latest FreeRTOS main, not SMP branch (earlephilhower#2250)
FreeRTOS has merged the SMP branch into its main, so move to that and adjust the core accordingly. V11.1.0 + several minor edits.
1 parent 9124056 commit 99b32b8

File tree

5 files changed

+41
-17
lines changed

5 files changed

+41
-17
lines changed
Submodule FreeRTOS-Kernel updated 836 files

libraries/FreeRTOS/src/FreeRTOSConfig.h

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
#define configNUM_CORES 2
2-
#define configUSE_CORE_AFFINITY 1
3-
#define configRUN_MULTIPLE_PRIORITIES 1
1+
#define configNUMBER_OF_CORES 2
2+
#define configUSE_CORE_AFFINITY 1
3+
#define configRUN_MULTIPLE_PRIORITIES 1
44

55
#define configUSE_PREEMPTION 1
66
#define configUSE_IDLE_HOOK 1
7-
#define configUSE_MINIMAL_IDLE_HOOK 1
7+
#define configUSE_PASSIVE_IDLE_HOOK 1
88
#define configUSE_TICK_HOOK 1
99
#define configCPU_CLOCK_HZ ( ( unsigned long ) F_CPU )
1010
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
@@ -38,7 +38,7 @@ extern unsigned long ulMainGetRunTimeCounterValue(void);
3838
#define portGET_RUN_TIME_COUNTER_VALUE() ulMainGetRunTimeCounterValue()
3939

4040
/* Co-routine definitions. */
41-
#define configUSE_CO_ROUTINES 1
41+
#define configUSE_CO_ROUTINES 0
4242
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
4343

4444
/* Software timer definitions. */
@@ -99,12 +99,21 @@ extern unsigned long ulMainGetRunTimeCounterValue(void);
9999
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
100100
#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
101101

102-
extern void rtosFatalError(void);
102+
#ifdef __cplusplus
103+
extern "C" {
104+
#endif
105+
void rtosFatalError(void);
106+
#ifdef __cplusplus
107+
};
108+
#endif
109+
103110
#define configASSERT( x ) \
104111
if( ( x ) == 0 ) { portDISABLE_INTERRUPTS(); rtosFatalError(); }
105112

106113
#define configUSE_DYNAMIC_EXCEPTION_HANDLERS 0
107114
#define configSUPPORT_PICO_SYNC_INTEROP 1
108115
#define configSUPPORT_PICO_TIME_INTEROP 1
109116

117+
#define LIB_PICO_MULTICORE 1
118+
110119
#include "rp2040_config.h"

libraries/FreeRTOS/src/idle_task_static_memory.c

Lines changed: 0 additions & 1 deletion
This file was deleted.

libraries/FreeRTOS/src/tasks.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "../lib/FreeRTOS-Kernel/tasks.c"
22

3-
//See https://github.com/FreeRTOS/FreeRTOS-Kernel/pull/496
3+
// See https://github.com/FreeRTOS/FreeRTOS-Kernel/pull/496
44
struct _reent* __wrap___getreent(void) {
55
// No lock needed because if this changes, we won't be running anymore.
66
TCB_t *pxCurTask = xTaskGetCurrentTaskHandle();
@@ -9,6 +9,6 @@ struct _reent* __wrap___getreent(void) {
99
return _GLOBAL_REENT;
1010
} else {
1111
// We have a task; return its reentrant struct.
12-
return &pxCurTask->xNewLib_reent;
12+
return &pxCurTask->xTLSBlock;
1313
}
1414
}

libraries/FreeRTOS/src/variantHooks.cpp

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ void vApplicationIdleHook(void) {
258258
#endif /* configUSE_IDLE_HOOK == 1 */
259259
/*-----------------------------------------------------------*/
260260

261-
#if ( configUSE_MINIMAL_IDLE_HOOK == 1 )
261+
//#if ( configUSE_MINIMAL_IDLE_HOOK == 1 )
262262
/*
263263
Call the user defined minimalIdle() function from within the idle task.
264264
This allows the application designer to add background functionality
@@ -267,17 +267,17 @@ void vApplicationIdleHook(void) {
267267
NOTE: vApplicationMinimalIdleHook() MUST NOT, UNDER ANY CIRCUMSTANCES, CALL A FUNCTION THAT MIGHT BLOCK.
268268
269269
*/
270-
void minimalIdle(void) __attribute__((weak));
271-
void minimalIdle() {} //Empty minimalIdle function
270+
void passiveIdle(void) __attribute__((weak));
271+
void passiveIdle() {} //Empty minimalIdle function
272272

273273
extern "C"
274-
void vApplicationMinimalIdleHook(void) __attribute__((weak));
274+
//void vApplicationPassiveIdleHook(void) __attribute__((weak));
275275

276-
void vApplicationMinimalIdleHook(void) {
277-
minimalIdle();
276+
void vApplicationPassiveIdleHook(void) {
277+
passiveIdle();
278278
}
279279

280-
#endif /* configUSE_MINIMAL_IDLE_HOOK == 1 */
280+
//#endif /* configUSE_MINIMAL_IDLE_HOOK == 1 */
281281
/*-----------------------------------------------------------*/
282282

283283
#if ( configUSE_TICK_HOOK == 1 )
@@ -394,6 +394,22 @@ void vApplicationStackOverflowHook(TaskHandle_t xTask __attribute__((unused)),
394394
#endif /* configCHECK_FOR_STACK_OVERFLOW >= 1 */
395395
/*-----------------------------------------------------------*/
396396

397+
398+
399+
extern "C" void vApplicationGetPassiveIdleTaskMemory(StaticTask_t ** ppxIdleTaskTCBBuffer,
400+
StackType_t ** ppxIdleTaskStackBuffer,
401+
configSTACK_DEPTH_TYPE * puxIdleTaskStackSize,
402+
BaseType_t xPassiveIdleTaskIndex) {
403+
static StaticTask_t xIdleTaskTCBs[ configNUMBER_OF_CORES ];
404+
static StackType_t uxIdleTaskStacks[ configNUMBER_OF_CORES ][ configMINIMAL_STACK_SIZE ];
405+
406+
*ppxIdleTaskTCBBuffer = &(xIdleTaskTCBs[ xPassiveIdleTaskIndex ]);
407+
*ppxIdleTaskStackBuffer = &(uxIdleTaskStacks[ xPassiveIdleTaskIndex ][ 0 ]);
408+
*puxIdleTaskStackSize = configMINIMAL_STACK_SIZE;
409+
}
410+
411+
412+
397413
#if ( configSUPPORT_STATIC_ALLOCATION >= 1 )
398414

399415
extern "C"

0 commit comments

Comments
 (0)