Skip to content

Fx natmod support & enable on Raspberry Pi Pico#11112

Open
jepler wants to merge 7 commits into
adafruit:mainfrom
jepler:natmod-fixes
Open

Fx natmod support & enable on Raspberry Pi Pico#11112
jepler wants to merge 7 commits into
adafruit:mainfrom
jepler:natmod-fixes

Conversation

@jepler

@jepler jepler commented Jul 12, 2026

Copy link
Copy Markdown

These have been broken for a long time but let's fix them.

With these changes, I can locally use the features1 loadable native module in the Unix coverage port:

Adafruit CircuitPython 10.3.0-alpha.3-23-ge94f0f5f20-dirty on 2026-07-12; linux [GCC 14.2.0] version
>>> import features1
initialising module self=0x7f03df9f9be0
>>> features1.
add             MSG             VAL             access
fibonacci       make_array
>>> features1.fibonacci(12)
144
>>> features1.add(3, 7)
10

With this change, I can also load and use the "features1" module
on a Raspberry Pi Pico board:

features1 must be built like so:

make ARCH=armv6m

then once copied to the device,

Adafruit CircuitPython 10.3.0-alpha.3-26-g4c4e6b00ad-dirty
 on 2026-07-12; Raspberry Pi Pico with rp2040
>>> import features1
initialising module self=0x200125b0
>>> [features1.fibonacci(i) for i in range(12)]
[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]

jepler added 6 commits July 12, 2026 13:51
These have been broken for a long time but let's fix them.
With this, it is now possible to build & load the "features1"
natmod test in the Unix coverage build and call its functions.
This will need to be tweaked, as some of the tests fail.
But it'll be needed in order to eventually test natmod at build
time.
With this change, I can load and use the "features1" module
on a Raspberry Pi Pico board:

```
Adafruit CircuitPython 10.3.0-alpha.3-26-g4c4e6b00ad-dirty
 on 2026-07-12; Raspberry Pi Pico with rp2040
>>> import features1
initialising module self=0x200125b0
>>> [features1.fibonacci(i) for i in range(12)]
[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
```

features1 can be built like so:
```
make ARCH=armv6m
```
@jepler jepler changed the title Start to fix natmod support Fx natmod support & enable on Raspberry Pi Pico Jul 12, 2026
@jepler

jepler commented Jul 12, 2026

Copy link
Copy Markdown
Author

happy to negotiate on whether to enable this on pi pico (that commit is easy to rebase out) but it's the board where I wanted it.

@jepler jepler marked this pull request as ready for review July 12, 2026 21:41
@jepler jepler requested a review from dhalbert July 12, 2026 21:41
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.

1 participant