From 653d5aad27e536b2d284ec6a8622672c3d093644 Mon Sep 17 00:00:00 2001 From: Vishwanath Martur <64204611+vishwamartur@users.noreply.github.com> Date: Fri, 1 Nov 2024 12:03:46 +0530 Subject: [PATCH 1/2] Fix SMP debugging issue on rp2040 Related to #1172 Add `multicore_reset_core1` before `multicore_launch_core1` in `xPortStartScheduler` function to fix debugging issue on rp2040 with SMP enabled. * Modify `portable/ThirdParty/GCC/RP2040/port.c` to include a call to `multicore_reset_core1` before `multicore_launch_core1` within the `#if portRUNNING_ON_BOTH_CORES` block. --- portable/ThirdParty/GCC/RP2040/port.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/portable/ThirdParty/GCC/RP2040/port.c b/portable/ThirdParty/GCC/RP2040/port.c index 6c5d0e5134f..bc1e60ad110 100644 --- a/portable/ThirdParty/GCC/RP2040/port.c +++ b/portable/ThirdParty/GCC/RP2040/port.c @@ -22,9 +22,6 @@ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * https://www.FreeRTOS.org - * https://github.com/FreeRTOS - * */ /*---------------------------------------------------------------------- @@ -378,6 +375,7 @@ void vPortStartFirstTask( void ) #if portRUNNING_ON_BOTH_CORES ucPrimaryCoreNum = configTICK_CORE; configASSERT( get_core_num() == 0 ); /* we must be started on core 0 */ + multicore_reset_core1(); multicore_launch_core1( prvDisableInterruptsAndPortStartSchedulerOnCore ); #else ucPrimaryCoreNum = get_core_num(); From 19168021010508f175b51b4d8991d0f413cda6dc Mon Sep 17 00:00:00 2001 From: ActoryOu Date: Fri, 1 Nov 2024 14:43:53 +0800 Subject: [PATCH 2/2] Recover comments back --- portable/ThirdParty/GCC/RP2040/port.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/portable/ThirdParty/GCC/RP2040/port.c b/portable/ThirdParty/GCC/RP2040/port.c index bc1e60ad110..78c11bd639b 100644 --- a/portable/ThirdParty/GCC/RP2040/port.c +++ b/portable/ThirdParty/GCC/RP2040/port.c @@ -22,6 +22,9 @@ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * https://www.FreeRTOS.org + * https://github.com/FreeRTOS + * */ /*----------------------------------------------------------------------