Dear all, i'd like to use UART DMA to exchange data between EZ-Kit and Matlab. The following code-snippet should explain my initialisation. tx_buf is the data i'd like to read out, rx_buf is the data to write to: unsigned char tx_buf[BUFLEN]; unsigned char rx_buf[BUFLEN]; void init_dma_tx (void) { *pDMA7_CONFIG = 0x1080; *pDMA7_PERIPHERAL_MAP = 0x7000; *pDMA7_X_COUNT = BUFLEN; *pDMA7_X_MODIFY = 0x01; *pDMA7_START_ADDR = (void*)&tx_buf; asm("ssync;"); } void init_dma_rx (void) { *pDMA6_CONFIG = 0x1082; *pDMA6_PERIPHERAL_MAP = 0x6000; *pDMA6_X_COUNT = BUFLEN; *pDMA6_X_MODIFY = 0x01; *pDMA6_START_ADDR = (void*)&rx_buf; asm("ssync;"); } the corresponding uart-interrupts are properly set and the dma channels are enabled in a following step. If i now run the program the write-operation works fine: i send a byte and it is succesfully stored in rx_buf[0], the DMA6_CURR_ADDR is incremented by one so that the next value is stored in rx_buf[1] and so on. But i am despaired about the work of my DMA-read operation. Although i read nothing the DMA7_CURR_ADDR increments (and loops within DMA6_X_COUNT) as if by an invisible hand. The read-operation itself works but the problem is, that i get a random value from tx_buf. the next value i read is another random value out of this buffer. only if i read some bytes at once, they are in continuous order... hope, you could track my problem: i would like to read from tx_buf continuous from the beginning on. if i read tx_buf[3] now, i would read tx_buf[4] in a second or a minute or a hour) any idea?!
BF533 EZ-Kit lite: UART DMA
Started by ●November 15, 2006
Reply by ●November 15, 20062006-11-15
insecuritate wrote:> Dear all, > > i'd like to use UART DMA to exchange data between EZ-Kit and Matlab. > The following code-snippet should explain my initialisation. tx_buf is the > data i'd like to read out, rx_buf is the data to write to: >[...]> any idea?!The DMA in BF should operate in the memory area which is not covered by the cache. If you are trying to do the DMA from/to the memory which is cached, the results will be arbitrary. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
Reply by ●November 15, 20062006-11-15
>The DMA in BF should operate in the memory area which is not covered by >the cache. If you are trying to do the DMA from/to the memory which is >cached, the results will be arbitrary.thanks! but that doesn't explain the automatic increment of DMA6_CURR_ADDR?! the mystifying thing in my eyes is, that the TX DMA increments itself but the RX DMA works fine and only counts up, when i've written a value...
Reply by ●November 17, 20062006-11-17
Reply by ●November 17, 20062006-11-17