Arduino icon indicating copy to clipboard operation
Arduino copied to clipboard

2.5.0 IRAM usage core_esp8266_si2c.c

Open freeck opened this issue 7 years ago • 4 comments

Hi there, I was rather surprised by the increase of iram-usage of my application when using release v2.5.0 for the first time. The map shows that the i2c-library is the greatest consumer of ram i.e. Aprox. 2500 bytes! As on the other hand the developers did their utmost to decrease iram-usage with aprox 700 bytes.... This increase is caused by the extension of the library with slave-functionality. Wouldn't it be a good idea to have two versions of this library , with and without slave-functions. Or some kind of conditional compilation and/or linking two separate modules.

freeck avatar Feb 01 '19 20:02 freeck

Could you give a specific example or sketch that shows a difference?

earlephilhower avatar Feb 02 '19 18:02 earlephilhower

Mind you: I use Sloeber as IDE. I just included "wire.h" in a basic blink.ino example, made one referende to the original library , and there you are. Next I deleted all the IRAMCACHE definitions in the headers of the i2c-functions. Result: 2500 IRAM extra.

freeck avatar Feb 02 '19 18:02 freeck

Check out #6326. It's untested, but reduced IRAM usage by >500 bytes in the TWI code. Any testing you'd be able to provide would be welcome!

earlephilhower avatar Jul 24 '19 16:07 earlephilhower

The referenced PRs are merged, IRAM has improved quite a bit. Closing this.

devyte avatar Oct 31 '19 06:10 devyte