ochsenkopf
New member
Hey,
I've tried to get the DMA running on my Teensy4.1. Until now unsuccessful. Im using Arduino2.0.3 on Windows. I've read through this post by miciwan trying to write from a single uint32_t to the GPIO1_DR to light up a LED connected to pin 23 (GPIO1_IO25 when i understood correctly).
I'm using
and first tried to set it up with source() and destination() and trigger it by triggerManual() as well as triggerContinously().
I then looked into output_pwm.cpp in the Audio Library to set the DMA TCD up manually, but it didn't work as well.
I tested my GPIO configuration by just writing to GPIO1_DR directly and it worked fine.
Here's my full test code:
Did I miss something obvious? Im kind of stuck at this point. Or does this even make sense? I just wanted to test the DMA functionality so I can use it later if needed
I've tried to get the DMA running on my Teensy4.1. Until now unsuccessful. Im using Arduino2.0.3 on Windows. I've read through this post by miciwan trying to write from a single uint32_t to the GPIO1_DR to light up a LED connected to pin 23 (GPIO1_IO25 when i understood correctly).
I'm using
Code:
<DMAChannel.h>
I then looked into output_pwm.cpp in the Audio Library to set the DMA TCD up manually, but it didn't work as well.
I tested my GPIO configuration by just writing to GPIO1_DR directly and it worked fine.
Here's my full test code:
Code:
#include <DMAChannel.h>
DMAChannel dma;
// The content of this should be written to GPIO1_DR
uint32_t DMAMEM dmasource = 1 <<25;
void setup() {
// Setup Pin23 / GPIO1_IO25 as Output on the low speed GPIO port
IOMUXC_SW_MUX_CTL_PAD_GPIO_AD_B1_09 = 5;
IOMUXC_GPR_GPR26 &= ~(0x0FCC0000u);
GPIO1_GDIR |= 1 << 25;
//GPIO1_DR = 1 <<25; // Tested the LED and wether my pin config is right. It worked
dma.begin(true);
dma.TCD->SADDR = &dmasource; // getting data from the variable above
dma.TCD->SOFF = 0; // dont change the adress afterwards
dma.TCD->NBYTES = 4; // uint32_t is 4 bytes in size
dma.TCD->DOFF = 0; // dont make changes to the destination adress
dma.TCD->CITER = 1; // One minor loop of getting the 4 bytes
dma.TCD->BITER = 1;
dma.TCD->DADDR = &GPIO1_DR; // Destination adress
dma.enable(); // enabling the DMA
dma.triggerContinously(); // triggering the DMA
}
void loop() {
}
Did I miss something obvious? Im kind of stuck at this point. Or does this even make sense? I just wanted to test the DMA functionality so I can use it later if needed