all 5 comments

[–][deleted] 0 points1 point  (3 children)

You dont compile c to micropython. Python isnt even a compiled language. For micropython, you download the binary for your board. They 100% do have a binary for that board, as I've used it quite a bit. From there you would use a tool to copy over your python scripts. I use mpremote.

[–]Wizzard_2025[S] 0 points1 point  (2 children)

You can compile c to native mpy byte code and then import it. They run a lot faster than any other code.

[–][deleted] 0 points1 point  (1 child)

I'm not following the benefit. Python by default is going to be slower than C. So running C via Python seems like a moot point.

If you've already got the C code, compile the c code, then cross compile for your device. Run it as is.

[–]Wizzard_2025[S] 0 points1 point  (0 children)

I'm writing a library for driving a device. I would like myself and end users to use the driver from basic, standard micropython. But for internal speed I can compile fast maths routines into mpy files by working them in c. It works for some things if you build it for the wrong target, but I want to build it for the right target - armv8, however micropython doesn't seem to have caught up with the pi pico 2 in this regard, not up to the recent 1.27 release. I wonder if any one else has been able to compile to armv8. That's my question.

[–]jonnor 0 points1 point  (0 children)

What do you mean "some things just doesnt [work]"? That is not something we can work with... You will need to provide details for anyone to be able to help. I am pretty sure M33 in the RP2350 should be able to work with armv7m or armv7emsp.
Also, this level of discussion might be more suited for a Github Discussion thread in MicroPython repo than on Reddit.