avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Memory corruption (?) I don't understand


From: David Brown
Subject: Re: Memory corruption (?) I don't understand
Date: Tue, 22 Jun 2021 18:23:55 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 22/06/2021 18:00, Ian Molton wrote:
> On 22/06/2021 12:59, BERTRAND Joël wrote:
>>      Hello,
>>
>>      I'm writing a firmware for a board that uses a ATMega 1284. Firmware
>> continuously restarts
> 
> This is likely a branch through zero.
> 
> Common causes on AVR are bad function pointers, and stack damage.
> 

A good way to check this is to track the reset cause.  At startup, look
for the reset cause (and print it out on debugging, record it in logs,
or whatever is appropriate for the system), then clear the reset cause
flags.  If you find you are starting up and there are no reset cause
flags set, then you haven't actually reset - you've just jumped to
address 0.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]