2022-07-12 11:16 PM
Hello,
I need to fill the stack with watermarks, but I do not have access to the assembly startup script. Usually I would do it right at the start of the reset handler, is there another way of doing this?
2022-07-12 11:56 PM
It's OK to do it at the start of main(), best in asm, inline, or calling a function in separate asm source.
As you never return from main(), all stack consumed - for whatever reason - at entry to main(), remains consumed forever.
JW
2022-07-13 01:08 AM
Main will have to do for now. For everyone doing this, try not to overwrite stuff that is already on the stack when main is beeing called.
2022-07-13 01:24 AM
"I do not have access to the assembly startup script."
Could you say why not?
2022-07-13 04:45 AM
If you can call another function, or pull the SP register (perhaps via a pointer to an auto/local variable) you can move downward from there.