Page 1 of 1
Do native modules work on ESP32?
Posted: Sun Dec 20, 2020 4:18 pm
by pythoncoder
I have these working fine on STM but am getting no joy on ESP32. I'm new to compiling ESP32 so am unsure if the problem is my toolchain. Please could someone with a working toolchain try this and report the outcome.
Go to
examples/natmod/features0. Edit
Makefile so the ARCH line reads
Issue
make.
Copy the resultant
features0.mpy to an ESP32.
At the REPL issue
I get a crash, even after erasing flash and installing a new build (IDF3 or IDF4).
Re: Do native modules work on ESP32?
Posted: Mon Dec 28, 2020 12:48 pm
by mattyt
(In a very brief response to quickly asking him, Damien tells me that native modules should work on the ESP32. Sorry, I don't know much more!)
Re: Do native modules work on ESP32?
Posted: Mon Dec 28, 2020 4:12 pm
by Mike Teachman
Hi Peter, this example worked on my ESP32 SPIRAM build.
Build info:
- rebased to the mainline at commit 5a70279 (Nov 23, 2020)
- environment is Win10/WSL2/Ubuntu
- ESP-IDF v3.3.2
I attached the mpy file
Code: Select all
>>>
>>> import features0
>>> features0.
__class__ __name__ __file__ factorial
>>> features0.factorial(3)
6
>>>
build msgs:
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
Re: Do native modules work on ESP32?
Posted: Mon Dec 28, 2020 6:16 pm
by pythoncoder
Thanks both. @Mike Teachman your file imports and runs on my board so there is evidently something wrong with my toolchain. I'll investigate - despite going the Docker route I must have got something wrong. It's odd that compilation seemed successful.
Re: Do native modules work on ESP32?
Posted: Fri Jan 15, 2021 5:14 am
by tve
If you're talking about dynamically loaded native modules, check out:
https://github.com/micropython/micropython/issues/6769
Re: Do native modules work on ESP32?
Posted: Fri Jan 15, 2021 9:05 am
by pythoncoder
Thanks, I saw that.
My current state of play is that I can now build and run the
features0 demo. However my own module, which builds and runs on STM32, crashes on import when built for STM32. I'm still not confident that my toolchain is right as I can't build ESP32 firmware, so I was waiting for a resolution to this issue before trying again.
My problem is that I'm trying to do too many things at once
