diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-02-24 02:28:51 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-02-24 02:28:51 +0000 |
commit | b62bf38e67060b929bbf443977339f244ef1438c (patch) | |
tree | d7ccab724a0ff951fd1759991f98ea9786c6572e /nuttx/arch/arm/src/lpc313x/lpc313x_boot.c | |
parent | d66059094e4e6204f8b7fc0844c41003e6768f11 (diff) | |
download | px4-nuttx-b62bf38e67060b929bbf443977339f244ef1438c.tar.gz px4-nuttx-b62bf38e67060b929bbf443977339f244ef1438c.tar.bz2 px4-nuttx-b62bf38e67060b929bbf443977339f244ef1438c.zip |
Fix init of vector table
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2540 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src/lpc313x/lpc313x_boot.c')
-rwxr-xr-x | nuttx/arch/arm/src/lpc313x/lpc313x_boot.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/nuttx/arch/arm/src/lpc313x/lpc313x_boot.c b/nuttx/arch/arm/src/lpc313x/lpc313x_boot.c index 5fe8a34d2..cc4a89f44 100755 --- a/nuttx/arch/arm/src/lpc313x/lpc313x_boot.c +++ b/nuttx/arch/arm/src/lpc313x/lpc313x_boot.c @@ -238,14 +238,29 @@ static void up_vectormapping(void) static void up_copyvectorblock(void) { + /* Copy the vectors into ISRAM at the address that will be mapped to the vector + * address: + * + * LPC313X_VECTOR_PADDR - Unmapped, physical address of vector table in SRAM + * LPC313X_VECTOR_VSRAM - Virtual address of vector table in SRAM + * LPC313X_VECTOR_VADDR - Virtual address of vector table (0x00000000 or 0xffff0000) + */ + uint32_t *src = (uint32_t*)&_vector_start; uint32_t *end = (uint32_t*)&_vector_end; - uint32_t *dest = (uint32_t*)LPC313X_VECTOR_VADDR; + uint32_t *dest = (uint32_t*)LPC313X_VECTOR_VSRAM; while (src < end) { *dest++ = *src++; } + + /* Then set the LPC313x shadow register, LPC313X_SYSCREG_ARM926SHADOWPTR, so that + * the vector table is mapped to address 0x0000:0000 - NOTE: that there is not yet + * full support for the vector table at address 0xffff0000. + */ + + putreg32(LPC313X_VECTOR_PADDR, LPC313X_SYSCREG_ARM926SHADOWPTR); } /************************************************************************************ |