Skip to content

Conversation

@mike919192
Copy link
Contributor

RP2040 Port: Add missing include to fix SMP kernel compile errors

Description

This changes adds a missing include to fix kernel compile errors described in #1354 .

The definitions configSMP_SPINLOCK_0 and configSMP_SPINLOCK_1 are defined in rp2040_config.h. The definitions are used in portmacro.h but that file was missing #include "rp2040_config.h"

An example of one of the compile errors:

In file included from C:/repos/blink/build/_deps/freertos_kernel-src/include/portable.h:53,
                 from C:/repos/blink/build/_deps/freertos_kernel-src/include/FreeRTOS.h:118,
                 from C:/repos/blink/build/_deps/freertos_kernel-src/tasks.c:39:
C:/repos/blink/build/_deps/freertos_kernel-src/tasks.c: In function 'prvCheckForRunStateChange':
C:/repos/blink/build/_deps/freertos_kernel-src/portable/ThirdParty/GCC/RP2040/include/portmacro.h:264:105: error: 'configSMP_SPINLOCK_0' undeclared (first use in this function)
  264 |     #define portRELEASE_ISR_LOCK( xCoreID )     vPortRecursiveLock( ( xCoreID ), 0, spin_lock_instance( configSMP_SPINLOCK_0 ), pdFALSE )
      |                                                                                                         ^~~~~~~~~~~~~~~~~~~~
C:/repos/blink/build/_deps/freertos_kernel-src/tasks.c:850:17: note: in expansion of macro 'portRELEASE_ISR_LOCK'
  850 |                 portRELEASE_ISR_LOCK( xCoreID );
      |                 ^~~~~~~~~~~~~~~~~~~~

Test Steps

After adding the missing include, a simple project with 2 tasks, one pinned to each core compiles and runs. Verified with a debugger that both cores are running and the correct task is running on each core.

Checklist:

  • I have tested my changes. No regression in existing tests.
  • I have modified and/or added unit-tests to cover the code changes in this Pull Request.

Related Issue

#1354

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@sonarqubecloud
Copy link

@moninom1 moninom1 enabled auto-merge (squash) January 18, 2026 18:29
@moninom1 moninom1 merged commit 67f59a5 into FreeRTOS:main Jan 18, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants