Sunday, July 19, 2015

Phase 1: Interrupt Vector Table not being initialized

the offending lines are in egwu_setup_nvic(). here is the gdb dump:

target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x1fff0080 msp: 0x10001ffc
(gdb) load
Loading section .text, size 0x1c78 lma 0x10000000
Start address 0x10000e38, load size 7288
Transfer rate: 1 KB/sec, 3644 bytes/write.
(gdb) c
Continuing.

Breakpoint 1, egwu_setup_nvic () at core/IE_egwu_setup.c:167
167        ptrTemp = (volatile unsigned int *)EGWU_IVT;
(gdb) p /x EGWU_IVT
$1 = 0x10010000
(gdb) monitor mdw 0x10000000
0x10000000: 10010000
(gdb) monitor mdw 0x10000004
0x10000004: 10000e39
(gdb)

And of course EGWU_IVT is declared in IE_egwu_ivt.S. This is where the vector table is placed along with the labels EGWU_IVT and EGWU_IVT_END. I also created an extern int EGWU_IVT in IE_setup.h

But the value of the label EGWU_IVT resolves to the first value in the table (the address of the stack pointer on reset). but in the map file flash.map

 .text        0x0000000010000000       0xe0 ivt.o
                0x0000000010000000                EGWU_IVT
                0x00000000100000e0                EGWU_IVT_END


Just now noticed that &EGWU_IVT resolves to 0x10000000 as expected.

(gdb) p /x &EGWU_IVT
$2 = 0x10000000


Very odd, will need to go reread the "as" assembler documentation. Its customary for the value of a label to represent the value of the location counter at that point.


Anyway this is resolved ... moving on

No comments:

Post a Comment