Stack issue
Posted: Mon Sep 11, 2023 12:53 pm
In a recent project I noticed my board resets after 18 touch events/processes.
Basically I use Makerfabs-ESP32-S3-SPI-TFT-with-Touch board and a mixed bag of example code to produce a Macro Keyboard.
It works perfectly for about 18 button(touch) presses but then resets (I run out of Stack). Chances are it's my code but...
I found example code to show how much stack was used/remained. I put the code before and after suspect function call to print Stack used for that process. For example, the first call to load and display a menu/bmp uses over 1k, each call thereafter uses about an additional 200 bytes... nothing appeared to pop the data off the stack...
Does the compiler pop after a function call or does the code need to do the house keeping?
How would I examine the stack to see what was pushed to it? (knowing this might point me in the right direction)...
Any help appreciated....
Mike
Basically I use Makerfabs-ESP32-S3-SPI-TFT-with-Touch board and a mixed bag of example code to produce a Macro Keyboard.
It works perfectly for about 18 button(touch) presses but then resets (I run out of Stack). Chances are it's my code but...
I found example code to show how much stack was used/remained. I put the code before and after suspect function call to print Stack used for that process. For example, the first call to load and display a menu/bmp uses over 1k, each call thereafter uses about an additional 200 bytes... nothing appeared to pop the data off the stack...
Does the compiler pop after a function call or does the code need to do the house keeping?
How would I examine the stack to see what was pushed to it? (knowing this might point me in the right direction)...
Any help appreciated....
Mike