Manuel DMA,CyU3PSetEpConfig failed, Error code = 71

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
MaMa_4034336
Level 3
Level 3

Hallo,

i have a Program, where i read 16-Bit Data from GPIF II Interface, then with Manual DMA i put a Header in da DMA buffer end send it to the PC. It is quite similar to the  UVC-Example.

Wenn i just start the programm and try to read the data with the USB control Center, after a short time i get the Error CyU3PSetEpConfig failed, Error code = 71. What does the Error mean and can a error occur, when i don't read the incoming data on the PC.

kind regards

Matthias

0 Likes
1 Solution

Hello Matthias,

- When the DMA channel is created, the header size must be mentioned. This will ensure that header space of the buffer is not filled by the incoming data.

- The buffer pointer "buffer_p" need not point to the DMA-buffer. Instead, it must point to the start of the DMA buffer.

Best regards,

Srinath S

View solution in original post

0 Likes
5 Replies
SrinathS_16
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

Hello Matthias,

CyU3PSetEpConfig() API is generally called once during the application initialization. But, since you have mentioned that you receive the error during the read operation on the Control Center, can you please confirm if the error is on this API or is it some other API. It would be better if could share the firmware source.

Moreover, CyU3PSetEpConfig() API does not return error code 71. Please refer to the FX3 API Guide.

Best regards,

Srinath S

0 Likes
lock attach
Attachments are accessible only for community members.

Hallo Sirnath,

the error occur when the DMA callback function is called and the buffer is commited to USB. I have attached the firmware source and the GPIF II file.

EDIT: i just saw that i used the wrong function name for the error code. the function which returns the error is CyU3PDmaMultiChannelCommitBuffer.

The callback function:

void MultiDmaCallback(

        CyU3PDmaMultiChannel *handle,

        CyU3PDmaCbType_t type,

        CyU3PDmaCBInput_t *input)

{

    CyU3PDmaBuffer_t dmaBuffer;

    CyU3PReturnStatus_t status = CY_U3P_SUCCESS;

    if (type == CY_U3P_DMA_CB_PROD_EVENT) {

        /* This is a produce event notification to the CPU. This notification is received upon reception of

         * every buffer. The buffer will not be sent out unless it is explicitly committed. The call shall fail

         * if there is a bus reset / usb disconnect or if there is any application error.

         */

        /* There is a possibility that CyU3PDmaMultiChannelGetBuffer will return CY_U3P_ERROR_INVALID_SEQUENCE here.

         * In such a case, do nothing. We make up for this missed produce event by making repeated commit actions

         * in subsequent produce event callbacks.

         */

        status = CyU3PDmaMultiChannelGetBuffer(handle, &dmaBuffer,CYU3P_NO_WAIT);

        while (status == CY_U3P_SUCCESS)

        {

            /* Add Headers*/

            uint8_t* buffer_p=dmaBuffer.buffer-HEADER_SIZE;

            uint8_t tmp;

            tmp=0xBB;

            CyU3PMemCopy (buffer_p, &tmp, HEADER_SIZE);

            /* Commit Buffer to USB*/

            status = CyU3PDmaMultiChannelCommitBuffer(handle,(dmaBuffer.count + HEADER_SIZE), 0);

            if (status != CY_U3P_SUCCESS)

            {

                CyU3PDebugPrint(4, "MultiDmaCallback:CyU3PSetEpConfig failed, Error code = %d\n",status);

                CyFxAppErrorHandler(status);

            }

            /* Check if any more buffers are ready to go, and commit them here. */

            status = CyU3PDmaMultiChannelGetBuffer(handle, &dmaBuffer,CYU3P_NO_WAIT);

        }

    } else if (type == CY_U3P_DMA_CB_CONS_EVENT) {

    }

}

0 Likes

Hello Matthias,

Please follow the steps mentioned in the below document and check if the issue is resolved.

Invalid Sequence Error in Multi-Channel Commit Buffer - KBA218830

Best regards,

Srinath S

0 Likes

Hallo Srinath,

i changed my test setup, to just send one burst of data to the Cypress board,Currently only 5*16Bit. The error doesn't orruc anymore, but when it come back i try your solution. However now i have the problem i don't see the header i put in front of the data.

Header copy code:

uint8_t tmp=0xBB;

HEADER_SIZE=1;

uint8_t* buffer_p=dmaBuffer.buffer-HEADER_SIZE;

CyU3PMemCopy (buffer_p, (uint8_t*) tmp, HEADER_SIZE);

is it correct to set the memory pointer in front of the DMA-Buffer. I have the feeling, when i send the data to the USB, it always start with the dmaBuffer.buffer pointer and not the dmaBuffer.buffer-HEADER_SIZE.

Best regards,

Matthias

0 Likes

Hello Matthias,

- When the DMA channel is created, the header size must be mentioned. This will ensure that header space of the buffer is not filled by the incoming data.

- The buffer pointer "buffer_p" need not point to the DMA-buffer. Instead, it must point to the start of the DMA buffer.

Best regards,

Srinath S

0 Likes