Page 1 of 1

uasyncio.task missing in 1M build

Posted: Thu Aug 18, 2022 10:20 am
by sloathog
Hi,

Issue I have is based on the two errors below:
1st Error:
ImportError: no module named 'uasyncio'
2nd Error:
ImportError: no module named 'uasyncio.task'
I'm trying to make a custom build on 1.19.1 to freeze my modules for a 1M board.
1st error:
I noticed the uasyncio is not included at all, which I resolved by copying the GENERIC/manifest.py to GENERIC_1M/manifest.py
This includes the line:
include("$(MPY_DIR)/extmod/uasyncio/manifest.py")
Now I can import uasyncio, but I get an error trying to import uasyncio.task
$(MPY_DIR)/extmod/uasyncio/manifest.py" has a comment at the top:
# This list of frozen files doesn't include task.py because that's provided by the C module.
My hack was to add "uasyncio/task.py" to the list in extmod/uasyncio/manifest.py, and it appears to work.

My question is:
why does the GENERIC build work without the hack (it uses the c compiled version), but the 1M build doesn't seem to pull in the C module and I need to add task.py to the manifest.

What am I missing on the config of the GENERIC_1M board....

Re: uasyncio.task missing in 1M build

Posted: Thu Aug 18, 2022 10:24 am
by sloathog
I think I found my own answer, will give it a try and let you know.

Code: Select all

diff GENERIC/mpconfigboard.h GENERIC_1M/mpconfigboard.h
< #define MICROPY_PY_FSTRINGS             (1)
19d17
< #define MICROPY_PY_UASYNCIO             (1)
Need to add #define MICROPY_PY_UASYNCIO (1) to GENERIC_1M/mpconfigboard.h

Re: uasyncio.task missing in 1M build

Posted: Thu Aug 18, 2022 12:00 pm
by jimmo
sloathog wrote:
Thu Aug 18, 2022 10:24 am
I think I found my own answer, will give it a try and let you know.
Yes that is exactly the answer.