Skip to content
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

Add PortalBase and Fake Requests and update Frozen Libs on Portal boards #6043

Merged
merged 5 commits into from
Feb 18, 2022

Conversation

makermelissa
Copy link
Collaborator

This will free up some memory on a few of the boards that use the PortalBase library, which currently does not function on the MatrixPortal and is pretty close to the max space on the others.

@makermelissa
Copy link
Collaborator Author

Hmm, it's failing with this error:

usage: mpy-tool.py [-h] [-d] [-f] [--merge] [-q QSTR_HEADER]
                   [-mlongint-impl {none,longlong,mpz}] [-mmpz-dig-size N]
                   [-o OUTPUT]
                   files [files ...]
mpy-tool.py: error: the following arguments are required: files
make: *** [../../py/mkrules.mk:167: build-matrixportal_m4/frozen_mpy.c] Error 2

@makermelissa
Copy link
Collaborator Author

Nope, it's this error actually:

Error: Build matrixportal_m4 for de_DE took 1.[11](https://github.com/adafruit/circuitpython/runs/5221196089?check_suite_focus=true#step:9:11)s and failed
make: Entering directory '/home/runner/work/circuitpython/circuitpython/ports/atmel-samd'
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
mkdir -p build-matrixportal_m4/genhdr
FREEZE ../../frozen/Adafruit_CircuitPython_PortalBase ../../frozen/Adafruit_CircuitPython_Requests ../../frozen/Adafruit_CircuitPython_ESP32SPI ../../frozen/Adafruit_CircuitPython_NeoPixel ../../frozen/Adafruit_CircuitPython_Display_Text ../../frozen/Adafruit_CircuitPython_LIS3DH ../../frozen/Adafruit_CircuitPython_FakeRequests
fatal: no tag exactly matches '01f050e40[16](https://github.com/adafruit/circuitpython/runs/5221196089?check_suite_focus=true#step:9:16)87066de7bc6017c1ef8df2b4e76ed'
fatal: No tags can describe '01f050e401687066de7bc6017c1ef8df2b4e76ed'.

I probably froze it wrong.

@jepler
Copy link
Member

jepler commented Feb 16, 2022

Make sure that the submodule is pointed exactly at a tagged release, not at the tip of main.

@makermelissa
Copy link
Collaborator Author

Make sure that the submodule is pointed exactly at a tagged release, not at the tip of main.

I don't think I did that. How is that done?

@makermelissa
Copy link
Collaborator Author

makermelissa commented Feb 16, 2022

I went into the submodule and checked out the release tag for each and then committed for this PR. Hopefully that's right.

@dhalbert
Copy link
Collaborator

@makermelissa If you go to the top level at circuitpython/, there is a make target: make update-frozen-libraries, which does this for you. It will update all that need updating.

@jepler
Copy link
Member

jepler commented Feb 16, 2022

It's too much for poor matrixportal to handle .. by a lot 😢

/usr/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: build-matrixportal_m4/firmware.elf section `.text' will not fit in region `FLASH_FIRMWARE'
/usr/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: region `FLASH_FIRMWARE' overflowed by 33872 bytes

@makermelissa
Copy link
Collaborator Author

Ok, hmm. Now to figure out what to leave out. I did give it everything relevant to it.

@makermelissa
Copy link
Collaborator Author

I removed DisplayText from MatrixPortal since it really contains 3 variations and only one is loaded in memory, but it uses 60k of frozen space.

@makermelissa
Copy link
Collaborator Author

makermelissa commented Feb 16, 2022

I tested compiling locally and it was still failing, so I removed a couple more frozen libs and disabled some modules that likely aren't used such as sharpdisplay, sdcardio, and bleio. If any of those are actually needed for the MatrixPortal, we can shuffle it around some more.

@jepler
Copy link
Member

jepler commented Feb 17, 2022

Don't portal boards have SD card slots? It'd be nice to put back sdcardio. Oh, that applied only to matrixportal, which doesn't have an SD slot.

Is the inclusion of FakeRequests unavoidable? well, I guess it's not very big...

@makermelissa
Copy link
Collaborator Author

makermelissa commented Feb 17, 2022

Don't portal boards have SD card slots? It'd be nice to put back sdcardio. Oh, that applied only to matrixportal, which doesn't have an SD slot.

Correct.

Is the inclusion of FakeRequests unavoidable? well, I guess it's not very big...

Yeah, it's more of a convenience thing. We could remove it if you think that's be better.

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! It's too bad we have to do this even on these big chips, but there's a lot of code.

@dhalbert dhalbert merged commit 60ceb6e into adafruit:main Feb 18, 2022
@dhalbert dhalbert added this to the 7.2.0 milestone Feb 18, 2022
@makermelissa
Copy link
Collaborator Author

Looks good! It's too bad we have to do this even on these big chips, but there's a lot of code.

Agreed, I think optimizing the portal libraries would help. I have an issue open to do that.

dhalbert pushed a commit that referenced this pull request Mar 15, 2022
We have a guide that uses it. It was removed in #6043 without
realizing that.

Fixes #6152
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants