TI中文支持网
TI专业的中文技术问题搜集分享网站

doorbell中断问题,每个20msFPGA发一次doobell,但是DSP这边只执行了一次,doorbell的isr

ISR

Void FpgaDioTxCompletionIsr
(
UArg argument
//UArg arg0, UArg arg1
)
{
//使主机中断失效
CpIntc_disableHostInt(0,8);
//清除系中断
CpIntc_clearSysInt(0,112);
//使能主机中断
CpIntc_enableHostInt(0,8);

g_InterruptCount++;
Uint16 doorbellStatus;
DEVICE_REG32_W(0x10800080,g_InterruptCount);
/* Pass the control to the driver DIO Tx Completion ISR handler */
// Srio_dioTxCompletionIsr ((Srio_DrvHandle)argument, hSrioCSL);//该行代码DSP应用程序通过直接io方式发送数据时,由中断ISR调用

//FPGA中断足够快的话是否会丢失中断?

CSL_SRIO_GetDoorbellPendingInterrupt (hSrioCSL, 0, &doorbellStatus);
//CSL_SRIO_SetInterruptPacing (hSrio, 0, 0xFFFFFFFF);

//UInt32 uiSegNum;
switch(doorbellStatus)
{
case 1:
DEVICE_REG32_W(0x10800084,0xABAB4141);
//printf("doorbell 1 ok!");
break;
case 2:
DEVICE_REG32_W(0x10800088,0XABAB4142);
//printf("doorbell 2 ok!");
break;
case 4:
DEVICE_REG32_W(0x1080008C,0XABAB4143);
//System_printf("doorbell 4 ok!");
break;
case 8:
DEVICE_REG32_W(0x10800090,0XABAB4144);
//printf("doorbell 8 ok!");
break;
case 16:
DEVICE_REG32_W(0x10800094,0XABAB4148);
//printf("doorbell 16 ok!");
break;
case 32:
DEVICE_REG32_W(0x10800098,0XABAB4150);
//printf("doorbell 32 ok!");
break;
case 64:
DEVICE_REG32_W(0x1080009C,0XABAB4151);
//printf("doorbell 64 ok!");
break;
case 128:
DEVICE_REG32_W(0x108000A0,0XABAB4153);
//printf("doorbell 128 ok!");
break;
default:
DEVICE_REG32_W(0x108000A4,0XABAB4154);
//printf("doorbell not ok!");
break;
}

// System_printf("waiting for doorbell!\n");
CSL_SRIO_ClearDoorbellPendingInterrupt (hSrioCSL, 0, doorbellStatus);

return;
}

Nancy Wang:

Please note, interrupt pacing is enabled by default. Interrupt pacing requires DSP core rewrite INTDSTn_RATE_CNT register after each interrupt service to enable the next interrupt, otherwise, the interrupt will not be trigger again regardless of the internal interrupt status changes. This is the common reason user only sees one SRIO interrupt. If interrupt pacing is not desired for a particular INTDST, it can be disabled using INTDST_RATE_DIS register.
doorbell中断是映射到INTDST0 – INTDST15吗?是不是跟INTDSTn_RATE_CNTL 有关?
srio user guide里面也有讲。

user5301336:

回复 Nancy Wang:

doorbell映射到INDST0,这个好像跟速率没有关系吧,我们之前用的srio k1的例程也没有设置这一部分呀

Nancy Wang:

回复 user5301336:

只要是INTDST0 – INTDST15都要写一下INTDSTn_RATE_CNTL,跟具体的值没有关系。您是在论坛上的例程上修改的?如果是的话,例程里面已经配置了,那就不是这个原因了。
/*interrupt rate control is not used in this test*/
interrupt_cfg.interrupt_rate=NULL;
interrupt_cfg.uiNumInterruptRateCfg= 0;

user5301336:

回复 Nancy Wang:

我用的例程是sysbios的,您说的这个是csl裸机上的吧,我的例程是SRIO_diolookpackisrexample

Nancy Wang:

回复 user5301336:

看到一个比较详细的帖子,可以参考看一下。

e2e.ti.com/…/312741

另外增加FPGA发送门铃的间隔,会改善DSP丢失门铃中断的情况。

user5301336:

回复 Nancy Wang:

谢谢您的回复,问题一:您的这个例子跟我的优点区别,因为我采用的是bootLoader方式,并且上位机需要跟DSP通信,并且需要传输数据,我用的task中读取bar上的特定地址执行不同的mode,并且每次执行一个都需要向上位机发一个中断sendInterrupttozhost,mode分贝等于2,3,4时,上位机启动起来,这个时候,再下载用户的数据,执行mode1,mode1中对srio进行初始化,然后,跳转到了,到上面的那个ISR,但是只触发一次。
问题二:我感觉是因为我的FPGA每个20ms发一次中断,在20ms中间,程序已经执行完了,srio的isr,返回了task,但是这是task已经没有代码可以执行,程序到了一个错误的位置(这个是我的一个疑问),导致程序发生了异常,我的FPGA的发送间隔不能改,因为我需要20ms的中断。我尝试在mode等于1时,加入了while(1),但是并不能解决问题。
Void TaskMain(UArg arg0, UArg arg1)
{Int32 i=0,j=0xABAB4145,h=0,q=0;UInt32 k[100] = {0};while (1){//SendInterruptToHost();// Get access to resourceSemaphore_pend(semHostInt, BIOS_WAIT_FOREVER);Semaphore_reset(semHostInt,0);
//UInt32 Pcie_Mode = DEVICE_REG32_R(0x10800000);UInt32 Pcie_Mode = DEVICE_REG32_R(0x10800008);//;UInt32 Cpu_data_length = DEVICE_REG32_R(0x1080000C);//DEVICE_REG32_R(0x8200000C);UInt32 Cpu_data_srcaddr = 0x82000100;UInt32 Cpu_data_dstaddr = 0x00000000;
UInt32 DspReadFPGA_srcaddr = DEVICE_REG32_R(0x10800018);UInt32 DspReadFPGA_dstaddr = 0x10800010;
if(Pcie_Mode == 1){
i = 0xABAB4141;DEVICE_REG32_W(0x10800040,i);Pciedma_Srio_mk();MemInt32BRead(k,0x80000000,10);MemInt32Write(0x10800060,k,10);SrioInit();InitSrioDriver();SendInterruptToHost();//ClearInterruptToHost();//BIOS_exit(0);Semaphore_pend(semHostInt, BIOS_WAIT_FOREVER);
}else if(Pcie_Mode == 2){
if(Cpu_data_length != 0){
DEVICE_REG32_W(0x10800044,j);WriteFpgaByDioSockets_nwrite_mk (Cpu_data_dstaddr,(Uint8*) Cpu_data_srcaddr,8*Cpu_data_length);SendInterruptToHost();}else{j++;DEVICE_REG32_W(0x10800050,j);SendInterruptToHost();}
}else if(Pcie_Mode == 3){q++;DEVICE_REG32_W(0x10800048,q);Dsp_config_fpga_mk();TSC_delay_ms(1000);SrioInit();SendInterruptToHost();}else if(Pcie_Mode == 4){h++;DEVICE_REG32_W(0x1080004C,h);ReadFpgaByDioSockets(DspReadFPGA_srcaddr,(UInt8 *) DspReadFPGA_dstaddr,8);SendInterruptToHost();}}
}

赞(0)
未经允许不得转载:TI中文支持网 » doorbell中断问题,每个20msFPGA发一次doobell,但是DSP这边只执行了一次,doorbell的isr
分享到: 更多 (0)