Thanks Dan,
Already did this.
The problem is when I use a class the system goes crazy.
Added this code to board_startup.S for initializing the constructors
/* call C++ constructors of global objects */
LDR r0, =__ctors_start__
LDR r1, =__ctors_end__
ctor_loop:
CMP r0, r1
BEQ ctor_end
LDR r2, [r0], #4
STMFD sp!, {r0-r1}
MOV lr, pc
BX r2
LDMFD sp!, {r0-r1}
B ctor_loop
ctor_end:
/* Branch to main() */
to the linker file I've added
. = ALIGN(0x4);
PROVIDE(__ctors_start__ = .);
KEEP (*crtbegin.o(.ctors))
KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*crtend.o(.ctors))
PROVIDE(__ctors_end__ = .);
. = ALIGN(4);
_efixed = .;
And made a small class like this
class TOptel
{
public :
int getal;
TOptel()
{
getal = 0;
}
void Task()
{
getal++;
}
};
extern TOptel Optel;
I've verified the calling of the constructor for this class.
A simple debug print in the constructor and i see the text.
So it is called.
The main loop is like this
int main()
{
unsigned long teller = 0;
// setup debug port
DBGU_Configure( DBGU_STANDARD, 115200, BOARD_MCK );
LED_Configure( LED_YELLOW );
// Optel.Task();
// the main loop
while( 1 )
{
teller ++;
if( teller >= 5000000 )
{
teller = 0;
LED_Toggle( LED_YELLOW );
DBGU_PutChar('"x' );
}
}
}
Normally this put an X on the terminal window every second or so.
As soon as I uncomment the line Optel.Task();
The terminal window is filled with X's.
And the delay is no more there
What is the problem here, what am I doing wrong ???
Thanks for any help,
Gene

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )