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.

RTOS/TMDSEVM6670: dstDataBuffer gets frozen after memcpy

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

  • Additional info (might be useful):
    
    // enumerations
    enum
    {
    	BURST_SIZE = 256
    };
    
    #define MAX_MEM_MGR_ENTRIES     1002

  • Hi,

    We're working on this. Feedback will be posted here.

    Best Regards,
    Yordan
  • It is possible that you are running into a memory contention issue, where the core is trying to access the same memory as a peripheral at the same time. By definition, this should not happen, because a descriptor being in an Rx queue means that hardware should not be touching this memory. You may want to verify that your configuration is correct (i.e. your Tx and Rx queues are isolated from each other), and that no other peripheral such as an EDMA may also be trouncing on the memory. You could also try moving the descriptors to another memory to see if the behavior changes.