MPY-cross Pi Pico Build V.18 conflict between ARCH values?

RP2040 based microcontroller boards running MicroPython.
Target audience: MicroPython users with an RP2040 boards.
This does not include conventional Linux-based Raspberry Pi boards.
Post Reply
DougW_Sask
Posts: 6
Joined: Mon Feb 21, 2022 4:57 pm
Location: Saskatchewan, Canada

MPY-cross Pi Pico Build V.18 conflict between ARCH values?

Post by DougW_Sask » Tue Feb 22, 2022 3:30 pm

(I had posted on GitHub issues - I'm a newbie in the context of proper protocols for posting - please correct me if I've overstepped!)

I'm looking at code execution vs development overhead for an upcoming class - was comparing .mpy options on Pico using factorial under /natmod/features0/ in V1.18.

Followed the mods required to create .mpy module from c source - worked well with edits to identify archv6. Compared to python script running factorial. Then looked at mpy-cross applied to python script - was able to produce a "stock" python based .mpy file to deploy.

Tried to look at using @micropython.native decorator to compare speed difference: in the .py script was easily done, and noticeable improvement. But was unable to create a functioning .mpy using either the decorator in the script running through mpy-cross, or by using the emit=native directive to mpy-cross. If I selected "arch= armv6" - the repl would indicate incompatible version. Running the sys info utility returns
"mpy version: 5
mpy flags: -march=armv7m"

For a stock Pico loaded with V1.18 dfu from micropython site. If I produce the .mpy file with the mpy-cross options set to armv7m, the execution hangs and requires a hard reset.

Am I doing something wrong, or is the Pico somehow mis-representing itself as an M4 instead of M0 architecture?



DougW.

User avatar
marfis
Posts: 215
Joined: Fri Oct 31, 2014 10:29 am
Location: Zurich / Switzerland

Re: MPY-cross Pi Pico Build V.18 conflict between ARCH values?

Post by marfis » Wed Feb 23, 2022 6:49 am

You might want to look at https://github.com/micropython/micropyt ... -894002358

But to summarize, mpy-cross does not support armv6m architecture. Jim did a branch for prelimenary support of this (also linked above) that I tested. It worked, however there it was not merged upstream. You might chime in this issue to give it a bit higher prio ;)

DougW_Sask
Posts: 6
Joined: Mon Feb 21, 2022 4:57 pm
Location: Saskatchewan, Canada

Re: MPY-cross Pi Pico Build V.18 conflict between ARCH values?

Post by DougW_Sask » Wed Feb 23, 2022 5:11 pm

Thanks! I will look into. Sorry for the newbie question - but how do I support consideration of the "fix" for this - do I reply to the post in the link on Git Hub?

Thanks again!

Doug W

User avatar
marfis
Posts: 215
Joined: Fri Oct 31, 2014 10:29 am
Location: Zurich / Switzerland

Re: MPY-cross Pi Pico Build V.18 conflict between ARCH values?

Post by marfis » Fri Feb 25, 2022 4:25 pm

yes, update the github issue would be the way to go.

aind
Posts: 3
Joined: Sat Aug 20, 2022 2:54 pm

Re: MPY-cross Pi Pico Build V.18 conflict between ARCH values?

Post by aind » Tue Aug 23, 2022 8:36 am

marfis wrote:
Wed Feb 23, 2022 6:49 am
mpy-cross does not support armv6m architecture.
Hey, it seems that mpy-cross for the latest micropython-master at this day can compile for RP2040/Pico/armv6m now.

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: MPY-cross Pi Pico Build V.18 conflict between ARCH values?

Post by jimmo » Tue Aug 23, 2022 10:15 am

Yep that's right -- https://github.com/micropython/micropython/issues/7616 was fixed (which addresses this issue).

Post Reply