diff --git a/FreeRTOS/Demo/ThirdParty/Community-Supported/CORTEX_M0+_RP2040/Standard_smp/CMakeLists.txt b/FreeRTOS/Demo/ThirdParty/Community-Supported/CORTEX_M0+_RP2040/Standard_smp/CMakeLists.txt index 1a760aaf41..adcef9164c 100644 --- a/FreeRTOS/Demo/ThirdParty/Community-Supported/CORTEX_M0+_RP2040/Standard_smp/CMakeLists.txt +++ b/FreeRTOS/Demo/ThirdParty/Community-Supported/CORTEX_M0+_RP2040/Standard_smp/CMakeLists.txt @@ -50,7 +50,7 @@ pico_add_extra_outputs(main_full_smp) # Use USB uart pico_enable_stdio_usb(main_full_smp 1) -pico_enable_stdio_uart(main_full_smp 0) +pico_enable_stdio_uart(main_full_smp 1) add_executable(main_blinky_smp main.c @@ -70,4 +70,4 @@ pico_add_extra_outputs(main_blinky_smp) # Use USB uart pico_enable_stdio_usb(main_blinky_smp 1) -pico_enable_stdio_uart(main_blinky_smp 0) +pico_enable_stdio_uart(main_blinky_smp 1) diff --git a/FreeRTOS/Demo/ThirdParty/Community-Supported/CORTEX_M0+_RP2040/Standard_smp/FreeRTOSConfig.h b/FreeRTOS/Demo/ThirdParty/Community-Supported/CORTEX_M0+_RP2040/Standard_smp/FreeRTOSConfig.h index 3025b3302e..60d9b6e624 100644 --- a/FreeRTOS/Demo/ThirdParty/Community-Supported/CORTEX_M0+_RP2040/Standard_smp/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/ThirdParty/Community-Supported/CORTEX_M0+_RP2040/Standard_smp/FreeRTOSConfig.h @@ -137,7 +137,6 @@ to exclude the API function. */ /* SMP Related config. */ #define configUSE_MINIMAL_IDLE_HOOK 0 -#define portCRITICAL_NESTING_IN_TCB 1 #define portSUPPORT_SMP 1 #endif /* FREERTOS_CONFIG_H */ diff --git a/FreeRTOS/Demo/ThirdParty/Community-Supported/CORTEX_M0+_RP2040/Standard_smp/IntQueueTimer.c b/FreeRTOS/Demo/ThirdParty/Community-Supported/CORTEX_M0+_RP2040/Standard_smp/IntQueueTimer.c index b902588b00..32fd7b73b0 100644 --- a/FreeRTOS/Demo/ThirdParty/Community-Supported/CORTEX_M0+_RP2040/Standard_smp/IntQueueTimer.c +++ b/FreeRTOS/Demo/ThirdParty/Community-Supported/CORTEX_M0+_RP2040/Standard_smp/IntQueueTimer.c @@ -47,17 +47,35 @@ possible on Cortex-M devices. */ void prvAlarm0Callback( uint timer ) { + UBaseType_t uxSavedInterruptState; + BaseType_t xHigherPriorityTaskWoken; + configASSERT(timer == 0); - BaseType_t xHigherPriorityTaskWoken = xFirstTimerHandler(); - hardware_alarm_set_target(0, make_timeout_time_us( FIRST_TIMER_PERIOD_US) ); + + uxSavedInterruptState = taskENTER_CRITICAL_FROM_ISR(); + { + xHigherPriorityTaskWoken = xFirstTimerHandler(); + hardware_alarm_set_target(0, make_timeout_time_us( FIRST_TIMER_PERIOD_US) ); + } + taskEXIT_CRITICAL_FROM_ISR( uxSavedInterruptState ); + portEND_SWITCHING_ISR(xHigherPriorityTaskWoken); } void prvAlarm1Callback( uint timer ) { + UBaseType_t uxSavedInterruptState; + BaseType_t xHigherPriorityTaskWoken; + configASSERT(timer == 1); - BaseType_t xHigherPriorityTaskWoken = xSecondTimerHandler(); - hardware_alarm_set_target(1, make_timeout_time_us( SECOND_TIMER_PERIOD_US) ); + + uxSavedInterruptState = taskENTER_CRITICAL_FROM_ISR(); + { + xHigherPriorityTaskWoken = xSecondTimerHandler(); + hardware_alarm_set_target(1, make_timeout_time_us( SECOND_TIMER_PERIOD_US) ); + } + taskEXIT_CRITICAL_FROM_ISR( uxSavedInterruptState ); + portEND_SWITCHING_ISR(xHigherPriorityTaskWoken); } diff --git a/FreeRTOS/Demo/ThirdParty/Community-Supported/CORTEX_M0+_RP2040/Standard_smp/main.h b/FreeRTOS/Demo/ThirdParty/Community-Supported/CORTEX_M0+_RP2040/Standard_smp/main.h index a08409ef80..71f81ba2e4 100644 --- a/FreeRTOS/Demo/ThirdParty/Community-Supported/CORTEX_M0+_RP2040/Standard_smp/main.h +++ b/FreeRTOS/Demo/ThirdParty/Community-Supported/CORTEX_M0+_RP2040/Standard_smp/main.h @@ -30,36 +30,30 @@ #define mainRUN_ON_CORE 0 - /* These tests should work in all modes */ #define mainENABLE_COUNTING_SEMAPHORE 1 #define mainENABLE_DEATH 1 - -/* TODO: This still seems flaky on SMP */ -#if ( portSUPPORT_SMP == 0) - #define mainENABLE_INTERRUPT_QUEUE 1 -#endif +#define mainENABLE_INTERRUPT_QUEUE 1 #define mainENABLE_MATH 1 #define mainENABLE_QUEUE_OVERWRITE 1 #define mainENABLE_REG_TEST 1 #define mainENABLE_SEMAPHORE 1 #define mainENABLE_TASK_NOTIFY 1 -#if configNUMBER_OF_CORES != 2 || configRUN_MULTIPLE_PRIORITIES == 0 - -/* These tests assume that a higher priority task will block a lower priority tax from running */ -#define mainENABLE_BLOCK_TIME 1 -#define mainENABLE_BLOCKING_QUEUE 1 -#define mainENABLE_GENERIC_QUEUE 1 -#define mainENABLE_INTERRUPT_SEMAPHORE 1 -#define mainENABLE_EVENT_GROUP 1 -#define mainENABLE_RECURSIVE_MUTEX 1 -#define mainENABLE_TIMER_DEMO 1 +#if ( configNUMBER_OF_CORES == 1 ) || ( configRUN_MULTIPLE_PRIORITIES == 0 ) + /* These tests assume that a higher priority task will block a lower priority tax from running */ + #define mainENABLE_BLOCK_TIME 1 + #define mainENABLE_BLOCKING_QUEUE 1 + #define mainENABLE_GENERIC_QUEUE 1 + #define mainENABLE_INTERRUPT_SEMAPHORE 1 + #define mainENABLE_EVENT_GROUP 1 + #define mainENABLE_RECURSIVE_MUTEX 1 + #define mainENABLE_TIMER_DEMO 1 #endif -#if configNUMBER_OF_CORES != 2 -/* This test just expects two tasks not to run concurrently */ -#define mainENABLE_DYNAMIC_PRIORITY 1 +#if ( configNUMBER_OF_CORES == 1 ) + /* This test just expects two tasks not to run concurrently */ + #define mainENABLE_DYNAMIC_PRIORITY 1 #endif #endif /* MAIN_H */ \ No newline at end of file diff --git a/FreeRTOS/Source b/FreeRTOS/Source index 21d9a61c93..161a2c7d5c 160000 --- a/FreeRTOS/Source +++ b/FreeRTOS/Source @@ -1 +1 @@ -Subproject commit 21d9a61c93d8d0d5895ed743464d68d4335b0927 +Subproject commit 161a2c7d5c4c9cf52bacdb2f45daf00a4b7d6a72