DMA Tx Setting

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.
psoc_student
Level 3
Level 3
50 sign-ins 25 sign-ins 10 replies posted

Hello, I am trying to extract various logs using UART-DMA Tx.

For example, you can send a string, such as "Hello," send a hex value, or send a float, int value.

I can match the character, but I don't know how to apply the size of the buffer that changes every time I send it to DMA.

I attached what I used in the project below. Please give me your opinion on how to modify it.

regards.
Psoc_student

ps. I'm using Psoc6 Pioneer Kit and MTB

0 Likes
1 Solution
YuZh
Moderator
Moderator
Moderator
100 replies posted 10 likes received 50 sign-ins

Hi:

1. You can Cy_DMA_Descriptor_SetNextDescriptor  to set the next  dma configuration, that include your requirement about size.

/*******************************************************************************
* Function Name: Cy_DMA_Descriptor_SetNextDescriptor
****************************************************************************//**
*
* Sets a Next Descriptor for the specified descriptor.
*
* Based on the descriptor type, the offset of the address for the next descriptor may
* vary. For the single-transfer descriptor type, this register is at offset 0x0c.
* For the 1D-transfer descriptor type, this register is at offset 0x10. 
* For the 2D-transfer descriptor type, this register is at offset 0x14.  
*
* \param descriptor
* The descriptor structure instance declared by the user/component.
*
* \param nextDescriptor
* The pointer to the next descriptor.
*
* \funcusage 
* \snippet dma/snippet/main.c snippet_Cy_DMA_Descriptor_SetterFunctions
*
*******************************************************************************/
void Cy_DMA_Descriptor_SetNextDescriptor(cy_stc_dma_descriptor_t * descriptor, cy_stc_dma_descriptor_t const * nextDescriptor)
{   
    switch((cy_en_dma_descriptor_type_t) _FLD2VAL(CY_DMA_CTL_TYPE, descriptor->ctl))
    {
        case CY_DMA_SINGLE_TRANSFER:
            descriptor->xCtl = (uint32_t)nextDescriptor;
            break;

        case CY_DMA_CRC_TRANSFER:
        case CY_DMA_1D_TRANSFER:
            descriptor->yCtl = (uint32_t)nextDescriptor;
            break;
            
        case CY_DMA_2D_TRANSFER:
            descriptor->nextPtr = (uint32_t)nextDescriptor;
            break;
            
        default:
            /* Unsupported type of descriptor */
            break;
    }
}

zhichao

 

View solution in original post

0 Likes
1 Reply
YuZh
Moderator
Moderator
Moderator
100 replies posted 10 likes received 50 sign-ins

Hi:

1. You can Cy_DMA_Descriptor_SetNextDescriptor  to set the next  dma configuration, that include your requirement about size.

/*******************************************************************************
* Function Name: Cy_DMA_Descriptor_SetNextDescriptor
****************************************************************************//**
*
* Sets a Next Descriptor for the specified descriptor.
*
* Based on the descriptor type, the offset of the address for the next descriptor may
* vary. For the single-transfer descriptor type, this register is at offset 0x0c.
* For the 1D-transfer descriptor type, this register is at offset 0x10. 
* For the 2D-transfer descriptor type, this register is at offset 0x14.  
*
* \param descriptor
* The descriptor structure instance declared by the user/component.
*
* \param nextDescriptor
* The pointer to the next descriptor.
*
* \funcusage 
* \snippet dma/snippet/main.c snippet_Cy_DMA_Descriptor_SetterFunctions
*
*******************************************************************************/
void Cy_DMA_Descriptor_SetNextDescriptor(cy_stc_dma_descriptor_t * descriptor, cy_stc_dma_descriptor_t const * nextDescriptor)
{   
    switch((cy_en_dma_descriptor_type_t) _FLD2VAL(CY_DMA_CTL_TYPE, descriptor->ctl))
    {
        case CY_DMA_SINGLE_TRANSFER:
            descriptor->xCtl = (uint32_t)nextDescriptor;
            break;

        case CY_DMA_CRC_TRANSFER:
        case CY_DMA_1D_TRANSFER:
            descriptor->yCtl = (uint32_t)nextDescriptor;
            break;
            
        case CY_DMA_2D_TRANSFER:
            descriptor->nextPtr = (uint32_t)nextDescriptor;
            break;
            
        default:
            /* Unsupported type of descriptor */
            break;
    }
}

zhichao

 

0 Likes