Re: [avr-gcc-list] Why are we using EICALL and EIJMP for AVR256?

2009-12-15 Thread andrewhutchinson
Thanks, it would be nice if this was documented.

I noticed it when reviewing addressing modes and a omission in call patterns.

void  (*fptr)();

fptr = main;

(*fptr)();  //Will use EICALL - should be CALL main


which become readily apparent with inlined code.


Andy



 Sean D'Epagnier  wrote: 
> On 12/14/09, Andrew Hutchinson  wrote:
> > The patterns for AVR mega 256 use EICALL an EIJMP
> >
> > Both require EIND to be set to provide upper address bits
> >
> > However, we are using linker trampolines for both, so in either case the
> > 16 bit jump or call is to the trampolines.
> >
> > Are not the trampolines always located in first 128Kbytes? Thus we
> > should be using ICALL and IJMP and not needing to set use EIND at all.
> >
> > What have I miss-understood?
> >
> 
> Hi,
> 
> Yes this confused me a lot too, but the reason is because the
> trampoline is not in the first 128kbytes for a bootloader, so if the
> compiler uses eijmp and eicall, then it is possible to do indirect
> calls there too, but it still works fine in normal code.
> 
> Sean
> 
> >
> > Andy
> >
> >
> >
> > ___
> > AVR-GCC-list mailing list
> > AVR-GCC-list@nongnu.org
> > http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
> >



___
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list


R: [avr-gcc-list] Why are we using EICALL and EIJMP for AVR256?

2009-12-15 Thread palmerino tallarico
A note about the use of the trampoline in the AVR256. 
I was in trouble cause a wrong address in the upper 128K using the
trampoline itself due to a linker error (I suppose). At the moment I don't
use EICALL for this reason.
If someone has news about this issue I'm very interested to fix the problem
in my code.
Thank you in advance

Rino Tallarico
_
via Pola 26 - 10135 Torino
tel. +39 347 2261196
mailto: palmerinotallar...@vodafone.it

-Messaggio originale-
Da: avr-gcc-list-bounces+palmerinotallarico=vodafone...@nongnu.org
[mailto:avr-gcc-list-bounces+palmerinotallarico=vodafone...@nongnu.org] Per
conto di andrewhutchin...@cox.net
Inviato: martedì 15 dicembre 2009 14.35
A: Sean D'Epagnier
Cc: avr-gcc-list@nongnu.org; Weddington, Eric
Oggetto: Re: [avr-gcc-list] Why are we using EICALL and EIJMP for AVR256?

Thanks, it would be nice if this was documented.

I noticed it when reviewing addressing modes and a omission in call
patterns.

void  (*fptr)();

fptr = main;

(*fptr)();  //Will use EICALL - should be CALL main


which become readily apparent with inlined code.


Andy



 Sean D'Epagnier  wrote: 
> On 12/14/09, Andrew Hutchinson  wrote:
> > The patterns for AVR mega 256 use EICALL an EIJMP
> >
> > Both require EIND to be set to provide upper address bits
> >
> > However, we are using linker trampolines for both, so in either case the
> > 16 bit jump or call is to the trampolines.
> >
> > Are not the trampolines always located in first 128Kbytes? Thus we
> > should be using ICALL and IJMP and not needing to set use EIND at all.
> >
> > What have I miss-understood?
> >
> 
> Hi,
> 
> Yes this confused me a lot too, but the reason is because the
> trampoline is not in the first 128kbytes for a bootloader, so if the
> compiler uses eijmp and eicall, then it is possible to do indirect
> calls there too, but it still works fine in normal code.
> 
> Sean
> 
> >
> > Andy
> >
> >
> >
> > ___
> > AVR-GCC-list mailing list
> > AVR-GCC-list@nongnu.org
> > http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
> >



___
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list



___
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list


Re: [avr-gcc-list] Why are we using EICALL and EIJMP for AVR256?

2009-12-15 Thread Lars Noschinski
* andrewhutchin...@cox.net  [09-12-15 19:09]:
> void  (*fptr)();
> 
> fptr = main;
> 
> (*fptr)();  //Will use EICALL - should be CALL main

Hm, this problem seems to exist not only for the "big device". Using gcc
4.3.4 (from debian testing) on following C file with

$ avr-gcc -Wa,-adhlns=foo.lst foo.c -o foo.out -O2 -mmcu=atmega88

-- foo.c 
static const void (*fptr)() = 0;

int main(void) {
fptr();
}
-

yields the following code:

-
  13main:
  14/* prologue: function */
  15/* frame size = 0 */
  16  E0E0  ldi r30,lo8(0)
  17 0002 F0E0  ldi r31,hi8(0)
  18 0004 0995  icall
  19/* epilogue start */
  20 0006 0895  ret
