Hi Wang.
I just checked your project, but I haven't find stack problem.
As I said before, Stack address is inside the RAM section.
see your map file, we can know stack is allocated from address 0x1100 to 0x11ff.
while variable "i" and "j" are in this range.

Does this answer your questions?
Have a great day,
Jennie Zhang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------