Compiling a native C module on ESP-WROOM-32 #11125
Replies: 3 comments 1 reply
-
I was initially uploading the file in Now I can import factorial but I can't run factorial.factorial
Seems somewhere the name factorial hasn't registered correctly?
I then also tried building
Out of curiosity does anyone know what is the .mpy file in Edit: Quite weird, coming back to this now it seems to work. Not sure what to suggest except perhaps a restart after installing the idf and remember to source ./export.sh |
Beta Was this translation helpful? Give feedback.
-
I had the exact same problem here and found a solution. My mistake: I compiled the native C module Solution: I flashed micropython 1.20.0 on the ESP-WROOM-32 and it works. Details: Using micropython 1.20.0:
Using esp-idf 5.0.2:
Compiling native C module:
Executing on ESP-WROOM-32:
HTH |
Beta Was this translation helpful? Give feedback.
-
Mismatched versions of MicroPython for the firmware and what the module is build against by far the most likely cause of this. |
Beta Was this translation helpful? Give feedback.
-
I'm trying to get started with compiling a native module on ESP32, I am using the ESP-WROOM-32 (DO1T ESP32 DEVKIT V1).
I have my architecture in the Makefile set to
xtensawin
and it compiles fine but when I load it onto the device and try and import it, I get an errorValueError: incompatible .mpy file
For now I'm just using the factorial.c code from https://docs.micropython.org/en/kookaberry/develop/natmod.html without any changes.
I've previously built micropython from source using the same setup and tested it and it works fine so I am thinking I have misconfigured something in the Makefile for the factorial module. Any thoughts on where I might have gone wrong?
In case there is any information I should be including here that I haven't please do let me know, I will add it in.
For the sake of completeness:
Makefile
factorial.c
Beta Was this translation helpful? Give feedback.
All reactions