MPY files not working (1.14)

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
lutecki
Posts: 6
Joined: Wed Apr 14, 2021 8:56 pm

MPY files not working (1.14)

Post by lutecki » Wed Apr 21, 2021 8:08 am

Hi,
My mpy compiled files are not working. I used micropython 1.14 on ESP32 and mpy-cross compiled on my MacBook Pro with macOS 11.1.

mpy-cross --version
MicroPython v1.14 on 2021-04-21; mpy-cross emitting mpy v5

ESP32 console:
MicroPython v1.14 on 2021-02-02; ESP32 module with ESP32
Type "help()" for more information.
>>>

Result of mpy checker from https://docs.micropython.org/en/latest/ ... files.html
mpy version: 5
mpy flags: -arch=xtensawin

I tried to compile that code (main.py):
print("Working!")

I trying this methods:
mpy-cross -march=xtensawin 2.0.0/main.py
mpy-cross -mcache-lookup-bc -march=xtensawin 2.0.0/main.py

When I open the main.mpy file, the first byte is 4D (M letter), second is 05, so as you see that's correct.
Attachments
main.zip
(1.32 KiB) Downloaded 80 times

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: MPY files not working (1.14)

Post by Roberthh » Wed Apr 21, 2021 8:29 am

AFAIK, boot.py and main.py must not be pre-compiled. You can have a short main.py, which imports a large compiled code.

Post Reply