esphttpclient icon indicating copy to clipboard operation
esphttpclient copied to clipboard

Ram not enough for SSL

Open skwijeratne opened this issue 7 years ago • 3 comments

When I compile the http client with the SSL calls, I run out of iram, but if I remove all the espconn_secure_XXXXX calls then I am able to compile on ESP8266 project. Am I doing something wrong? Is the client able to fit in iram even with SSL?

Your response would be greatly appreciated.

Thanks Sanjaya

skwijeratne avatar Mar 14 '17 18:03 skwijeratne

According to Espressif's SSL user manual, using SSL requires quite a large amount of RAM. Is your program already using a lot of RAM?

If you have e.g. large string literals, you could try moving them to the flash memory by using the ICACHE_RODATA_ATTR as described in the FAQ. Also, move your own functions (except probably interrupt handlers and other critical ones) to the flash by using the ICACHE_FLASH_ATTR.

flannelhead avatar Mar 16 '17 06:03 flannelhead

I found that this httpclient uses strlen instead of os_strlen and also own implementation of atoi could save some bytes.

igagis avatar Apr 23 '19 22:04 igagis

One can also link against -lcirom instead of -lc, it puts all stdlib functions to irom.

igagis avatar Apr 25 '19 21:04 igagis