diff options
Diffstat (limited to 'tests/rp/src/bin/flash.rs')
| -rw-r--r-- | tests/rp/src/bin/flash.rs | 19 |
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")] | ||
| 3 | teleprobe_meta::target!(b"rpi-pico"); | 4 | teleprobe_meta::target!(b"rpi-pico"); |
| 5 | #[cfg(feature = "rp235xb")] | ||
| 6 | teleprobe_meta::target!(b"pimoroni-pico-plus-2"); | ||
| 4 | 7 | ||
| 5 | use defmt::*; | 8 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 9 | use 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)); |
