avr-libc-dev
[Top][All Lists]
Advanced

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

Re: [avr-libc-dev] [bug #22878] eeprom_*_word/dword/block cause hangin A


From: Dmitry K.
Subject: Re: [avr-libc-dev] [bug #22878] eeprom_*_word/dword/block cause hangin ATmega256x
Date: Thu, 10 Apr 2008 08:49:27 +1100
User-agent: KMail/1.5

On Thursday 10 April 2008 01:15, Stu Bell wrote:
> "Is avr-gcc for avr6 ready to use?"  Yes, with warnings.  Since gcc
> insists on the size of a function pointer to be 2 bytes, anything using
> function pointers must be used with caution.  If the function resides in
> the lower half of flash, the 2 byte pointer works fine.
>
> The problem is when the function resides in upper memory.  Then, the 2
> byte pointer will point to the wrong place.
>
> Note that normal function calls work fine.  Avr-gcc has been modified to
> handle that case, through the use of the linker "trampoline" section.
> It is just function pointers that give problems.

Hi.

Yes, the avr6 extension was disign to obtain indirect
function calls throw "trampoline" stubs.  This stubs
must allocated in low part of flash and the 16-bit
address must be sufficient.

However the implementation is wrong: trampoline is
created, but the gs() is transformed incorrectly in
part of cases.

As the AVR Binutils port is not maintaned, IMHO, we
must to provide a workaround of this bug. I tend to
write a special variant of 'eeprom' functions for
avr6 architecture, near to the Stu Bell's patch.

Dmitry.





reply via email to

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