|
From: | Dusan Ferbas |
Subject: | [avr-gcc-list] eicall & EIND |
Date: | Mon, 30 Jun 2008 13:14:12 +0200 |
int boot_loader_data_send(unsigned char *p_WorkBuffer, unsigned char *received_data_p, unsigned short data_length)
{
p_WorkBuffer = p_WorkBuffer;
received_data_p = received_data_p;
data_length = data_length;
//int rslt;
//asm volatile ( "movw r20,%3" "\n\t"
//"movw r22,%2" "\n\t"
//"movw r24,%1" "\n\t"
//"call 0x3F00A" "\n\t"
//"movw %0,r24" :
//"=r" (rslt) :
//"r" (p_WorkBuffer),
//"r" (received_data_p),
//"r" (data_length));
asm volatile ("jmp 0x3F00A");
//return rslt;
}
I cant answer your question fully. ...
Anatoly is adding support for 256 on version gcc 4.3 and gcc 4.4. He or Eric may provide you a better way to do call. (Even if it needs asm /macro wrapper)
Dusan Ferbas wrote:
Hi,
I am using WinAVR-20071221, because none of the most recent toolchains produces a runnable code for our application.
Our bootloader starts at 0x3f800 (2kB).
In its code, we are using function[id](...) construction.
This is compiled with eicall instruction, but no EIND register is set.
Is there a way, how to tell the compiler, that code is linked in upper half of flash ?
In bootloader code we can live with EIND=1 at its init.
But when we have a call from our application, neither EIND is set, even address is not divided by 2 (WinAVR bug #1959227).
Probably some far attribute should be applied ?
When compiled for ATmega128 (with 0x1f806), it works ...
typedef void boot_loader_init(unsigned char *);
#define boot_loader_data_init ((boot_loader_init *)0x3F806)
...
boot_loader_data_init(buffer);
...
Dusan
Dusan Ferbas
www.etech.cz
[Prev in Thread] | Current Thread | [Next in Thread] |