How can I visualise the memory (SRAM) usage of an AVR program?

前端 未结 8 1066
不知归路
不知归路 2020-12-14 08:40

I have encountered a problem in a C program running on an AVR microcontroller (ATMega328P). I believe it is due to a stack/heap collision but I\'d like to be able to confirm

8条回答
  •  死守一世寂寞
    2020-12-14 09:03

    If you can edit the code for your heap, you could pad it with a couple of extra bytes (tricky on such low resources) on each block of memory. These bytes could contain a known pattern different from the stack. This might give you a clue if it collides with the stack by seeing it appear inside the stack or vice versa.

提交回复
热议问题