This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Thumb / exception
- From: "Eric de Jong" <list_ericdejong_10 at gmx dot net>
- To: <ecos-discuss at sources dot redhat dot com>
- Date: Thu, 10 Jun 2004 09:06:21 +0200
- Subject: Re: [ECOS] Thumb / exception
- References: <1086695874.6963.11.camel@linux.local>
- Reply-to: "Eric de Jong" <list_ericdejong_10 at gmx dot net>
>> What can I do to get a stable application without disabling interrupts?
This is a difficult bug to track.
To be complete, your processor is an atmel arm AT91R40008.
You can find the interrupt code is in vectors.S
As I see it, the problem can be the following
- your application (let's assume it is not)
- stack overflow
The interrupt stack is smaller if you compile your code without a debugger. Check vectors.S for this, see
label __startup_stack_base, __interrupt_stack_base, __exception_stack_base, __GDB_stack_base, cyg_interrupt_stack
Try enlarging these stacks. make sure to rebuilt your ecos library from scratch to make sure vectors.S is recompiled.
(delete your xx_build and xx_install directory).
- stack corruption
If this is not due to a stack overflow, this will be hard to track
- register corruption
Are all registers saved in thumb mode? While thumb cannot access registers r8+ directly, some commands do use them, thus
they must be saved during interrupts. As I can see, they are all saved during interrupts, so this should not be a
problem.
Note: If I do not react to other mail, it is not only because your problem is too difficult, but because I am on
holliday for a week :-)
Eric.
----- Original Message -----
From: "Sven Rehfuss"
Sent: Tuesday, June 08, 2004 1:57 PM
Subject: [ECOS] Thumb / exception
Hello,
I think I found something strange:
First I got exceptions using a library which uses the new-operator very
often.
These exceptions are thrown by the new operator because malloc returns a
NULL pointer. This is OK because new wanted to allocate several GByte of
memory. The problem is that registers and variables on the stack are
changed outside the corresponding routines. I think it is the interrupt
routine because if I disable interrupts before and enable them after the
call to the library, the application is stable.
eCos, the library and my application are all thumb, using arm-elf-gcc
3.3.3, newlib 1.12.0 and the latest cvs.
What can I do to get a stable application without disabling interrupts?
Regards,
Sven Rehfuß
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss