diff options
| author | xoviat <[email protected]> | 2025-12-10 16:28:04 -0600 |
|---|---|---|
| committer | xoviat <[email protected]> | 2025-12-10 16:28:04 -0600 |
| commit | 14079f148c2796889db04e1442181afa3165c5b6 (patch) | |
| tree | 7eab60d9d4e666ee8cae1246dcdde974e3432a7f /tests | |
| parent | 4915b9f530877f3db1e9c2a7813b52795b5a4ec3 (diff) | |
sdmmc: more refactorign
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/stm32/src/bin/sdmmc.rs | 50 |
1 files changed, 47 insertions, 3 deletions
diff --git a/tests/stm32/src/bin/sdmmc.rs b/tests/stm32/src/bin/sdmmc.rs index 454d0dd57..d98b93a15 100644 --- a/tests/stm32/src/bin/sdmmc.rs +++ b/tests/stm32/src/bin/sdmmc.rs | |||
| @@ -56,15 +56,59 @@ async fn main(_spawner: Spawner) { | |||
| 56 | 56 | ||
| 57 | let mut cmd_block = CmdBlock::new(); | 57 | let mut cmd_block = CmdBlock::new(); |
| 58 | 58 | ||
| 59 | let mut storage = StorageDevice::new_sd_card(&mut s, &mut cmd_block, mhz(24)) | 59 | let mut storage = loop { |
| 60 | .await | 60 | if let Ok(storage) = StorageDevice::new_sd_card(&mut s, &mut cmd_block, mhz(24)).await { |
| 61 | .unwrap(); | 61 | break storage; |
| 62 | } | ||
| 63 | }; | ||
| 62 | 64 | ||
| 63 | let card = storage.card(); | 65 | let card = storage.card(); |
| 64 | 66 | ||
| 65 | info!("Card: {:#?}", Debug2Format(&card)); | 67 | info!("Card: {:#?}", Debug2Format(&card)); |
| 66 | info!("Clock: {}", storage.sdmmc.clock()); | 68 | info!("Clock: {}", storage.sdmmc.clock()); |
| 67 | 69 | ||
| 70 | // card_type: HighCapacity, | ||
| 71 | // ocr: OCR: Operation Conditions Register { | ||
| 72 | // Voltage Window (mV): (2700, 3600), | ||
| 73 | // S18A (UHS-I only): true, | ||
| 74 | // Over 2TB flag (SDUC only): false, | ||
| 75 | // UHS-II Card: false, | ||
| 76 | // Card Capacity Status (CSS): \"SDHC/SDXC/SDUC\", | ||
| 77 | // Busy: false }, | ||
| 78 | // rca: 43690, | ||
| 79 | // cid: CID: Card Identification { Manufacturer ID: 3, | ||
| 80 | // OEM ID: \"SD\", | ||
| 81 | // Product Name: \"SL08G\", | ||
| 82 | // Product Revision: 128, | ||
| 83 | // Product Serial Number: 701445767, | ||
| 84 | // Manufacturing Date: (9, | ||
| 85 | // 2015) }, | ||
| 86 | // csd: CSD: Card Specific Data { Transfer Rate: 50, | ||
| 87 | // Block Count: 15523840, | ||
| 88 | // Card Size (bytes): 7948206080, | ||
| 89 | // Read I (@min VDD): 100 mA, | ||
| 90 | // Write I (@min VDD): 10 mA, | ||
| 91 | // Read I (@max VDD): 5 mA, | ||
| 92 | // Write I (@max VDD): 45 mA, | ||
| 93 | // Erase Size (Blocks): 1 }, | ||
| 94 | // scr: SCR: SD CARD Configuration Register { Version: Unknown, | ||
| 95 | // 1-bit width: false, | ||
| 96 | // 4-bit width: true }, | ||
| 97 | // status: SD Status { Bus Width: One, | ||
| 98 | // Secured Mode: false, | ||
| 99 | // SD Memory Card Type: 0, | ||
| 100 | // Protected Area Size (B): 0, | ||
| 101 | // Speed Class: 0, | ||
| 102 | // Video Speed Class: 0, | ||
| 103 | // Application Performance Class: 0, | ||
| 104 | // Move Performance (MB/s): 0, | ||
| 105 | // AU Size: 0, | ||
| 106 | // Erase Size (units of AU): 0, | ||
| 107 | // Erase Timeout (s): 0, | ||
| 108 | // Discard Support: false } } | ||
| 109 | |||
| 110 | defmt::assert!(card.scr.bus_width_four()); | ||
| 111 | |||
| 68 | info!("writing pattern1..."); | 112 | info!("writing pattern1..."); |
| 69 | storage.write_block(block_idx, &pattern1).await.unwrap(); | 113 | storage.write_block(block_idx, &pattern1).await.unwrap(); |
| 70 | 114 | ||
