AnsweredAssumed Answered

Problem in sending/receiving data from BF537 UART

Question asked by AsifHabib on Jul 30, 2009
Latest reply on Apr 2, 2010 by jobo23



I am trying to send some data to the BF537 UART from a thread, using the default device drivers of the BF537 UART. I have to send a frame of 37 bytes at a time at a rate of 2400bps. I have set the element count of the 1D buffer, that I have passed to the adi_dev_Write() and adi_dev_Read() functions, to 37, and element width to 1. Though I am able to receive the data successfully, but the problem is that the data that I receive is a “circularly” shifted version for the data that I send. The amount of shift is fixed when I run the code from one PC but is different when the same code is run on another PC. This shift ranges from a minimum of 1 byte to 36 bytes. I never get the “exact” data that I transmitted. Please refer to the figure attached for a better understanding of what I have said.


Another important thing is that, the sending portion of the program, which is from a thread, is controlled through a semaphore. I mean that whenever the data is available the thread sends it, and otherwise it pends on semaphore. Now if I make the thread as “free-running” (i.e. not controlled by the semaphore), then I receive exactly the same data that I have sent (no shifts). Otherwise when the thread is controlled by the semaphore I receive a shifted version of the original data. I need the semaphore to be placed in the thread so that the data updates can be tracked.


Help is needed to solve the problem, i.e receive data as its is sent while using semaphore.



Best Regards,

Asif Habib