Part Number: TMDSEVM6670
Tool/software: TI-RTOS
Hello team,
During my SRIO implementation on C6670 I have met the following problem:
My code is based on SRIO_LpbkDioIsr_evmc6678_C66BiosExampleProject
So, there are two buffers: srcDataBuffer and dstDataBuffer.
My communication was working properly and while TX buffers changed, RX data was changing as well. Everything was fine.
Then I was trying to use memcpy on RX buffer you have provide to copy data I've received to another buffer that I was planning to make further calculations on.
All operations I'm performing using dstDataBuffer look like this:
#define SIZE_DIO_PACKET 256
#define SRIO_DIO_LSU_ISR_NUM_SOCKETS 1
Srio_SockHandle hSrioSock;
UInt8* dstDataBuffer;
dstDataBuffer = (uint8_t*) Osal_srioDataBufferMalloc(SIZE_DIO_PACKET);
if (dstDataBuffer == NULL)
{
System_printf("Error: Destination Buffer (0) Memory Allocation Failed\n");
}
memset(&dstDataBuffer[0], 0, BURST_SIZE); //zero fill
if (Srio_sockSend_DIO(hSrioSock, &dstDataBuffer[0], SIZE_DIO_PACKET, (Srio_SockAddrInfo*) &to) < 0)
{
System_printf("Receive image chunk failed");
return -1;
}
memcpy(&data[0], &dstDataBuffer[0], SIZE_DIO_PACKET);
//my data buffer is defined as follows:
uint8_t* data = new uint8_t [256];
memset(&data[0], 0, SIZE_DIO_PACKET); //zero fill
If I copy only 1 Byte of dstDataBuffer then the next packet that will be received will be of size 255 Bytes. If I copy 256B, all packet gets 'frozen' and no single byte is changing.
I was trying to allocate these src and dst buffers in many ways, using malloc or new uint8_t as well, but with no success.
So now I can receive many packets but I cannot use them to anything. If I try, my srio rx buffer will be 'frozen' until the full DSP reset.
If you need more config data plz write.
Looking forward to your reply,
Thank you in advance,
Maciej