RT1020/1050 DMA memory to peripheral

cancel
Showing results for 
Search instead for 
Did you mean: 

RT1020/1050 DMA memory to peripheral

1,067 Views
luishs
Senior Contributor I

Hi.

I am looking for some example of source code for RT1020 or RT1050, with DMA, Memory to Peripheral, or Peripheral to Memory, using several GPIO ports.

In the SDK there are examples using DMA for Memory to Memory, Memory to Serial Port (SPI, UART, I2C...),  and Serial Port to Memory, but I need to Read or Write several GPIO ports by DMA.


Can anyone provide an example of source code Memory to Peripheral or Peripheral to Memory with several GPIO ports, or is there a User Manual about it?


Best regards.

Labels (2)
4 Replies

524 Views
7electrons
Contributor I

Were you able to get anywhere with this? I'm stuck in the same situation and can not move forward with a project because of it. I have found zero documentation dealing with DMA transfers to the GPIO pins.

0 Kudos

524 Views
luishs
Senior Contributor I


I have not dealt with this for a long time, because I am busy with other matters. However, in theory, you can use any of the two examples in the SDK, on memory-to-memory EDMA. You just have to replace the destination memory address with the GPIO address and the number of bytes depending on how many adjacent GPIOs you want to use.

This is the instruction in the SDK examples, where the address and number of bytes to send are defined.


EDMA_PrepareTransfer (& transferConfig, srcAddr, sizeof (srcAddr [0]), destAddr, sizeof (destAddr [0]),
                          sizeof (srcAddr [0]), sizeof (srcAddr), kEDMA_MemoryToMemory);


Replace destAddr with the GPIO address, and sizeof (destAddr [0]) with the amount of GPIO ports with adjoining addresses, this I think has to be in bytes, then they would be in blocks of 8 GPIO.

In srcAddr you will have the data to send to the GPIO (habitually an array), and  sizeof (srcAddr [0]) define the quantity of data to send to the GPIO.

0 Kudos

524 Views
art
NXP TechSupport
NXP TechSupport

There is no ready to use example of Memory to GPIO transfer. Basically, this kind of transfer does not differ much from other Memory to Peripheral or Peripheral to Memory transfers, only the transfer source and destination, transfer size and triggering mode should be selected appropriately. So, you can change any existing Memory to Peripheral or Peripheral to Memory transfer example from SDK to get the desired kind of transfer. You can also refer to the MCUXpresso SDK API Reference Manual document, included into the SDK.


Have a great day,
Artur

0 Kudos

524 Views
luishs
Senior Contributor I

But in the example sources of the SDK, there is none from Memory to Peripheral, or Peripheral Memory that serves as a reference to make mine, there are only examples of Memory to Memory and serial ports such as SPI, UART, etc.

You comment that I used an example of Memory to Peripheral of the SDK, but it is that there is none, that is the problem.

Can you provide me with one of those example sources?