Re: [avr-gcc-list] very simple program
Timothy Smith <[EMAIL PROTECTED]> wrote: > my apologes for not giving this to start with > > %avr-gcc -g -mmcu=atmega32 -Os -c BarGimp.c > %avr-gcc -g -o BarGimp.out BarGimp.o Make this: avr-gcc -mmcu=atmega32 -o BarGimp.out BarGimp.o and it will work. The linker needs to know as well which CPU you are compiling for (or rather: the compiler needs to know, as it wants to tell the linker which startup file and library to link against). You can pass the remaining avr-gcc options as well, so this will also work: avr-gcc -g -mmcu=atmega32 -Os -o BarGimp.out BarGimp.o -- 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
Re: [avr-gcc-list] very simple program
David Kelly wrote: On Oct 2, 2005, at 7:21 AM, Timothy Smith wrote: i'm learning the in's and out's of microcontroller programming, but i've run into a really fundamental problem. i get the following error when i attempt to use _BV to shift a shit and set port b pin 0 to output 4: undefined reference to `__stack' and here is my code #include int main(void){ while (1) { DDRB = _BV(PB0); }; } Yeah, well what else are you doing? What CPU? How are you specifying the CPU to the compiler? Who is complaining about __stack? My guess is that its the linker not the compiler and it has something to do with your CPU selection or failure to specify to both compiler and linker. Also use of _BV(PB0) is discouraged as its nothing more than (1
Re: [avr-gcc-list] very simple program
On Sunday 02 October 2005 23:21, Timothy Smith wrote: > i'm learning the in's and out's of microcontroller programming, but i've > run into a really fundamental problem. i get the following error when i > attempt to use _BV to shift a shit and set port b pin 0 to output > > 4: undefined reference to `__stack' [...] Use 'avr-gcc' to link. If you want to use 'avr-ld', you must to add startup code and link-layout manually. Regards. ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
RE: [avr-gcc-list] very simple program
Only if you don't want to change the rest of the port! /niklo -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Parthasaradhi Nayani Sent: den 2 oktober 2005 19:35 To: Timothy Smith; avr-gcc Subject: Re: [avr-gcc-list] very simple program Hello, In order to set the bit, you need to logical OR the bit. DDRB |= _BV (PB0); to clear it DDRB &= ~_BV(PB0); Nayani > > 4: undefined reference to `__stack' > > > > > > #include > > > > int > > main(void){ > > while (1) { > >DDRB = _BV(PB0); > >}; > > } > > __ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com ___ 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] very simple program
Hi, On Sun, 02 Oct 2005 23:05:06 +0530, Parthasaradhi Nayani <[EMAIL PROTECTED]> wrote: In order to set the bit, you need to logical OR the bit. DDRB |= _BV (PB0); ..etc. Actually thats not the problem, you dont have to OR if you only want to set 1 bit & dont care abt the others, Maybe he wants to Make PB0 output & rest inputs. His code is valid. Also I dont think it has any thing to do with his '__stack' problem. --Royce. -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
Re: [avr-gcc-list] very simple program
Hello, In order to set the bit, you need to logical OR the bit. DDRB |= _BV (PB0); to clear it DDRB &= ~_BV(PB0); Nayani > > 4: undefined reference to `__stack' > > > > > > #include > > > > int > > main(void){ > > while (1) { > >DDRB = _BV(PB0); > >}; > > } > > __ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
Re: [avr-gcc-list] very simple program
On Oct 2, 2005, at 7:21 AM, Timothy Smith wrote: i'm learning the in's and out's of microcontroller programming, but i've run into a really fundamental problem. i get the following error when i attempt to use _BV to shift a shit and set port b pin 0 to output 4: undefined reference to `__stack' and here is my code #include int main(void){ while (1) { DDRB = _BV(PB0); }; } Yeah, well what else are you doing? What CPU? How are you specifying the CPU to the compiler? Who is complaining about __stack? My guess is that its the linker not the compiler and it has something to do with your CPU selection or failure to specify to both compiler and linker. Also use of _BV(PB0) is discouraged as its nothing more than (1
Re: [avr-gcc-list] very simple program
Timothy Smith wrote: i'm learning the in's and out's of microcontroller programming, but i've run into a really fundamental problem. i get the following error when i attempt to use _BV to shift a shit and set port b pin 0 to output 4: undefined reference to `__stack' and here is my code #include int main(void){ while (1) { DDRB = _BV(PB0); }; } ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list lol sorry it was not ment to say "shift a shit". send THAT one to bash.org or something. what i meant to say was "shift a BIT" ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
[avr-gcc-list] very simple program
i'm learning the in's and out's of microcontroller programming, but i've run into a really fundamental problem. i get the following error when i attempt to use _BV to shift a shit and set port b pin 0 to output 4: undefined reference to `__stack' and here is my code #include int main(void){ while (1) { DDRB = _BV(PB0); }; } ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list