aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Balbi <[email protected]>2025-12-11 15:42:46 -0800
committerFelipe Balbi <[email protected]>2025-12-11 15:42:46 -0800
commit17f0f4baa489d87d9862f9ab91dc73530daf5b3e (patch)
tree25e20753b50cbc9da6f459a5991bca125e24f2fd
parent4c5986e6d06f8e7dc421e1c3b3b8793351df1fef (diff)
[iMXRT] add a minimal DMA copy example
While at that, also update the PACs to their latest versions.
-rw-r--r--embassy-imxrt/Cargo.toml4
-rw-r--r--examples/mimxrt6/src/bin/dma.rs26
2 files changed, 28 insertions, 2 deletions
diff --git a/embassy-imxrt/Cargo.toml b/embassy-imxrt/Cargo.toml
index c47756f10..81377579b 100644
--- a/embassy-imxrt/Cargo.toml
+++ b/embassy-imxrt/Cargo.toml
@@ -103,5 +103,5 @@ document-features = "0.2.7"
103paste = "1.0" 103paste = "1.0"
104 104
105# PACs 105# PACs
106mimxrt685s-pac = { version = "0.4.0", optional = true, features = ["rt", "critical-section"] } 106mimxrt685s-pac = { version = "0.5.0", optional = true, features = ["rt", "critical-section"] }
107mimxrt633s-pac = { version = "0.4.0", optional = true, features = ["rt", "critical-section"] } 107mimxrt633s-pac = { version = "0.5.0", optional = true, features = ["rt", "critical-section"] }
diff --git a/examples/mimxrt6/src/bin/dma.rs b/examples/mimxrt6/src/bin/dma.rs
new file mode 100644
index 000000000..b490efc6b
--- /dev/null
+++ b/examples/mimxrt6/src/bin/dma.rs
@@ -0,0 +1,26 @@
1#![no_std]
2#![no_main]
3
4extern crate embassy_imxrt_examples;
5
6use defmt::info;
7use embassy_executor::Spawner;
8use embassy_imxrt::dma::copy;
9use {defmt_rtt as _, panic_probe as _};
10
11const BUFLEN: usize = 1024;
12
13#[embassy_executor::main]
14async fn main(_spawner: Spawner) {
15 let p = embassy_imxrt::init(Default::default());
16
17 info!("Test memory-to-memory DMA transfers");
18
19 let src = [0x55u8; BUFLEN];
20 let mut dst = [0u8; BUFLEN];
21
22 unsafe { copy(p.DMA0_CH0, &src, &mut dst) }.await;
23 assert!(dst == src);
24
25 info!("DMA copy succeeded");
26}