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.

ASM文件调用

TI工程师你们好:       

         最近研究PCIE接口函数时,从官网提供的代码中下载了份代码,在向自己的工程中添加时发现一个PCIE_vectors.asm文件,不知道如何添加到自己的工程里,我们的工程没有这个汇编文件,环境用的CCS5.5,有个.cfg文件。下载的压缩包文件为K2_STK_DSP_v1.1.zip,想加入我们工程的文件所在压缩包的路径为K2_STK_DSP_v1.1\PCIE\src\PCIE_vectors.asm,能否支持下,如何将这个文件添加到我们的工程,让我们的工程代码调用这个汇编文件。

  • SYS/BISO自带vectors.asm路径在哪里,可否直接把这个PCIE_vectors.asm加入那个文件
  • sys/bios中断向量表是自动产生的,BIOS_init里的HWI_init会管理中断向量表,不需要用户自定义的中断向量表,一个程序里没法有两个中断向量表。
  • 你好那么官网下载的这个PCIE_vectors.asm文件如何添加修改呢才能让我的工程匹配这个中断向量表
  • PCIE_vectors.asm
    文件内容:
    ;create interrupt vector table for C6000 DSP
    ;--------------------------------------------------------------
    ;This file can be modified to add Interrupt Service Routine(ISR)
    ;for an interrupt, the steps are:
    ;1,reference to the externally defined ISR, for example
    ; .ref EDMA_ISR
    ;2,modify the corresponding entry in the interrupt vector table.
    ; For example, if interrupt 8 is used for EDMA, then you should
    ; modify the entry number 8 like below:
    ; VEC_ENTRY EDMA_ISR ;interrupt 8
    ;--------------------------------------------------------------
    ;Author: Brighton Feng
    ;Created on Feb 5, 2013
    ;Updated on 2013-2-8 for K2
    ;--------------------------------------------------------------

    ;reference to the externally defined ISR
    .ref _c_int00
    .ref PCIE0_MSI_ISR
    .ref PCIE1_MSI_ISR
    .ref PCIE_ERR_PMRST_ISR
    .ref Exception_service_routine
    .ref Nested_Exception_service_routine
    .ref exception_record
    .global vectors

    ;--------------------------------------------------------------
    .sect ".text"
    ;create interrupt vector for NMI
    NMI_ISR:
    STW B1,*-B15[1]

    ;save some key registers when exception happens
    MVKL exception_record,B1
    MVKH exception_record,B1

    STW B3, *+B1[0]
    STW A4, *+B1[1]
    STW B4, *+B1[2]
    STW B14, *+B1[3]
    STW B15, *+B1[4]

    ;jump to exception service routine
    MVKL Exception_service_routine, B1
    MVKH Exception_service_routine, B1
    B B1

    LDW *-B15[1],B1
    NOP 4

    ;--------------------------------------------------------------
    ;create interrupt vector for reset (interrupt 0)
    VEC_RESET .macro addr
    MVKL addr,B0
    MVKH addr,B0
    B B0
    MVC PCE1,B0
    NOP 4
    .align 32
    .endm

    ;create interrupt vector for other used interrupts
    VEC_ENTRY .macro addr
    STW B0,*--B15
    MVKL addr,B0
    MVKH addr,B0
    B B0
    LDW *B15++,B0
    NOP 4
    .align 32
    .endm

    ;create interrupt vector for unused interrupts
    VEC_DUMMY .macro
    unused_int?:
    B unused_int? ;dead loop for unused interrupts
    NOP 5
    .align 32
    .endm


    ;--------------------------------------------------------------
    ;interrupt vector table
    .sect "vecs"
    .align 1024

    vectors:
    VEC_RESET Nested_Exception_service_routine ;Nested exception
    VEC_ENTRY NMI_ISR ;NMI/Exception
    VEC_DUMMY ;RSVD
    VEC_DUMMY ;RSVD
    VEC_ENTRY PCIE0_MSI_ISR ;interrupt 4
    VEC_ENTRY PCIE_ERR_PMRST_ISR ;interrupt 5
    VEC_ENTRY PCIE1_MSI_ISR ;interrupt 6
    VEC_DUMMY ;interrupt 7
    VEC_DUMMY ;interrupt 8
    VEC_DUMMY ;interrupt 9
    VEC_DUMMY ;interrupt 10
    VEC_DUMMY ;interrupt 11
    VEC_DUMMY ;interrupt 12
    VEC_DUMMY ;interrupt 13
    VEC_DUMMY ;interrupt 14
    VEC_DUMMY ;interrupt 15

    .end
    这个文件如何添加呢。才能让PCIE中断服务函数生效
  • sys/bios中断的配置可以参考下面的wiki网站。
    processors.wiki.ti.com/.../Configuring_Interrupts_on_Keystone_Devices
x 出现错误。请重试或与管理员联系。