aboutsummaryrefslogtreecommitdiff
path: root/tests/rp/src/bin/flash.rs
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2025-02-19 14:48:01 +0100
committerGitHub <[email protected]>2025-02-19 14:48:01 +0100
commitfcee67a0d2e561a60a9b97df6d06fca02323efee (patch)
tree7210f06e7451d814b10dd327b9a987031351f300 /tests/rp/src/bin/flash.rs
parentf3b98a8748ad5ef7761dccb2e935cecea9e1e707 (diff)
parent28e2789aeb4576fefae7acbd20c82dcffb92cf01 (diff)
Merge pull request #3901 from CBJamo/rp23_testing
Inital rp23 ci tests
Diffstat (limited to 'tests/rp/src/bin/flash.rs')
-rw-r--r--tests/rp/src/bin/flash.rs19
1 files changed, 14 insertions, 5 deletions
diff --git a/tests/rp/src/bin/flash.rs b/tests/rp/src/bin/flash.rs
index 310f0d586..548a6ee72 100644
--- a/tests/rp/src/bin/flash.rs
+++ b/tests/rp/src/bin/flash.rs
@@ -1,6 +1,9 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#[cfg(feature = "rp2040")]
3teleprobe_meta::target!(b"rpi-pico"); 4teleprobe_meta::target!(b"rpi-pico");
5#[cfg(feature = "rp235xb")]
6teleprobe_meta::target!(b"pimoroni-pico-plus-2");
4 7
5use defmt::*; 8use defmt::*;
6use embassy_executor::Spawner; 9use embassy_executor::Spawner;
@@ -24,13 +27,19 @@ async fn main(_spawner: Spawner) {
24 let mut flash = embassy_rp::flash::Flash::<_, Async, { 2 * 1024 * 1024 }>::new(p.FLASH, p.DMA_CH0); 27 let mut flash = embassy_rp::flash::Flash::<_, Async, { 2 * 1024 * 1024 }>::new(p.FLASH, p.DMA_CH0);
25 28
26 // Get JEDEC id 29 // Get JEDEC id
27 let jedec = defmt::unwrap!(flash.blocking_jedec_id()); 30 #[cfg(feature = "rp2040")]
28 info!("jedec id: 0x{:x}", jedec); 31 {
32 let jedec = defmt::unwrap!(flash.blocking_jedec_id());
33 info!("jedec id: 0x{:x}", jedec);
34 }
29 35
30 // Get unique id 36 // Get unique id
31 let mut uid = [0; 8]; 37 #[cfg(feature = "rp2040")]
32 defmt::unwrap!(flash.blocking_unique_id(&mut uid)); 38 {
33 info!("unique id: {:?}", uid); 39 let mut uid = [0; 8];
40 defmt::unwrap!(flash.blocking_unique_id(&mut uid));
41 info!("unique id: {:?}", uid);
42 }
34 43
35 let mut buf = [0u8; ERASE_SIZE]; 44 let mut buf = [0u8; ERASE_SIZE];
36 defmt::unwrap!(flash.blocking_read(ADDR_OFFSET, &mut buf)); 45 defmt::unwrap!(flash.blocking_read(ADDR_OFFSET, &mut buf));