Additional free RAM for ESP82266.

slaff
Posts: 10
Joined: Fri Mar 06, 2015 7:57 pm

Additional free RAM for ESP82266.

Postby slaff » Tue Sep 20, 2016 11:36 pm

RAM is quite limited in ESP8266. The article below explains tricks that can be used to get extra free RAM.

https://blog.attachix.com/get-extra-fre ... n-esp8266/

It should work for both NONOS and FreeRTOS SDKs.

pratik

Re: Additional free RAM for ESP82266.

Postby pratik » Wed Sep 21, 2016 11:04 am

Hello,

A good post!
However, a note to all users doing that - be extremely careful with alignment issues on old compiler versions! If you store a const array of 16-bit (short) type, and directly read it from flash - you will get a fatal exception for misaligned access.
For stuff stored in flash, you must access it with word alignment and in blocks of 4 bytes for reliable program. :)

eriksl
Posts: 159
Joined: Fri May 22, 2015 6:22 pm

Re: Additional free RAM for ESP82266.

Postby eriksl » Mon Oct 10, 2016 9:43 pm

Use readonly strings from flash instead, no hassle with aligning and lots of space to be reclaimed. Just make sure every string is copied to a temporary buffer in RAM before passing the string to os_printf, because these functions count on the strings being in RAM. I have been using this mechanism for over a year and it works like a charm, freeing up lots of RAM.

Who is online

Users browsing this forum: No registered users and 290 guests