Go to examples/natmod/features0. Edit Makefile so the ARCH line reads
Code: Select all
ARCH = xtensawin
Copy the resultant features0.mpy to an ESP32.
At the REPL issue
Code: Select all
>>> import features0
Code: Select all
ARCH = xtensawin
Code: Select all
>>> import features0
Code: Select all
>>>
>>> import features0
>>> features0.
__class__ __name__ __file__ factorial
>>> features0.factorial(3)
6
>>>
Code: Select all
GEN build/features0.config.h
CC features0.c
LINK build/features0.o
arch: EM_XTENSA
text size: 104
rodata size: 8
bss size: 0
GOT entries: 3
GEN features0.mpy
Thanks, I saw that.tve wrote: ↑Fri Jan 15, 2021 5:14 amIf you're talking about dynamically loaded native modules, check out: https://github.com/micropython/micropython/issues/6769