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.

UPP接口接收FPGA的数据



我的主函数是这样写的,两个buffer接收FPGA发过来的数据(0-32766),每个buffer大小是1024,UPID1的参数是:

#define upp_line_size (1024)
#define upp_line_count (1)

我想实现连续接收FPGA发过来的数据的功能,即upp_buffer_ping接收0-1023,upp_buffer_pong接收1024-2047。

但是事实上,两个buffer接收的都是0-1023。想了好久也没想明白原因。谁能告诉我这是为什么?我要想连续接收FPGA发过来的数据该怎么做?

/*启动UPP DMA传输*/
UARTPuts("ping\n",-2);
upp_reg_hdl->UPID0 = (Uint32)upp_buffer_ping;
upp_reg_hdl->UPID1 = ((Uint32)upp_line_count << 16) | (Uint32)upp_line_size*sizeof(upp_buffer_ping[0]);
upp_reg_hdl->UPID2 = (Uint32)upp_line_offset*sizeof(upp_buffer_ping[0]);

upp_reg_hdl->UPID0 = (Uint32)upp_buffer_pong;
upp_reg_hdl->UPID1 = ((Uint32)upp_line_count << 16) | (Uint32)upp_line_size*sizeof(upp_buffer_pong[0]);
upp_reg_hdl->UPID2 = (Uint32)upp_line_offset*sizeof(upp_buffer_pong[0]);


UARTPuts("printf data.\r\n", -2);

for(j=0; j<upp_frame_size; )
{
for(k=0; k<5; k++)
{
UARTprintf("upp_buffer_ping[%d]=%d ",j, upp_buffer_ping[j]);
j++;
}
UARTPuts("\n",-2);
}

for(j=0; j<upp_frame_size; )
{
for(k=0; k<5; k++)
{
UARTprintf("upp_buffer_pong[%d]=%d ",j, upp_buffer_pong[j]);
j++;
}
UARTPuts("\n",-2);
}