-

i.e. uses an indirect call instead of an direct call.

 - Lars.


___
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list


[avr-gcc-list] AVR environment on Solaris 10

2009-12-15 Thread Andreas Höschler

Hi Eric,


Am I missing an environment variable?



I've been bitten by this several times. IIRC, you're supposed to use  
GNU make 3.81. That should solve the problem.


I have followed the guide

		http://www.micahcarrick.com/02-15-2006/installing-gnu-tools-avr- 
gcc.html


and have avr-gcc and avr-libc built on my Solaris machine. I have  
purchased a


• Arduino Duemilanove 2009 (ATmega328) USB
• Arduino Ethernet Shield Addon RJ45

from Electrodome. I have used Arduino.app on my Mac to upload a few  
sketches to the board and tried them out (blinking LEDs). This works!


I now would like to make use of the gnu tool chain on the Solaris  
machine but am not sure how to get started there. I wrote a simple  
program


#define F_CPU 1600UL  /* 16 MHz CPU clock */
#include 
#include 
int main (void)
{
DDRC = _BV (PC0);   /* PC0 is digital output */
while (1)   /* loop forever */
{
/* set PC0 on PORTC (digital high) and delay for 500mS  
*/

PORTC &= ~_BV(PC0);
_delay_ms(500);

/*  PC0 on PORTC (digital 0) and delay for 500mS */
PORTC |= _BV(PC0);
_delay_ms(500);
}
return (0);
}

and was able to build toggle_led.c  with

avr-gcc -mmcu=atmega328p -Wall -o toggle_led.elf toggle_led.c
avr-objcopy -j .text -O ihex toggle_led.elf toggle_led.hex

The question is, how do I get the toggle_led.hex onto the Arduino board  
now using my Solaris environment? My plan is to put a Sun Ray on my  
work bench and connecti the Arduino board to the USB-port of the Sun  
Ray. Has anybody ever tried that? I could also keep using the Mac for  
setting up the Arduino board initially or for programming purposes, but  
in the end I would like to have a program on the Arduino that opens a  
TCP-socket (Arduino Ethernet Shield ) and awaits commands from a  
Solaris application. What steps are necessary to accomplish that? Any  
missing device (programmer) I still need to purchase?


Thanks a lot in advance!

Regards,

 Andreas





___
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list


[avr-gcc-list] Building avrdude on Solaris 10

2009-12-15 Thread Andreas Höschler

Hi all,

this is my attempt to build avrdude on Solaris 10.

cd /opt/temp
pkgadd -d autoconf-2.65-sol10-x86-local
pkgadd -d automake-1.11.1-sol10-x86-local
pkgadd -d m4-1.4.12-sol10-x86-local

cd /usr/src/Arduino
svn co svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude
cd avrdude
./bootstrap
...

bootstrap gives me the following error message:

-bash-3.00# ./bootstrap
Warning: This program is tested with autoconf version 2.59 and 2.61.
You are using autoconf (GNU Autoconf) 2.65.
Warning: This program is tested with automake version 1.9 and 1.10.
You are using automake (GNU automake) 1.11.1.
+ rm -rf autom4te.cache
+ aclocal
/usr/local/share/aclocal/pkg.m4:5: warning: underquoted definition of 
PKG_CHECK_MODULES
/usr/local/share/aclocal/pkg.m4:5:   run info '(automake)Extending 
aclocal'
/usr/local/share/aclocal/pkg.m4:5:   or see 
http://sources.redhat.com/automake/automake.html#Extending-aclocal

autom4te: need GNU m4 1.4 or later: /usr/local/bin/m4
aclocal: autom4te failed with exit status: 1
+ autoheader
autom4te: need GNU m4 1.4 or later: /usr/local/bin/m4
autoheader: '/usr/local/bin/autom4te' failed with exit status: 1
+ autoconf
autom4te: need GNU m4 1.4 or later: /usr/local/bin/m4
+ automake -a -c
autom4te: need GNU m4 1.4 or later: /usr/local/bin/m4
automake: autoconf failed with exit status: 1

Any idea?

Thanks a lot,

 Andreas





___
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list


Re: [avr-gcc-list] Building avrdude on Solaris 10

2009-12-15 Thread Joerg Wunsch
Andreas Höschler  wrote:

>   cd /usr/src/Arduino
>   svn co svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude
>   cd avrdude
>   ./bootstrap
>   ...
> 
> bootstrap gives me the following error message:

Unless you want to build AVRDUDE from SVN, you should not need to
bootstrap.  I think there are now Arduino patches in the regular
AVRDUDE patch trackers which you should be able to apply on top of a
standard AVRDUDE distribution.

-- 
cheers, J"org   .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)


___
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list