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.

关于SYS/BIOS的中断

Other Parts Discussed in Thread: SYSBIOS

/*
 *  ======== main.c ========
 */

#include <xdc/std.h>

#include <xdc/runtime/Error.h>
#include <xdc/runtime/System.h>

#include <ti/sysbios/BIOS.h>

#include <ti/sysbios/knl/Task.h>
#include <ti/sysbios/hal/Hwi.h>

/*
 *  ======== taskFxn ========
 */
Void taskFxn(UArg a0, UArg a1)
{
    System_printf("enter taskFxn()\n");

    Task_sleep(10);

    System_printf("exit taskFxn()\n");
}


void int_test()
{
    System_printf("enter int()\n");
}


/*
 *  ======== main ========
 */
Int main()
{ 
    Task_Handle task;
    Error_Block eb;

    Hwi_Handle myHwi;
    Error_init(&eb);
    myHwi = Hwi_create(4, int_test, NULL, &eb);

    if (myHwi == NULL) {
    System_abort("Hwi create failed");
    }

    System_printf("enter main()\n");

    Error_init(&eb);
    task = Task_create(taskFxn, NULL, &eb);
    if (task == NULL) {
        System_printf("Task_create() failed!\n");
        BIOS_exit(0);
    }
    //UInt Hwi_enable();
    BIOS_start();    /* does not return */
    return(0);
}

这是一个简单的程序,ISR应该响应INT4,但是我在INT5给Pin Connect一个中断后,居然也会响应中断!

看Map文件:

c0014800 _ti_sysbios_family_c64p_Hwi0
c0014800 _ti_sysbios_family_c64p_Hwi_int0
c0014820 _ti_sysbios_family_c64p_Hwi_int1
c0014840 _ti_sysbios_family_c64p_Hwi_int2
c0014860 _ti_sysbios_family_c64p_Hwi_int3
c0014880 _ti_sysbios_family_c64p_Hwi_int4
c00148a0 _ti_sysbios_family_c64p_Hwi_int5
c00148c0 _ti_sysbios_family_c64p_Hwi_int6
c00148e0 _ti_sysbios_family_c64p_Hwi_int7
c0014900 _ti_sysbios_family_c64p_Hwi_int8
c0014920 _ti_sysbios_family_c64p_Hwi_int9
c0014940 _ti_sysbios_family_c64p_Hwi_int10
c0014960 _ti_sysbios_family_c64p_Hwi_int11
c0014980 _ti_sysbios_family_c64p_Hwi_int12
c00149a0 _ti_sysbios_family_c64p_Hwi_int13
c00149c0 _ti_sysbios_family_c64p_Hwi_int14
c00149e0 _ti_sysbios_family_c64p_Hwi_int15

这个HWI0是什么?

中断向量这里是这样的:

.vecs 0 c0014800 00000200
c0014800 00000200 app_p674.o674 (.vecs)

我对SYS/BIOS的中断管理有点糊涂!这方面资料太少了!

请TI技术支持解答一二,顺便推荐点儿资料吧!

  • myHwi = Hwi_create(4, int_test, NULL, &eb);

    首先NULL参数不合适吧,这里的params.eventId要赋值为事件号。

    建议用图形界面配置先把中断跑起来验证一下

    Pin connect是什么意思?

  • Pin connect是用一个TXT文件模拟中断,我的整个程序都在模拟器跑的,不是真的芯片。

    我对SYS/BIOS的 HWI很迷惑,在图形界面也可以配置HWI,在程序中也可以配置,这有什么区别呢?

    能推荐一些资料么?