Cant send a single byte through UART Dma mode !!!

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

cross mob
shkuc_292731
Level 3
Level 3

Hi,

   

 

   

 

   

I am using the UART DMA mode example which came through SDK installation.

   

In this mode i want to send a single byte to FX3(Consumer) and  again the Fx3 will send back to the UART(Producer).

   

Here i have registered a Callback for this UART interrupts.

   

But its not at all coming inside the callback function.

   

So i have disabled the callback for the UART.

   

 

   

I have created a callback for DMA channel and in that callback for producer event i am commiting the buffer using commitbuffer API.

   

Now the problem is if i gave a single byte the producer event is not occuring, after 32 bytes only its occuring.

   

I want that for single byte.

   

If anyone having any idea on this issue.

   

help us. thanks in adavance.

   

 

   

 

   

Regards,

   

Shanthakumar

0 Likes
4 Replies
Anonymous
Not applicable

 Shantakumar,

   

    

   

    

          

   

The minimum buffer that you can use with that UartLpDma example is 16.    

   

But if you want to transfer data anything less than 16 as well then you need to do the following thing in the threadentry function:    

   

/* Entry function for the UartLpAppThread */     

   

void     

   

UartLpAppThread_Entry (     

   

        uint32_t input)     

   

{     

   

    /* Initialize the UART Example Application */     

   

    CyFxUartLpApplnInit();     

   

 

   

    for (;;)     

   

    {     

   

        /* No operation in the thread */     

   

        CyU3PDmaChannelSetWrapUp (&glUartLpChHandle);     

   

 

   

        CyU3PThreadSleep (50);     

   

    }     

   

}     

   

 

   

I am also attaching the .img file for your testing.     

   

 

   

Thanks,     

   

Sai Krishna.    

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable
0 Likes
shkuc_292731
Level 3
Level 3

Hi Sai Krishna,

   

 

   

Thank you for the reply.

   

It worked, now i can send single byte through UART.

   

 

   

 

   

Regards,

   

Shanthakumar

0 Likes
Anonymous
Not applicable

Hello

   

Can I get the source code?? I changed 'UartLpAppThread_Entry' function but it can't work.

   

and provided image works fine.

   

Thank you.

0 Likes