Skip to content

Conversation

@sumpfralle
Copy link
Contributor

Summary

Previously only up to 31 PIO instructions were accepted. But the hardware allowed 32 instructions.

Now we accept 32 instructions.

See the corresponding commit in the pico-sdk repository.

Impact

Calling rp2040_pio_add_program with a PIO program containing 32 instructions previously ended in a panic state (DEBUGPANIC).

Now 32 instructions are accepted.

Testing

Uploading my application with 32 PIO instructions previously froze the device (rp2040).

Now uploading 32 PIO instructions succeeds.

No further testing was conducted with rp23xx or rp23xx-rv devices.
But the upstream code (pico-sdk) uses the same assert for all three device groups. Thus, the change should be suitable for all platforms.

@sumpfralle sumpfralle requested a review from jerpelea as a code owner December 15, 2025 13:51
@github-actions github-actions bot added Arch: arm Issues related to ARM (32-bit) architecture Arch: risc-v Issues related to the RISC-V (32-bit or 64-bit) architecture Size: XS The size of the change in this PR is very small labels Dec 15, 2025
Previously only up to 31 PIO instructions were accepted.
But the hardware allowed 32 instructions.

Now we accept 32 instructions.

See the corresponding commit in the pico-sdk repository:

  raspberrypi/pico-sdk@6f7dc67

Signed-off-by: Lars Kruse <devel@sumpfralle.de>
@sumpfralle sumpfralle force-pushed the arm-rp2xxx-pio-fix-32-instructions branch from 6a04bb4 to 9f74074 Compare December 15, 2025 13:52
@acassis
Copy link
Contributor

acassis commented Dec 15, 2025

@sumpfralle I found an issue this weekend when I compiled the raspberrypi-pico board without exporting PICO_SDK_PATH. The compilation went fine, but the final binary doesn't start the board.

In the past the build-system stops when PICO_SDK_PATH is not defined, but seems like someone remove the needs for it, but now the binary doesn't work. Exporting the PICO_SDK_PATH and compiling again fixes the issue.

Did you notice this issue?

@simbit18
Copy link
Contributor

simbit18 commented Dec 15, 2025

Hi @acassis , does this also occur with CMake?

perhaps it is related to this change here #16855
https://github.com/apache/nuttx/blob/master/tools/rp2040/Config.mk

@acassis
Copy link
Contributor

acassis commented Dec 15, 2025

Hi @acassis , does this also occur with CMake?

No idea, I didn't try CMake, but I can try now and let you know

@acassis
Copy link
Contributor

acassis commented Dec 15, 2025

Hi @acassis , does this also occur with CMake?

No idea, I didn't try CMake, but I can try now and let you know

CMake is not working here:

$ cmake -B build -DBOARD_CONFIG=raspberrypi-pico:usbnsh -GNinja
CMake Error at CMakeLists.txt:96 (message):
Kconfig environment depends on kconfiglib, Please install:

(APT source)
  $ sudo apt install python3-kconfiglib
or (pip source)
  $ pip install kconfiglib
or (After Ubuntu 24.04)
  $ pip install kconfiglib --break-system-packages

$ sudo apt install python3-kconfiglib
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3-kconfiglib is already the newest version (14.1.0-3).

@simbit18
Copy link
Contributor

simbit18 commented Dec 15, 2025

(APT source)
  $ sudo apt install python3-kconfiglib
or (pip source)
  $ pip install kconfiglib
or (After Ubuntu 24.04)
  $ pip install kconfiglib --break-system-packages

Hi @acassis , but that's another problem :)

remove

sudo apt remove package_name

try with pip

pip install kconfiglib

@acassis
Copy link
Contributor

acassis commented Dec 15, 2025

(APT source)
  $ sudo apt install python3-kconfiglib
or (pip source)
  $ pip install kconfiglib
or (After Ubuntu 24.04)
  $ pip install kconfiglib --break-system-packages

Hi @acassis , but that's another problem :)

Yes, seems like the build system is not detecting that python3-kconfiglib is installed in my system (Ubuntu 24.04)

Copy link
Contributor

@cederom cederom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @sumpfralle :-)

@simbit18 simbit18 merged commit ec906cf into apache:master Dec 15, 2025
40 checks passed
@acassis
Copy link
Contributor

acassis commented Dec 15, 2025

@simbit18 in the CMake the issue doesn't happen because it is detecting that the export is missing:

CMake Error at arch/arm/src/rp2040/CMakeLists.txt:100 (message):
PICO_SDK_PATH environment variable is not set. Please set it to the path
of your Pico SDK installation.

It is a regression in the Makefile build system, it was working in the past

@acassis
Copy link
Contributor

acassis commented Dec 15, 2025

I opened an issue to track it: #17516

@cederom
Copy link
Contributor

cederom commented Dec 15, 2025

I noticed that too some time ago but thought it was issue on my end, thanks @acassis !! :-)

@acassis
Copy link
Contributor

acassis commented Dec 15, 2025

I noticed that too some time ago but thought it was issue on my end, thanks @acassis !! :-)

Yes, initially I thought someone broke the mainline, then I compiled with the export and everything worked fine.

Actually it should be nice to have raspberrypi-pico working without needing the SDK. NuttX needs to work without attachments!

@sumpfralle sumpfralle deleted the arm-rp2xxx-pio-fix-32-instructions branch December 16, 2025 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: arm Issues related to ARM (32-bit) architecture Arch: risc-v Issues related to the RISC-V (32-bit or 64-bit) architecture Size: XS The size of the change in this PR is very small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants