Closed jonahbron closed 7 months ago
From the MicroPython tip they just removed the define of STATIC, please see:
all: Remove the "STATIC" macro and just use "static" instead.
I haven't had time to update the libraries yet, I will do it soon
updated the library
Thank you so much for the quick response! There are still a lot of warnings in the output, but I was able to build the firmware and run _ucrypto functions in the REPL.
Also want to report that I did successfully use the manifest.py
to freeze the Python portion of this library into the firmware and was able to execute the EC code in the README example! This is really great, thanks so much
I get these errors: building for micropython v1.23.0 and potentially related to changes between new MPY versions? I don't recall having this problem earlier.
Seems like the pointer's types are different - long unisnged int vs unsigned int, if you have any suggestions on how to fix this I will try and find some time to fix and issue a PR (alternatively if you prefer to fix this yourself then of course that is fine too!)
In file included from /home/username/q-micropython/micropython/ports/esp32/cmodules/ucrypto/moducrypto.c:34:
/home/username/q-micropython/micropython/ports/esp32/cmodules/ucrypto/moducrypto.c:421:55: warning: initialization of 'void * (*)(size_t, void * const*, mp_map_t *)' {aka 'void * (*)(unsigned int, void * const*, struct _mp_map_t *)'} from incompatible pointer type 'void * (*)(mp_uint_t, void * const*, mp_map_t *)' {aka 'void * (*)(long unsigned int, void * const*, struct _mp_map_t *)'} [-Wincompatible-pointer-types]
421 | static MP_DEFINE_CONST_FUN_OBJ_KW(mod_exptmod_obj, 3, mod_exptmod);
| ^~~~~~~~~~~
/home/username/q-micropython/micropython/py/obj.h:391:104: note: in definition of macro 'MP_DEFINE_CONST_FUN_OBJ_KW'
391 | {{&mp_type_fun_builtin_var}, MP_OBJ_FUN_MAKE_SIG(n_args_min, MP_OBJ_FUN_ARGS_MAX, true), .fun.kw = fun_name}
| ^~~~~~~~
/home/username/q-micropython/micropython/ports/esp32/cmodules/ucrypto/moducrypto.c:421:55: note: (near initialization for 'mod_exptmod_obj.fun.kw')
421 | static MP_DEFINE_CONST_FUN_OBJ_KW(mod_exptmod_obj, 3, mod_exptmod);
| ^~~~~~~~~~~
/home/username/q-micropython/micropython/py/obj.h:391:104: note: in definition of macro 'MP_DEFINE_CONST_FUN_OBJ_KW'
391 | {{&mp_type_fun_builtin_var}, MP_OBJ_FUN_MAKE_SIG(n_args_min, MP_OBJ_FUN_ARGS_MAX, true), .fun.kw = fun_name}
| ^~~~~~~~
/home/username/q-micropython/micropython/ports/esp32/cmodules/ucrypto/moducrypto.c:536:62: warning: initialization of 'void * (*)(size_t, void * const*, mp_map_t *)' {aka 'void * (*)(unsigned int, void * const*, struct _mp_map_t *)'} from incompatible pointer type 'void * (*)(mp_uint_t, void * const*, mp_map_t *)' {aka 'void * (*)(long unsigned int, void * const*, struct _mp_map_t *)'} [-Wincompatible-pointer-types]
536 | static MP_DEFINE_CONST_FUN_OBJ_KW(mod_generate_prime_obj, 1, mod_generate_prime);
| ^~~~~~~~~~~~~~~~~~
/home/username/q-micropython/micropython/py/obj.h:391:104: note: in definition of macro 'MP_DEFINE_CONST_FUN_OBJ_KW'
391 | {{&mp_type_fun_builtin_var}, MP_OBJ_FUN_MAKE_SIG(n_args_min, MP_OBJ_FUN_ARGS_MAX, true), .fun.kw = fun_name}
| ^~~~~~~~
/home/username/q-micropython/micropython/ports/esp32/cmodules/ucrypto/moducrypto.c:536:62: note: (near initialization for 'mod_generate_prime_obj.fun.kw')
536 | static MP_DEFINE_CONST_FUN_OBJ_KW(mod_generate_prime_obj, 1, mod_generate_prime);
| ^~~~~~~~~~~~~~~~~~
/home/username/q-micropython/micropython/py/obj.h:391:104: note: in definition of macro 'MP_DEFINE_CONST_FUN_OBJ_KW'
391 | {{&mp_type_fun_builtin_var}, MP_OBJ_FUN_MAKE_SIG(n_args_min, MP_OBJ_FUN_ARGS_MAX, true), .fun.kw = fun_name}
| ^~~~~~~~
/home/username/q-micropython/micropython/ports/esp32/cmodules/ucrypto/moducrypto.c:567:56: warning: initialization of 'void * (*)(size_t, void * const*, mp_map_t *)' {aka 'void * (*)(unsigned int, void * const*, struct _mp_map_t *)'} from incompatible pointer type 'void * (*)(mp_uint_t, void * const*, mp_map_t *)' {aka 'void * (*)(long unsigned int, void * const*, struct _mp_map_t *)'} [-Wincompatible-pointer-types]
567 | static MP_DEFINE_CONST_FUN_OBJ_KW(mod_is_prime_obj, 1, mod_is_prime);
| ^~~~~~~~~~~~
/home/username/q-micropython/micropython/py/obj.h:391:104: note: in definition of macro 'MP_DEFINE_CONST_FUN_OBJ_KW'
391 | {{&mp_type_fun_builtin_var}, MP_OBJ_FUN_MAKE_SIG(n_args_min, MP_OBJ_FUN_ARGS_MAX, true), .fun.kw = fun_name}
| ^~~~~~~~
/home/username/q-micropython/micropython/ports/esp32/cmodules/ucrypto/moducrypto.c:567:56: note: (near initialization for 'mod_is_prime_obj.fun.kw')
567 | static MP_DEFINE_CONST_FUN_OBJ_KW(mod_is_prime_obj, 1, mod_is_prime);
| ^~~~~~~~~~~~
/home/username/q-micropython/micropython/py/obj.h:391:104: note: in definition of macro 'MP_DEFINE_CONST_FUN_OBJ_KW'
391 | {{&mp_type_fun_builtin_var}, MP_OBJ_FUN_MAKE_SIG(n_args_min, MP_OBJ_FUN_ARGS_MAX, true), .fun.kw = fun_name}
| ^~~~~~~~
/home/username/q-micropython/micropython/ports/esp32/cmodules/ucrypto/moducrypto.c:1230:49: warning: initialization of 'void * (*)(size_t, void * const*, mp_map_t *)' {aka 'void * (*)(unsigned int, void * const*, struct _mp_map_t *)'} from incompatible pointer type 'void * (*)(mp_uint_t, void * const*, mp_map_t *)' {aka 'void * (*)(long unsigned int, void * const*, struct _mp_map_t *)'} [-Wincompatible-pointer-types]
1230 | static MP_DEFINE_CONST_FUN_OBJ_KW(curve_obj, 6, curve);
| ^~~~~
/home/username/q-micropython/micropython/py/obj.h:391:104: note: in definition of macro 'MP_DEFINE_CONST_FUN_OBJ_KW'
391 | {{&mp_type_fun_builtin_var}, MP_OBJ_FUN_MAKE_SIG(n_args_min, MP_OBJ_FUN_ARGS_MAX, true), .fun.kw = fun_name}
| ^~~~~~~~
/home/username/q-micropython/micropython/ports/esp32/cmodules/ucrypto/moducrypto.c:1230:49: note: (near initialization for 'curve_obj.fun.kw')
1230 | static MP_DEFINE_CONST_FUN_OBJ_KW(curve_obj, 6, curve);
| ^~~~~
/home/username/q-micropython/micropython/py/obj.h:391:104: note: in definition of macro 'MP_DEFINE_CONST_FUN_OBJ_KW'
391 | {{&mp_type_fun_builtin_var}, MP_OBJ_FUN_MAKE_SIG(n_args_min, MP_OBJ_FUN_ARGS_MAX, true), .fun.kw = fun_name}
| ^~~~~~~~
/home/username/q-micropython/micropython/ports/esp32/cmodules/ucrypto/moducrypto.c:1808:53: warning: initialization of 'void * (*)(size_t, void * const*, mp_map_t *)' {aka 'void * (*)(unsigned int, void * const*, struct _mp_map_t *)'} from incompatible pointer type 'void * (*)(mp_uint_t, void * const*, mp_map_t *)' {aka 'void * (*)(long unsigned int, void * const*, struct _mp_map_t *)'} [-Wincompatible-pointer-types]
1808 | static MP_DEFINE_CONST_FUN_OBJ_KW(signature_obj, 2, signature);
| ^~~~~~~~~
/home/username/q-micropython/micropython/py/obj.h:391:104: note: in definition of macro 'MP_DEFINE_CONST_FUN_OBJ_KW'
391 | {{&mp_type_fun_builtin_var}, MP_OBJ_FUN_MAKE_SIG(n_args_min, MP_OBJ_FUN_ARGS_MAX, true), .fun.kw = fun_name}
| ^~~~~~~~
/home/username/q-micropython/micropython/ports/esp32/cmodules/ucrypto/moducrypto.c:1808:53: note: (near initialization for 'signature_obj.fun.kw')
1808 | static MP_DEFINE_CONST_FUN_OBJ_KW(signature_obj, 2, signature);
| ^~~~~~~~~
/home/username/q-micropython/micropython/py/obj.h:391:104: note: in definition of macro 'MP_DEFINE_CONST_FUN_OBJ_KW'
391 | {{&mp_type_fun_builtin_var}, MP_OBJ_FUN_MAKE_SIG(n_args_min, MP_OBJ_FUN_ARGS_MAX, true), .fun.kw = fun_name}
| ^~~~~~~~
/home/username/q-micropython/micropython/ports/esp32/cmodules/ucrypto/moducrypto.c:2186:49: warning: initialization of 'void * (*)(size_t, void * const*, mp_map_t *)' {aka 'void * (*)(unsigned int, void * const*, struct _mp_map_t *)'} from incompatible pointer type 'void * (*)(mp_uint_t, void * const*, mp_map_t *)' {aka 'void * (*)(long unsigned int, void * const*, struct _mp_map_t *)'} [-Wincompatible-pointer-types]
2186 | static MP_DEFINE_CONST_FUN_OBJ_KW(point_obj, 3, point);
| ^~~~~
/home/username/q-micropython/micropython/py/obj.h:391:104: note: in definition of macro 'MP_DEFINE_CONST_FUN_OBJ_KW'
391 | {{&mp_type_fun_builtin_var}, MP_OBJ_FUN_MAKE_SIG(n_args_min, MP_OBJ_FUN_ARGS_MAX, true), .fun.kw = fun_name}
| ^~~~~~~~
/home/username/q-micropython/micropython/ports/esp32/cmodules/ucrypto/moducrypto.c:2186:49: note: (near initialization for 'point_obj.fun.kw')
2186 | static MP_DEFINE_CONST_FUN_OBJ_KW(point_obj, 3, point);
| ^~~~~
/home/username/q-micropython/micropython/py/obj.h:391:104: note: in definition of macro 'MP_DEFINE_CONST_FUN_OBJ_KW'
391 | {{&mp_type_fun_builtin_var}, MP_OBJ_FUN_MAKE_SIG(n_args_min, MP_OBJ_FUN_ARGS_MAX, true), .fun.kw = fun_name}
thanks for the report, solved in 7e0ccac725afc773bd35e31332701ffa8ca1cb13
Sweet, thank you!
I'm trying to build a Micropython firmware with this library included. I have an environment set up for building Micropython and can get a firmware.bin file out by running
However when I clone down ucrypto and include it in the
USER_C_MODULES
argument as instructed, I get quite a lot of errors and the firmware fails to build.Here is the last chunk of output, but there are quite a few errors, all seemingly coming from
ucrypto/moducrypto.c
Here's the full output:\ https://paste.sr.ht/~jonahbron/c48f525093b76f9481d9340163c03c66fb289442
Is this a known issue, does ESP32C3 not work? Or am I doing something wrong with my compilation?