ec
ec copied to clipboard
Internal RAM exhausted
Attempting to build branch usbc-mux-info for bonw15 results in:
LINK ec.ihx
?ASlink-Error-Could not get 11 consecutive bytes in internal RAM for area OSEG.
?ASlink-Error-Could not get 5 consecutive bytes in internal RAM for area OSEG.
make: *** [src/arch/8051/toolchain.mk:42: build/ec.ihx] Error 1
Need to look at the memory map, but:
We already use large for the main app (which is suppose to put variables in XRAM to begin with), so a potential resolution may be to declare and use variables at fixed addressed (Ref: #36):
- declare loop indexes in idata and only use those?
- ensure we only have ~4 total
- not sure how SDCC manages these; might already try something like this?
- explicitly move data to xdata?
- not sure how this works with scratch ROM usage and registers
Some other thoughts:
- Check if SDCC 4.4.0 (#418) alleviates the issue, since it has generalized constant propagation
- Reduces code size by ~600 bytes without any changes, but does not appear to affect RAM allocation
- Replace
bools withbits? - (re)declare functions with
__reentrantso variables are placed on the stack rather than be statically assigned? - move logic (complexity) to system firmware (system76/firmware-open#571)