Other Parts Discussed in Thread: SYSBIOS
我在sysbios中学习SRIO_TputBenchmarkingTestProject例子的时候,发现DSP只能接收doorbell中断,但是却无法接收被写的数据。也就是说,FPGS向DSP写数据时(带上了doorbell),没有生效,但是doorbell生效了。
还有一个现象,如果班子里有个以前正确的srio固件,那么调试时第一次就能获取到数据,但是第二次及以后就获取不到了,这能证明其实链路硬件等都是没问题的,问题基本出在了软件上。我注意例子中有个createMgmtSocket函数用于做绑定,请问是否是这里设置的原因导致数据没有正确送入吗?附上我的代码:
“{
Srio_SockHandle mgmtSocket;
Srio_SockBindAddrInfo bindInfo;
uint32_t doorbellInfo;
uint32_t coreNum;
int useBlockingSocket;
/* Set non-blocking or blocking socket designator based on polled mode */
useBlockingSocket = FALSE;
/* Get the core number. */
coreNum = CSL_chipReadReg(CSL_CHIP_DNUM);
/* Create the Management Socket. */
mgmtSocket = Srio_sockOpen (hSrioDrv, Srio_SocketType_DIO, useBlockingSocket);
if (mgmtSocket == NULL)
{
System_printf ("Error: Unable to open the DIO Management socket\n");
return NULL;
}
/* DIO Binding Information: Use 16/8 bit identifiers and we are bound to the first source id.
* and we are using 16/8 bit device identifiers. */
bindInfo.dio.doorbellValid = 0;
bindInfo.dio.intrRequest = 0;
bindInfo.dio.supInt = 0;
bindInfo.dio.xambs = 0;
bindInfo.dio.priority = 0;
bindInfo.dio.outPortID = 0;
bindInfo.dio.idSize = 1;
bindInfo.dio.srcIDMap = 0;
bindInfo.dio.hopCount = 0;
bindInfo.dio.doorbellReg = 0;
bindInfo.dio.doorbellBit = 1;
/* Bind the DIO socket. */
if (Srio_sockBind (mgmtSocket, &bindInfo) < 0)
{
System_printf ("Error: Binding the DIO Management Socket failed.\n");
return NULL;
}
// if (coreNum == 0)
// {
/* Register the CONSUMER Doorbell Information */
doorbellInfo = SRIO_SET_DBELL_INFO(CONSUMER_DOORBELL_REG, CONSUMER_DOORBELL_BIT);
if (Srio_setSockOpt (mgmtSocket, Srio_Opt_REGISTER_DOORBELL, (void *)&doorbellInfo, sizeof(uint32_t)) < 0)
{
// System_printf ("Error: Unable to register the %s Doorbell\n", ((coreNum == CONSUMER_CORE) ? "CONSUMER" : "PRODUCER"));
return NULL;
}
// }
// else
// {
/* Register the PRODUCER Doorbell Information */
doorbellInfo = SRIO_SET_DBELL_INFO(PRODUCER_DOORBELL_REG, PRODUCER_DOORBELL_BIT);
if (Srio_setSockOpt (mgmtSocket, Srio_Opt_REGISTER_DOORBELL, (void *)&doorbellInfo, sizeof(uint32_t)) < 0)
{
// System_printf ("Error: Unable to register the %s Doorbell\n", ((coreNum == CONSUMER_CORE) ? "CONSUMER" : "PRODUCER"));
return NULL;
}
// }
/* Return the management socket. */
return mgmtSocket;
}”