History of OnlineCourse/SaveSram
Older Newer
2005-10-22 18:35:25 . . . . MembersPage/MarcellGal [how to instruct linker to place something at the end ?]
2005-10-22 16:35:03 . . . . MembersPage/MarcellGal [how to save SRAM]


Changes by last author:

Added:
With more and more firmware features, in the future we must be conscious about RAM usage

How to be efficient with SRAM usage ?

* avoid storage in SRAM where flash is better (constant strings!)

* avoid global variables where local is possible

* avoid features that are only for debugging, eg. BENCHMARK

* keep table sizes reasonable: eg. 8x8 is more than enough for lambda (12x12 is unnecessary)

* smart status and flagwords: use bits where possible (instead of whole bytes)

* try to use tables from EEPROM / FLASH directly (instead of mirror in SRAM) and only cache data when necessary

** eg. during EEPROM-write

** dirty data (changed from tuningsw, not yet written)

* pack bytes where necessary:

** internal high-resolution "learnt" VE: uint16_t ve_table[] (12 bit values would be enough instead of 16bits)

The code must be reviewed so no SRAM is wasted by the first 3 ways. We must evaluate if the other SRAM-saving methods worths the effort or not.

How can we tell the linker to place the struct benchstats to the end of SRAM ?