This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

why i cann't reference Vectors defined in .asm file?

Other Parts Discussed in Thread: TMS320C6457

platform:tms320c6457

I announce and define an  interrupt service table in Vectors.asm,  and in main.c,  i announce it by extern again, after this i set ISTP by this IST, but it report a error when compiling, it said:

unresolved symbol _vectors, first referenced in ./Source/Main.obj 

So my question is: where is wrong?

my program is as follow:

.global_vectors
.global_c_int00
.global_vector1
.global_vector2
.global_vector3
.global_c_int04
.global_vector5
.global_vector6
.global_vector7
.global_vector8
.global_vector9
.global_vector10
.global_vector11
.global_vector12
.global_vector13
.global_vector14
.global_vector15

.ref _c_int00
.ref _c_int04 ;ref the function defined in C file

VEC_ENTRY .macro addr
STW B0,*--B15
MVKL addr,B0
MVKH addr,B0
B B0
LDW *B15++,B0
NOP 2
NOP
NOP
.endm

_vec_dummy:
B B3
NOP 5



.sect".vecs"

.align 1024

_vectors:

_vector0: VEC_ENTRY _c_int00 ;RESET
_vector1: VEC_ENTRY _vec_dummy ;NMI
_vector2: VEC_ENTRY _vec_dummy ;
_vector3: VEC_ENTRY _vec_dummy ;
_vector4: VEC_ENTRY _c_int04 ;
_vector5: VEC_ENTRY _vec_dummy ;
_vector6: VEC_ENTRY _vec_dummy ;
_vector7: VEC_ENTRY _vec_dummy ;
_vector8: VEC_ENTRY _vec_dummy ;
_vector9: VEC_ENTRY _vec_dummy ;
_vector10: VEC_ENTRY _vec_dummy ;
_vector11: VEC_ENTRY _vec_dummy ;
_vector12: VEC_ENTRY _vec_dummy ;
_vector13: VEC_ENTRY _vec_dummy ;
_vector14: VEC_ENTRY _vec_dummy ;
_vector15: VEC_ENTRY _vec_dummy ;

extern cregister volatile unsigned int ISTP;
extern far void vectors(void);

void main(void)
{

ISTP = (unsigned int)(&vectors);

}

MEMORY
{
VECTORS: o = 0x00800000 l = 0x00000400 /*vectors*/
L2RAM: o = 0x00800400 l = 0x001FFC00 /* 2MB L2 Internal SRAM */
L1PRAM: o = 0x00E00000 l = 0x00008000 /* 32kB L1 Program SRAM/CACHE */
L1DRAM: o = 0x00F00000 l = 0x00008000 /* 32kB L1 Data SRAM/CACHE */
EMIFA_CE2: o = 0xA0000000 l = 0x00800000 /* 8MB EMIFA CE2 */
EMIFA_CE3: o = 0xB0000000 l = 0x00800000 /* 8MB EMIFA CE2 */
EMIFA_CE4: o = 0xC0000000 l = 0x00800000 /* 8MB EMIFA CE2 */
EMIFA_CE5: o = 0xD0000000 l = 0x00800000 /* 8MB EMIFA CE2 */
DDR2_CE0: o = 0xE0000000 l = 0x20000000 /* 512MB EMIFB CE0 */
}

  • Zhang Dexian,

    From where did you copy the code to start this vectors file? You have syntax errors that the assembler should have caught and you have logic errors that you will not find until you are debugging interrupt configuration problems or until you try to run from a standalone configuration. It is uncommon to use 100% SRAM in all internal memories.

    Please start with BIOS instead of generating your own assembly files from scratch or from another source. BIOS has been debugged already and will work. It will get out of your way if you do not want to use BIOS features, but it will also provide simple features like the interrupt service table.

    Which versions of CCS, CGT, and BIOS are you using?

    Regards,
    RandyP

  • Hi RandyP ,

    I never used BIOS before, so it may be more difficult for me than generating my own assembly files.

    Today, i try another way and  pass the compile, i declare Vectors in file main.c , define and ref it in file Vectors.asm,

    i don't understand the reason.

    CCS version is 5.2.1..

  • Zhang Dexian,

    It does not appear we can help you more on this thread. If you are finished here, please mark one of the posts with Verify Answer so we will know you are done. I assume you would mark your post above since it lists what you did to complete the compile.

    Regards,
    RandyP