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.

写中断函数的时候 vectors.asm 文件有什么用,还有导入vectors.asm 文件到工程中 报错,此时的cmd文件如何修改?

Expert 2137 points

写中断函数的时候 vectors.asm 文件有什么用,还有导入vectors.asm 文件到工程中 报错,此时的cmd文件如何修改?

  • 中断函数跟中断向量表挂钩的。

    从错误提示看,是分配的memory放不下vectors段。你把完整的错误信息贴出来。 

  • 你要注意你的配置是否适合将vector放到0xffff00

  • 我使用的cmd 配置文件就是官方提供的,我写串口接收中断时,需要添加vectors.asm文件吗?vectors.asm文件时做什么用的? 我就是添加了vectors.asm文件就会出现内存不足的错误!

  • 先看一下文档swpu073e里的interupt章节,了解一下中断的基本原理。

    5.2 Interrupt Vectors and Priorities
    The TMS320C55x DSP supports 32 interrupt service routines (ISRs). After
    receiving and acknowledging an interrupt request, the CPU generates an
    interrupt vector address. At the vector address, the CPU fetches the vector that
    points to the corresponding ISR. When multiple hardware interrupts occur
    simultaneously, the CPU services them one at a time, according to their
    predefined hardware interrupt priorities. Table 5−1 shows the vectors sorted
    by ISR number. Table 5−2 shows the vectors sorted by priority. Both tables
    show only a general representation of the C55x DSP vectors. To see which
    interrupt corresponds to each of the vectors, see the data manual for your
    C55x DSP.
    You must write the desired interrupt vectors (ISR start address) at the vector
    addresses. Each interrupt vector must contain 8 bytes. Byte 0 of the reset
    vector contains the setting for the stack mode. Byte 0 of the remaining vectors
    is ignored. Bytes 1−3 encode the 24-bit byte address of the interrupt service
    routine (ISR). Bytes 4−7 must be filled with NOP instructions.
    Vector pointers IVPD and IVPH point to up to 32 interrupt vectors in program
    space. IVPD points to the 256-byte program page for interrupt vectors 0–15
    and 24–31. IVPH points to the 256-byte program page for interrupt vectors
    16–23. Refer to chapter 2, CPU Registers, for a detailed description of
    these registers.

  • 老师 我中断原理我懂,只是不熟悉ccs的编译环境,所以问你写UART接收中断函数的时候需要用到vectors.asm吗?若是用到vectors.asm做什么的用?我是使用c语言编译的

  • 你这cmd文件是哪里的?

    用csl库例程里的cmd文件,你的cmd文件MEMORY分得太细。

  • 既然懂中断原理,那么中断来了后,要跳到中断向量,没有中断向量表的话,能行吗?当然要vectors.asm了,vectors.asm就是一个中断向量表而已。向量表有自己的格式要求,用汇编实现是最简单的方法。