esphttpclient
esphttpclient copied to clipboard
Ram not enough for SSL
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
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
.
I found that this httpclient
uses strlen
instead of os_strlen
and also own implementation of atoi
could save some bytes.
One can also link against -lcirom
instead of -lc
, it puts all stdlib functions to irom.