dma

Uart dma receive interrupt stops receiving data after several minutes

删除回忆录丶 提交于 2019-12-14 03:16:10
问题 I have a project that I have used stm32f746g discovery board. It receives data with fixed size from Uart sequentially and to inform application about each data receive completed, dma callback is used (HAL_UART_RxCpltCallback function). It works fine at the beginning but after several minutes of running, the dma callback stops to be called, and as a result, the specified parameter value doesn't get updated. Because the parameter is used in another thread too (actually a rtos defined timer), I

Need help mapping pre-reserved **cacheable** DMA buffer on Xilinx/ARM SoC (Zynq 7000)

Deadly 提交于 2019-12-14 01:55:57
问题 I've got a Xilinx Zynq 7000-based board with a peripheral in the FPGA fabric that has DMA capability (on an AXI bus). We've developed a circuit and are running Linux on the ARM cores. We're having performance problems accessing a DMA buffer from user space after it's been filled by hardware. Summary: We have pre-reserved at boot time a section of DRAM for use as a large DMA buffer. We're apparently using the wrong APIs to map this buffer, because it appears to be uncached, and the access

Using DMA to access High Speed Serial Port

 ̄綄美尐妖づ 提交于 2019-12-12 12:23:15
问题 I use serialport component in c# and it works well! But the question is how can it be faster to handle high speed (e.g. 2 Mbps) data transfers. As I have researched about this, I have found that memory can be accessed directly (using DMA like this link ). Can anybody tell me how can I define and use it in my application? 回答1: No, the [c#] tag puts this a million miles out of reach. The code snippet on that web page is not real, it is just a "pattern". It does things you cannot do in C#, like

How to write kernel space memory (physical address) to a file using O_DIRECT?

寵の児 提交于 2019-12-12 08:23:11
问题 I want to write a physical memory to a file. The memory itself will not be touched again, thus I want to use O_DIRECT to gain the best write performance. My first idea was to open /dev/mem and mmap the memory and write everything to a file, which is opened with O_DIRECT . The write call fails ( EFAULT ) on the memory-address returned by mmap. If I do not use O_DIRECT , it results in a memcpy . #include <cstdint> #include <iostream> #include <unistd.h> #include <sys/types.h> #include <sys/stat

In what cases CPU direct transfer works faster than DMA? In what cases DMA transfer works faster than CPU direct transfer?

北城余情 提交于 2019-12-12 04:48:27
问题 I'm a little bit confused about the cases in which CPU can direct transfer the data faster than DMA(Direct Memory Access Controller)? and vice-versa? Thanks 回答1: 1 - CPU faster than DMA CPU is idle. No task is running except yours (or your task has highest priority and the scheduling is priority scheduling) and Core interrupt is disabled (This will even stop the scheduling as there will be no timer tick interrupt). In that case, cpu transfer will be definitely faster than DMA as generally CPU

Facing Difficulties in Data Transfer over UART with DMA on MSP430

心已入冬 提交于 2019-12-12 03:57:18
问题 I am collecting 2.4KB(600 bytes * 4) of data from sensors over my MSP430 Controller. And I am using dma to transfer that data over UART to my Linux Processor.Transfer Happens at every 100ms Timer. My DMA setting is as below. DMACTL0 = DMA0TSEL__UCA0TXIFG; DMA0SA = &buff; DMA0DA = &UCA0TXBUF; DMA0SZ = 600; // Block size in bytes DMA0CTL = DMADT_4 | DMASBDB| DMASRCINCR_3 | DMAIE| DMALEVEL_L; // Rpt, inc DMA0CTL|= DMAEN; and my ISR for DMA is as below, __interrupt void DMA_VECTOR_ISR(void) {

Using DMA API in linux kernel but channel is never available

邮差的信 提交于 2019-12-11 11:12:39
问题 I am trying to use dmatest.c to test DMA in intel xeon server and regular laptop with i7 processor. It is never been able to get a channel - I found this out by debugging the dmatest.c itself. Line 854 below is always executed (I put my own printk there). Is there anything I should do to get this API to work before executing (such as dma modules or anything?) Or, do I use wrong API set? On the Xeon server, I did research and it has ioatdma.ko module that can be loaded. modprobe ioatdma and

When does glBufferSubData return? [duplicate]

廉价感情. 提交于 2019-12-11 07:25:01
问题 This question already has an answer here : When does OpenGL get finished with pointers in functions? (1 answer) Closed 2 years ago . I want to transfer contents of a very large memory chunk to a sufficiently large GPU buffer and then immediately alter the contents of memory on CPU. Something like this in pseudo-code: glBindBuffer(/*very_large_buffer*/); glBufferSubData(/*very_large_memory_chunk*/); memset(/*zeros*/, /*very_large_memory_chunk*/); In this code, what does glBufferSubData

Why driver need to map DMA buffers when dma-engine is in device?

大憨熊 提交于 2019-12-11 05:33:06
问题 DMA buffers are memory mapped by the driver. For example, in pci-skeleton.c, which uses rtl8319 we have: tp->tx_bufs = pci_alloc_consistent(tp->pci_dev, TX_BUF_TOT_LEN, &tp->tx_bufs_dma); But DMA engine can reside in soc or in device. **Is it that dma buffers should be allocated even if DMA engine is in device ? Why ? ** rtl8139cp datasheet (I think the dma is part of the device, but not sure about it): http://realtek.info/pdf/rtl8139cp.pdf I believe that "dma engine" and "dma controller"

On DMA and CPU Concurrency

时光怂恿深爱的人放手 提交于 2019-12-11 03:53:46
问题 I wondered what sort of operations can CPU handle/perform while a memory operation is in progress by a DMA-controller of a device, to increase the level of concurrency? And if the CPU cache/registers is empty, how another instruction can be fetched without interleaving DMA in progress Thx 回答1: It general, on big 1 hardware, the CPU can do more or less anything while a DMA is in progress. In general, it simply continues with normal execution of running processes or kernel tasks under the