Sprite: Memory Crash #1663
-
Hello, I'm trying to draw a sprite on my LCD. I'm also doing a bunch of other API calls with the ESP8266. I've some certs in SPIFFS which is loaded with
When combined with the sprite drawing, adding this line crashes the program: https://github.com/Bodmer/TFT_eSPI/blob/master/examples/Sprite/Sprite_scroll/Sprite_scroll.ino#L45
Would you know of any way to optimize memory usage to prevent the crash? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I suspect you are running out of RAM, WiFi functions can consume a lot. When a sprite is created it requests RAM, in this case about 8kbytes will be requested. Subsequently the Wifi stack demands more Ram and the processor crashes. You could add code to print the heap size in various places to see how much RAM is available. As your project evolves it is likely to grow and demand more RAM, so upgrading to an ESP32 is worthwhile. |
Beta Was this translation helpful? Give feedback.
I suspect you are running out of RAM, WiFi functions can consume a lot. When a sprite is created it requests RAM, in this case about 8kbytes will be requested. Subsequently the Wifi stack demands more Ram and the processor crashes. You could add code to print the heap size in various places to see how much RAM is available. As your project evolves it is likely to grow and demand more RAM, so upgrading to an ESP32 is worthwhile.