Define atomic macros for C++ project to fix nuttx/spinlock.h compilat… - #19754
Open
teamprof wants to merge 1 commit into
Open
Define atomic macros for C++ project to fix nuttx/spinlock.h compilat…#19754teamprof wants to merge 1 commit into
teamprof wants to merge 1 commit into
Conversation
acassis
approved these changes
Aug 8, 2026
Contributor
|
@xiaoxiang781216 PTAL |
cederom
requested changes
Aug 9, 2026
cederom
left a comment
Contributor
There was a problem hiding this comment.
Thank you @teamprof :-)
- Please fix the git commit according to https://nuttx.apache.org/docs/latest/contributing/guide.html#commit-requirements.
- Please fix minor code forma issue reported by ci/checkpatch (see https://nuttx.apache.org/docs/latest/contributing/coding_style.html).
- PR description does not seem to cover use case in NuttX, please update (specifically description + testing section).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Fail to build Pi Pico NuttX C++ project with SMP feature as <nuttx/spinlock.h> is a C header that uses raw macro calls (atomic_cmpxchg_acquire(...)).
Summary
Failed to build a Pi Pico C++ project with SMP enabled due to the missing atomic marcos for nuttx/spinlock.h
Define atomic macros for C++ project to fix nuttx/spinlock.h compilation issue
Impact
Failed to build a Pi Pico (RP2040) C++ project with the SMP feature enabled. Notably, robust SMP support on the RP2040 is a key feature that encourages developers to choose NuttX over other RTOS options.
Testing
Follow the steps on https://github.com/teamprof/arduprof-template/tree/main/pico-nuttx-app to create a C++ project:
git clone --recurse-submodules https://github.com/teamprof/arduprof-template.gif
cd arduprof-template/pico-nuttx-app
ln -s ../src apps/arduprof
cd nuttx
./tools/configure.sh -l ../src/boards/arm/rp2040/raspberrypi-pico/configs/smp
make
Launch a Serial Terminal and connect to Pico's GPIO0/1 at 115200bps
Run "arduprof" under nsh in the terminal
Before

After

minicom screenshot of running on Pi Pico
