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.

求助:sysbios中, Hwi_create函数一直阻塞不返回

Other Parts Discussed in Thread: TMS320DM8148, SYSBIOS

求助:

     我最近在编写TMS320DM8148的DSP代码时遇到了个问题。想通过中断获取EDMA传输结束状态,可是在使用Hwi_create函数后,Hwi_create函数阻塞在哪里不继续运行,代码如下

#define EDMA_COMPLETION_HWI_ID     20

void hwi_init(Error_Block *err)

 Hwi_Params hwiParams;  

 DEBUG("---> hwi init !\r\n");

 Hwi_Params_init(&hwiParams);  

 hwiParams.arg = EDMA_COMPLETION_HWI_ID;  

 hwiParams.eventId = EDMA_COMPLETION_HWI_ID;  

 hwiParams.enableInt = FALSE;

 DEBUG("---> hwi_create ! !\r\n");  

 hwi0 = Hwi_create(EDMA_COMPLETION_HWI_ID, completion_hwi_handle, &hwiParams, err);  

 if (hwi0 == NULL) {   

     DEBUG("Hwi create failed");

 }

 DEBUG("hwi create ok !\r\n");

}

DEBUG是我通过串口实现的printf功能,在串口中只能看到 ---> hwi init ! 和 ---> hwi_create的打印,然后程序就不继续执行了,在.cfg 文件中使用的xdc.useModule("ti.sysbios.family.c64p.Hwi");  头文件包含的是#include <ti/sysbios/family/c64p/Hwi.h>。

我使用的EZSDK5.05.2.00,代码是通过修改syslink的example编译和运行的。

因为刚接触TMS320DM8148,所以对这个问题毫无头绪,望大家多多帮忙解决这个问题,谢谢!

  • Liu Han,

    han liu2 说:

     hwiParams.arg = EDMA_COMPLETION_HWI_ID;  

     hwiParams.eventId = EDMA_COMPLETION_HWI_ID;  

     hwiParams.enableInt = FALSE;

    去掉这部分配置,是否有改善?

    另,能否在CCS下静态创建hwi(配置cfg文件)?

  • Chris Meng 您好:

        十分感谢您的回复,我按照您的提示做了如下尝试。

    1、去掉hwiParams没有改善

    2、我在.cfg 文件总增加如下代码

    var Hwi = xdc.useModule('ti.sysbios.family.c64p.Hwi');

    var hwiParams = new Hwi.Params;

    Program.global.hwi0 = Hwi.create(20, '&completion_hwi_handle', hwiParams);

    但是产生这个错误:

    configuring isp.xe674 from package/cfg/isp_pe674.cfg ... js: "/home/lsh/share/ti-ezsdk_dm814x-evm_5_05_02_00/dsp-devkit/packages/ti/sysbios/family/c64p/Hwi.xs", line 253: XDC runtime error: ti.sysbios.family.c64p.Hwi/interrupt: index out of range (20)

    id = 20 是我在 DM8148 Table 1-97. C674x INTC Default Interrupt Mapping 找到的EDMA3CC的中断号,难道是我理解错误吗?

    3、我是刚接触TI的XDCtools的,为了快速上手我选择直接在EZSDK的syslink 例程修改代码用来测试硬件功能,我现在比较担心的是,我的一些编译参数错误而导致的这个问题,所以请您看一下下列编译参数配置是否正确。

    SYSLINK_INSTALL_DIR = /ti-ezsdk_dm814x-evm_5_05_02_00/component-sources/syslink_2_20_02_20/packages;

    BIOS_INSTALL_DIR = /ti-ezsdk_dm814x-evm_5_05_02_00/dsp-devkit/packages;

    IPC_INSTALL_DIR = /ti-ezsdk_dm814x-evm_5_05_02_00/component-sources/ipc_1_24_03_32/packages;

    XDC_INSTALL_DIR = /ti-ezsdk_dm814x-evm_5_05_02_00/component-sources/xdctools_3_23_03_53/packages

    CGTOOLS = /ccs/ccs_install/ccsv6/tools/compiler/c6000_7.4.14

    CC = $(CGTOOLS)/bin/cl6x -c

    AR = $(CGTOOLS)/bin/ar6x rq

    LD = $(CGTOOLS)/bin/lnk6x --abi=eabi

  • Liu Han,

    请参考https://e2e.ti.com/support/embedded/tirtos/f/355/t/122376

    It turns out that all the peripheral events can be user programmed to one of 12 CPU interrupts (INT4 through INT15). This is documented in the DSP megamodule guide (SPRUFK5). We simply have to set the event number for the SPI1 peripheral (43 from the device data sheet) into the correct field of the INTMUX registers. I have used INT5 so I need to poke 43 into bits 14-8 of INTMUX1.

  • Chris Meng,

    问题以及解决,非常感谢。

  • 你好,我现在在做c6748的UPP传输,在使用hwi中断时也出现了和你一样的问题,即hwi_create一直卡着这里。请问你最后是怎么解决的,谢谢。