u32 upp_buffer_xmit[1024],upp_buffer_rcv[1024];
void upp_test(void)
{
int upp_error_count = 0;
int i,size;
for (i = 0; i < 1024; i++) ==>> for(i = 0; i < 2048; i++)
{
upp_buffer_xmit[i] =0x55AAFFBB;
upp_buffer_rcv[i] = 0;
}
while(UPP_UPQS2_ADDR & 0x00000002 == 1) {};
UPP_UPQD0_ADDR = (unsigned int)&upp_buffer_rcv[0];
UPP_UPQD1_ADDR = (0x0001 << 16) | 0x10000;
UPP_UPQD2_ADDR = 0x10000;
while(UPP_UPIS2_ADDR & 0x00000002 == 1) {};
UPP_UPID0_ADDR = (unsigned int)&upp_buffer_xmit[0];
UPP_UPID1_ADDR = (0x0001 << 16) | 0x10000;
UPP_UPID2_ADDR = 0x10000;
for(i = 0; i < 1024; i++)
{
if(upp_buffer_xmit[i] != upp_buffer_rcv[i])
{
printf(" %d : 0x%x,0x%x\n",i,upp_buffer_xmit[i],upp_buffer_rcv[i]);
upp_error_count++;
}
}
if (upp_error_count)
printf("uPP transfers completed with %d errors.\n", upp_error_count);
else
printf ("uPP transfers complete with no error!\n");
}
This is my test code, A2B DLB mode,transfer error.upp_buffer_rcv[1024] didn't receive any data,is still fill with 0.
but if I change the Buffer initial circle code,e.g for(i = 0; i < 2048; i++),which show in red color,transfer ok and upp_buffer_rcv[1024] fill with 0x55AAFFBB.
then i change to for(i = 0; i < 1500; i++), before 476(1500-1024) of the upp_buffer_rcv[1024] is fill with 0x55AAFFBB,but after 476 is fill with 0.
so I thought the DMA transfered data which is just after upp_buffer_xmit[1024], why do this happen?
absolutely,initial circle with for(i = 0; i < 1500; i++) which exceed the array range is wrong.