Σχόλια σε: για το Raspberry Pi Pico https://picockpit.com/raspberry-pi/el/c-extension-for-micropython-on-raspberry-pi-pico/ Παρ, 24 Μαΐου 2024 07:36:44 +0000 ωριαία 1 https://wordpress.org/?v=6.9 Από: Dr_Phil https://picockpit.com/raspberry-pi/el/c-extension-for-micropython-on-raspberry-pi-pico/#comment-21214 Παρ, 24 Μαΐου 2024 07:36:44 +0000 https://picockpit.com/raspberry-pi/?p=774#comment-21214 I followed all the instruction and ended up with a built facfib.mpy file. I used
ARCH = armv6m
When loaded into the Pico I get this error:

ValueError: incompatible .mpy file

My Pico requires the following mpy values:
mpy version: 6
mpy sub-version: 2
mpy flags: -march=armv6m

Checking the first two bytes of the file give version 6 and sub-version 6.
Is there a way to correct this please?

]]>
Από: Αδάμ https://picockpit.com/raspberry-pi/el/c-extension-for-micropython-on-raspberry-pi-pico/#comment-18235 Παρ, 09 Φεβ 2024 09:22:45 +0000 https://picockpit.com/raspberry-pi/?p=774#comment-18235 Σε απάντηση στο Paulo.

Thank you for the information, Paulo!

]]>
Από: Paulo https://picockpit.com/raspberry-pi/el/c-extension-for-micropython-on-raspberry-pi-pico/#comment-18221 Παρ, 09 Φεβ 2024 01:44:59 +0000 https://picockpit.com/raspberry-pi/?p=774#comment-18221 Now you can compile to armv6 so just change this line in the Makefile and no need to change the micropython code
ARCH = armv6m

I had a few errors compiling the factfib.c, where are the fixes:

// missing the ” in the end.
#include “py/dynruntime.h”

// convert the return value to mp_obj_t
STATIC mp_obj_t factorial(mp_obj_t x_obj) {
mp_int_t x = mp_obj_get_int(x_obj);
mp_int_t rslt = factorial_helper(x);
return mp_obj_new_int(rslt);
}

]]>
Από: paopao69 https://picockpit.com/raspberry-pi/el/c-extension-for-micropython-on-raspberry-pi-pico/#comment-9539 Τετ, 22 Μαρ 2023 17:59:43 +0000 https://picockpit.com/raspberry-pi/?p=774#comment-9539 Σε απάντηση στο Lynggaard.

Did you eventually get it to work?

]]>
Από: Lynggaard https://picockpit.com/raspberry-pi/el/c-extension-for-micropython-on-raspberry-pi-pico/#comment-5438 Sun, 08 Jan 2023 20:09:41 +0000 https://picockpit.com/raspberry-pi/?p=774#comment-5438 I tried to do the above, but various things dont work out as described:

– I followed the instructions above, got micropython, modified the makefile as described
– I do make (but I get a factfib.native.mpy file instead of factfib.mpy)
– I copy the factfib.native.mpy file to the pico as factfib.mpy
(I tried rshell but I got a “timed out or error in transfer to remote: b””, but I could copy it over using Thonny)
– I can import the module (in thonny or rshell – the same) without errors
– I try and run the “ff.fibonacci(5)” but then I get:

“Traceback (most recent call last):
File “”, line 1, in
AttributeError: ‘module’ object has no attribute ‘fibonacci'”

What do I do wrong?

]]>
Από: pl https://picockpit.com/raspberry-pi/el/c-extension-for-micropython-on-raspberry-pi-pico/#comment-1048 Τετάρτη, 01 Ιούνιος 2022 03:31:26 +0000 https://picockpit.com/raspberry-pi/?p=774#comment-1048 How to configure joomla that can retrieve the data from mysql?

]]>
Από: raspi berry https://picockpit.com/raspberry-pi/el/c-extension-for-micropython-on-raspberry-pi-pico/#comment-245 Σάββατο, 27 Νοεμβρίου 2021, 17:56:48 +0000 https://picockpit.com/raspberry-pi/?p=774#comment-245 Σε απάντηση στο PeterB.

Thank you for your feedback 🙂

]]>
Από: PeterB https://picockpit.com/raspberry-pi/el/c-extension-for-micropython-on-raspberry-pi-pico/#comment-218 Παρ, 26 Νοε 2021 08:29:10 +0000 https://picockpit.com/raspberry-pi/?p=774#comment-218 Apart from the error in the c program it worked a treat. Thanks.

STATIC mp_obj_t factorial(mp_obj_t x_obj) {
mp_int_t x = mp_obj_get_int(x_obj);
mp_int_t rslt = factorial_helper(x);
return mp_obj_new_int(rslt);
}

]]>