This is the mail archive of the
ecos-devel@sourceware.org
mailing list for the eCos project.
Minor fix for CortexM vectors.S
- From: Chris Holgate <chris at zynaptic dot com>
- To: ecos-devel at ecos dot sourceware dot org
- Date: Tue, 18 Nov 2008 11:47:34 +0000
- Subject: Minor fix for CortexM vectors.S
- Organization: Zynaptic Limited
Hi folks,
This is a minor fix that I found while building the ROM based target for
my STM32 board. The hal_switch_state_vsr can generate invalid
EXC_RETURN values in the link register for certain alignments - the fix
is to ensure that bit 1 is always cleared. It's also possible to
reclaim a bit of RAM for the interrupt stack:
*** cvs-14.11.08/ecos/packages/hal/cortexm/arch/current/src/vectors.S
2008-11-03 14:53:51.000000000 +0000
---
working-14.11.08/ecos/packages/hal/cortexm/arch/current/src/vectors.S
2008-11-18 11:10:31.000000000 +0000
***************
*** 129,140 ****
--- 129,142 ----
isb // Insert a barrier
msr psp,sp // Copy SP to PSP
+ ldr sp,=hal_startup_stack // Reset SP to top of RAM
#if !defined(CYGPKG_KERNEL)
sub sp,#(CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE/2)
#endif
orr lr,#0xD // Adjust return link
+ bic lr,#0x2
bx lr // Return to init code on PSP
Chris.