Hello,
I am programming my MSP430F1611 with assembler using the msp430-toolchain on
OpenSuse 10.3 and cannot get interrupt vector table set up in the µC. I have an
OLIMEX dev board connected via JTAG, my application is supposed to blink a led
on port P6.0 every second using the timerA0 CCR0 interrupt in up mode. After
downloadingt the code to the µC using msp430-jtag, all interrupt vector
addresses are set to 0xFFFF. The program works if I manually set interrupt
vector addresses with the debugger. What is the problem????
In my assembler code (main.S) I set up section .vectors as this:
.section .vectors
.ORG DACDMA_VECTOR,0xFF
.word DACDMA_VECTOR_ISR ; 0xFFE0 DAC12/DMA
.org PORT2_VECTOR,0xFF
.word PORT2_VECTOR_ISR ; 0xFFE2 Port 2
.org USART1TX_VECTOR,0xFF
.word USART1TX_VECTOR_ISR ; 0xFFF4 USART 1 Transmit
.org USART1RX_VECTOR,0xFF
.word USART1RX_VECTOR_ISR ; 0xFFF6 USART 1 Receive
.org PORT1_VECTOR,0xFF
.word PORT1_VECTOR_ISR ; 0xFFE8 Port 1
.org TIMERA1_VECTOR,0xFF
.word TIMERA1_ISR ; 0xFFEA Timer A CC1-2, TA
.org TIMERA0_VECTOR,0xFF
.word TIMERA0_ISR ; 0xFFEC Timer A CC0
.org ADC12_VECTOR,0xFF
.word ADC12_VECTOR_ISR ; 0xFFEE ADC
.org USART0TX_VECTOR,0xFF
.word USART0TX_VECTOR_ISR ; 0xFFF0 USART 0 Transmit
.org USART0RX_VECTOR,0xFF
.word USART0RX_VECTOR_ISR ; 0xFFF2 USART 0 Receive I2C tx/rx
.org WDT_VECTOR,0xFF
.word WDT_VECTOR_ISR ; 0xFFF4 Watchdog Timer
.org COMPARATORA_VECTOR,0xFF
.word COMPARATORA_VECTOR_ISR ; 0xFFF6 Comparator A
.org TIMERB1_VECTOR,0xFF
.word TIMERB1_VECTOR_ISR ; 0xFFF8 Timer B CC1-2, TB
.org TIMERB0_VECTOR,0xFF
.word TIMERB0_ISR ; 0xFFFA TIMER B CC0
.org NMI_VECTOR,0xFF
.word NMI_ISR ; 0xFFFC Non maskable
.org RESET_VECTOR,0xFF
.word RESET ; POR, external RST, Watchdog
To compile I use the following commands:
msp430-gcc -mmcu=msp430x1611 -o blink1s.elf main.o
msp430-gcc -mmcu=msp430x1611 -nostartfiles -nostandartlibs -o blink1s.elf
main.o
Then I generate an assembler listing with:
msp430-objdump -DS blink1s.elf >blink1s.lst
At the end of blink1s.lst I can find my interrupt vector table, which I believe
is correct:
Disassembly of section .vectors:
0000ffe0 <_vectors_end-0x20>:
ffe0: 52 40 interrupt service routine at 0x4052
ffe2: 58 40 interrupt service routine at 0x4058
ffe4: 5e 40 interrupt service routine at 0x405e
ffe6: 64 40 interrupt service routine at 0x4064
ffe8: 6a 40 interrupt service routine at 0x406a
ffea: 70 40 interrupt service routine at 0x4070
ffec: 76 40 interrupt service routine at 0x4076
ffee: 7a 40 interrupt service routine at 0x407a
fff0: 80 40 interrupt service routine at 0x4080
fff2: 86 40 interrupt service routine at 0x4086
fff4: 8c 40 interrupt service routine at 0x408c
fff6: 92 40 interrupt service routine at 0x4092
fff8: 98 40 interrupt service routine at 0x4098
fffa: 9c 40 interrupt service routine at 0x409c
fffc: a0 40 interrupt service routine at 0x40a0
fffe: 00 40 interrupt service routine at 0x4000
I load the program into the µC with:
msp430-jtag -e blink1s.elf ---> no errors, but no blinking!
Then I use ddd to debug with msp430-gdb over LPT1 (parport0):
ddd --debugger msp430-gdb connect to the µC via JTAG and see the following:
GNU DDD 3.3.11 (i386-suse-linux-gnu), by Dorothea Lütkehaus and Andreas Zeller.
Copyright © 1995-1999 Technische Universität Braunschweig, Germany.
Copyright © 1999-2001 Universität Passau, Germany.
Copyright © 2001 Universität des Saarlandes, Germany.
Copyright © 2001-2004 Free Software Foundation, Inc.
(gdb) target remote localhost:2000
Remote debugging using localhost:2000
0x0000ffff in ?? ()
The last line means the µC stopped program execution at addres 0xffff,right?
I figured out with:
disassemble 0xffe0 0xffff:
(gdb) disassemble 0xffe0 0xffff
Dump of assembler code from 0xffe0 to 0xffff:
0x0000ffe0: interrupt service routine at 0xffff
0x0000ffe2: interrupt service routine at 0xffff
0x0000ffe4: interrupt service routine at 0xffff
0x0000ffe6: interrupt service routine at 0xffff
0x0000ffe8: interrupt service routine at 0xffff
0x0000ffea: interrupt service routine at 0xffff
0x0000ffec: interrupt service routine at 0xffff
0x0000ffee: interrupt service routine at 0xffff
0x0000fff0: interrupt service routine at 0xffff
0x0000fff2: interrupt service routine at 0xffff
0x0000fff4: interrupt service routine at 0xffff
0x0000fff6: interrupt service routine at 0xffff
0x0000fff8: interrupt service routine at 0xffff
0x0000fffa: interrupt service routine at 0xffff
0x0000fffc: interrupt service routine at 0xffff
0x0000fffe: interrupt service routine at 0xffff
End of assembler dump.
that the interrupt vectors all point to 0xffff. So the µC starts up immediatly
vectors to 0xffff, and hangs itself.
I am pretty sure, that my setup routines work because if I:
(gdb) set *0xfffe=0x4000
(gdb) set *0xffec=0x4076
(gdb) monitor reset
The program works and blinks the LED every second.
Why does the interrupt vector table gets initialized with 0xffff despite the
fact that the objectdump shows that the object file contains the rigth values??
Any ideas and or hints are greatly appreciated.
Cheers
Kruwakre
--
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger?did=10