Hello,
I'm working on a little IOT project, nothing complicated. I settled on the arduino system for my nodemcu cards because it was just more stable than trying to program them with Lua. I am minimally familiar with C++, but have some years of professional-level embedded programming experience in C.
Does anybody know how to get access to the sub-os world of the processor? I'm specifically talking about processor registers and physical memory. Even more specifically, at the moment, the stack pointer.
I'd like to apply a few simple tests to the stack pointer to help with reliability. I understand that the esp has
a small 4K stack. C, in general, is a stack-intensive language. 4K seems like enough for a little IOT project, but...
At the top of the main loop, the stack pointer should always be the same value. If it changes, it means that
somewhere, a push was not matched by a pop, or a call not matched by a return.
I'd like to set some words near the end of the stack to a magic number. If that number changes, we're close to blowing the stack.
The ideal thing would be a way to embed snippets of assembly language....