[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
AW: [avr-gcc-list] avr-c++ static constructors in bootloader usage
From: |
Haase Bjoern (PT-BEU/EMT) |
Subject: |
AW: [avr-gcc-list] avr-c++ static constructors in bootloader usage |
Date: |
Wed, 20 Sep 2006 08:53:14 +0200 |
Is it possible that you forgot about setting the data direction register
properly?
I'd like to suggest that you have a look at the generated assembly code. E.g.
by excecuting
avr-objdump.exe -d myfile.elf
The place where the reset vector jumps to will first initialize RAM memory
contents and then jump to all of the static constructor functions (there is a
table with all of them in memory).
With a program as short as yours, you should easily be able to follow the code.
BTW. Main() probably never should be reached with your small program.
HTH,
Bjoern.
-----Ursprüngliche Nachricht-----
Von: address@hidden [mailto:address@hidden Im Auftrag von Jörg Diederich
Gesendet: Dienstag, 19. September 2006 16:09
An: address@hidden
Betreff: [avr-gcc-list] avr-c++ static constructors in bootloader usage
hello,
so i'm new to this list, a short hello (again) to everyone.
in using the at90can128, there's a problem with static constructors in
bootloaders. the following example does not work as expected.
#include <avr/io.h>
/*
PORTE rises a pin on my board. used to see what's happening
*/
class A {
public:
A(){
PORTE |= (1 << 7);
while(1);
}
};
A a_test ;
int
main(int argc, char** args)
{
PORTE |= (1 << 2);
while(1);
return 0;
}
both pins stay low. usart-output didn't work too.
adress of bootloader/text-section is 0x1E000. another possible start address
(0x1F000) doesn't change the problem,
never tryed last possible address (0x1F800), but i don't expect it to work
either.
trying to switch off most compiler options doesn't result in a change.
gcc version 4.1.1, avr-libc 1.4.4
there's a bug-report at http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29141 for
this.
bye Jörg
--
_______________________________________________
Get your free email from http://www.graffiti.net
Powered By Outblaze
_______________________________________________
AVR-GCC-list mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list