Hello, I need some help resolving a problem with the timer interrupt service vector. At this time, I would like to learn as much as possible about the TMS320C55xx family so I am intentionally excluding any CSL or DSP/BIOS methods. So far I have taken the time to read many vector/interrupt posts on this forum and all of the support literature (SPRUH87F, SPRU280I, SWPU073e, etc.). The problem I am encountering is all but the reset vector, _c_int00 at address 0xFFFF00 (ROM) is being written incorrectly (or never written). But before I continue, let me give some information about my setup:
IDE: Code Composer Studio V6.1.2.00015
DSP processor: TMS320C5535
Dev Hardware Platform: TMS320C5535 eZdsp USB kit
This is what I have done so far:
- Copied a ‘vector.asm’ example file (mnemonic type) and modified it to include a .ref _timerISR symbol so the compiler knows the _timerISR symbol is defined in another file (‘main.c’). Added the ‘vector.asm’ file to the project.
- In ‘main.c’, configured Timer0 to interrupt once every 100,000 cycles of the system clock.
- In ‘main.c’ created a subroutine called ‘interrupt void timerISR()’ using the keyword interrupt, also included a prototype declaration for this subroutine.
- Complied the project. No errors reported.
- Loaded the assembled code into dev platform to be debugged. Proceeded to the ‘Memory Browser’ to validate the interrupt vector table located at ROM (PROGRAM) address 0xFFFF00. This is where I notice only the Reset has a valid 8-byte entry?
----- ‘vectors.asm’ --------------------
.ref _c_int00
.ref _timerISR
.sect "vectors"
.align 256
.global _VECSTART
.global _Reset
_VECSTART:
_Reset: .ivec _rst_isr,USE_RETA ; ISR-Nr. 0, Prio 0, Reset Interrupt
NMI: .ivec nmi_isr ; ISR-Nr. 1, Prio 1, Nonmaskable Interrupt
INT0: .ivec int0_isr ; ISR-Nr. 2, Prio 3, External User Interrupt #0
INT1: .ivec int1_isr ; ISR-Nr. 3, Prio 5, External User Interrupt #1
TINT: .ivec timer_isr ; ISR-Nr. 4, Prio 6, Timer #0
…
.text
_rst_isr: B _c_int00
nmi_isr: B nmi_isr
int0_isr: B int0_isr
int1_isr: B int1_isr
timer_isr: B _timerISR
…
.text
no_isr: B no_isr ; error irq handler
----- ‘main.c’ --------------------
// ***** Prototype declarations *****
void timerISR();
…
// ***** Timer 0 configuration *****
*TIMPRD1 = 0x86A0; // Period counter = 0x186A0 (100,000)
*TIMPRD2 = 0x0001;
*TIMCNT1 = 0x86A0; // Reset Timer 0 Count Down Register
*TIMCNT2 = 0x0001;
*TIAFR = 0; // Reset Aggregate Timer interrupt flags (Timer 0, Timer 1, Timer 2)
*IFR0 &= ~TINT; // Reset Timer global interrupt flag
*IER0 |= 0x0010; // Enable Timer interrupts
*TCR = 0x8003; // Enable Timer, Prescale divider=0, Auto reload
*ST1_55 &= ~INTM; // Enable global interrupts
…
/********************
* ISR: Timer
* ****************** */
interrupt void timerISR()
{
*ST1_55 |= INTM; // Disable global interrupts
*ST1_55 ^= XF_LED; // Toggle XF port (Grn Led)
*TIAFR = 0; // Reset aggregate timer interrupt flags (0, 1, 2)
*IFR0 &= ~TINT; // Reset Timer global interrupt flag
*ST1_55 &= ~INTM; // Enable global interrupts
}
**** Build of configuration Debug for project Led ****
"C:\\ti\\ccsv6\\utils\\bin\\gmake" -k all
'Building file: ../main.c'
'Invoking: C5500 Compiler'
"C:/ti/ccsv6/tools/compiler/c5500_4.4.1/bin/cl55" -v5515 --memory_model=large -g --define=c5535 --display_error_number --diag_warning=225 --ptrdiff_size=16 --asm_source=mnemonic --asm_listing --preproc_with_compile --preproc_dependency="main.pp" "../main.c"
'Finished building: ../main.c'
' '
'Building file: ../vectors.asm'
'Invoking: C5500 Compiler'
"C:/ti/ccsv6/tools/compiler/c5500_4.4.1/bin/cl55" -v5515 --memory_model=large -g --define=c5535 --display_error_number --diag_warning=225 --ptrdiff_size=16 --asm_source=mnemonic --asm_listing --preproc_with_compile --preproc_dependency="vectors.pp" "../vectors.asm"
'Finished building: ../vectors.asm'
' '
'Building target: Led.out'
'Invoking: C5500 Linker'
"C:/ti/ccsv6/tools/compiler/c5500_4.4.1/bin/cl55" -v5515 --memory_model=large -g --define=c5535 --display_error_number --diag_warning=225 --ptrdiff_size=16 --asm_source=mnemonic --asm_listing -z -m"Led.map" --stack_size=0x200 --heap_size=0x400 -i"C:/ti/ccsv6/tools/compiler/c5500_4.4.1/lib" -i"C:/ti/ccsv6/tools/compiler/c5500_4.4.1/include" --reread_libs --display_error_number --warn_sections --xml_link_info="Led_linkInfo.xml" --rom_model --sys_stacksize=0x200 -o "Led.out" "./main.obj" "./vectors.obj" "../C5535.cmd" -l"C:\ti\ccsv6\tools\compiler\c5500_4.4.1\lib\libc.a"
<Linking>
'Finished building target: Led.out'
' '
**** Build Finished ****
----- Loading the .out code into the dev platform ---------------------
From the ROM Memory Browser, the TINT vector is the same as all of the other unused interrupts, so clearly there is something wrong. Not sure where to go from here, so any comments are greatly welcomed.
Thanks for everyone’s time.
Bill