Importing a module stored as bytecode from a fixed location in flash #15474
Unanswered
tailoredsoft
asked this question in
Core Development
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi
I am using the latest 1.23.0 version of micropython.
I have a very simple flash file system where I can store two files. One will be a high level python application and the other other will be a module which will be imported by the high level python app using the 'import lib' statement.
I know the mem location and size of the bytecode lib file (generated using mpy-cross).
I have managed to modify mp_builtin___import___default() so that when I run it I can see print statements working as the module is executed.
I have a line in the module which is simply a=42.
In the high level app I have
import lib
printf(lib.a)
And when I run it I get ..
Traceback (most recent call last):
File "auto.import_test.py", in
AttributeError: no such attribute
I can't figure out how to fix that and neither can chatgpt as is not trained on v1.23.0
I will be most grateful for suggestions on how this could be done.
once it works I will raise pull request so that it serves as an example for others in the future.
I thank you in advance
Kind regards
Mahendra
Beta Was this translation helpful? Give feedback.
All reactions