-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Exposing more types to native modules #5641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You need to make sure the changes are reflected in this table: https://github.com/micropython/micropython/blob/master/tools/mpy_ld.py#L666-L682 |
Yes, I've added the symbols to that (unfortunately it doesn't fix the issue, so I think I have a problem elsewhere). I would have thought that without them I should hit the LinkError on line 704 anyway? |
Just some more notes for me to refer to later: after building micropython with
And indeed the table is still lined up with the |
modifying mp_ld.py to print out symbol offsets shows that But in this process I actually just found my dumb mistake, see if you can spot it:
|
Ok, so you missed commas! It might be a good idea to generate this table in |
Ah, didn't see this in time. I just created a PR with all of the types from obj.h. I'll need to think a bit about parsing, because from memory |
…lice bitbangio.SPI: Handle kwargs like busio.SPI
I'm trying to expose the
mp_type_int
,mp_type_float
andmp_type_bytes
to native modules. I have done the following things:mp_fun_table_t
innativeglue.h
to add the types:mp_fun_table
innativeglue.c
to set the pointer values:Unfortunately I seem to be getting an odd error where the functions are no longer hooked up correctly, I suspect that this is because there is an offset in the exported function table somewhere which has not been updated, so
mp_type_fun_builtin_1
is now mapped tomp_type_list
.I also noticed that in
mpy_ld.py
there is a section which specifically resolves some other type symbols. Adjusting this to also add my new types did not solve the problem unfortunately (and I'm not getting a linker error anyway...)Does anyone know where the table is that I am not updating properly?
The text was updated successfully, but these errors were encountered: