I've been trying for some days to get a C++ project running.
Unfortunately, there appears to be a problem with the board startup
script and the linker script which were provided and are propably
generated. These files we initially not intended to incorporate C++ code
so now we're trying to adapt them to do just that. We are also using
freeRTOS. I attached the code of the two files
/* Useless instruction for referencing the .vectors section */
/* Set pc to actual code location (i.e. not in remap zone) */
/* Initialize the prerelocate segment */
/* Perform low-level initialization of the chip using LowLevelInit() */
/* Initialize the postrelocate segment */
/* Clear the zero segment */
/* Setup stacks
/* IRQ mode */
/* Supervisor mode (interrupts enabled) */
/* Call static constructors */
movlr,pc/* set the return address */
bxr0/* the target code can be ARM or THUMB */
/* Branch to main()
/* Loop indefinitely when program is finished */
Do you have any idea why are program is crashing randomly? Right now it
always crashes and jumps to an adress it is not intended to be. I
attached the dissassembly when this happends while debugging.
My guess is that this relates to the two files shown above. Maybe
something is missing so that C++ is working properly? The program
crashes when the freeRTOS task scheduler has already started. I hope
someone has a clue how to get this working. Especially someone who
managed to get C++ working on ARM processors. Thanks a lot in advance !
The program does not crash anymore when I comment out code related to
hardware drivers. The program does not crash when performing these
functions but crashes at the adresses I have shown in the 2 pictures.
This is really confusing.
I use the AT91SAM9G20-EK board and provided drivers. This is inside a
function which is called by performOperation() which crashed
AT91S_USART*rs232;// do not initialize this register handle, causes problems !