diff --git a/Cargo.lock b/Cargo.lock index c31baa86f..73aa1210f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9,7 +9,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59317f77929f0e679d39364702289274de2f0f0b22cbf50b2b8cff2169a0b27a" dependencies = [ "cpp_demangle", - "fallible-iterator 0.3.0", + "fallible-iterator", "gimli 0.33.0", "memmap2", "object 0.39.1", @@ -154,6 +154,24 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d62b7694a562cdf5a74227903507c56ab2cc8bdd1f781ed5cb4cf9c9f810bfc" +[[package]] +name = "async-io" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "456b8a8feb6f42d237746d4b3e9a178494627745c3c56c6ea55d92ba50d026fc" +dependencies = [ + "autocfg", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite", + "parking", + "polling", + "rustix", + "slab", + "windows-sys 0.61.2", +] + [[package]] name = "atomic" version = "0.6.1" @@ -204,11 +222,22 @@ checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" [[package]] name = "bincode" -version = "1.3.3" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +checksum = "36eaf5d7b090263e8150820482d5d93cd964a81e4019913c972f4edcc6edb740" dependencies = [ + "bincode_derive", "serde", + "unty", +] + +[[package]] +name = "bincode_derive" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf95709a440f45e986983918d0e8a1f30a9b1df04918fc828670606804ac3c09" +dependencies = [ + "virtue", ] [[package]] @@ -250,12 +279,6 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" -[[package]] -name = "bitfield" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46afbd2983a5d5a7bd740ccb198caf5b82f45c40c09c0eed36052d91cb92e719" - [[package]] name = "bitfield" version = "0.19.4" @@ -333,6 +356,20 @@ name = "bytemuck" version = "1.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8efb64bd706a16a1bdde310ae86b351e4d21550d98d056f22f8a7f7a2183fec" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9abbd1bc6865053c427f7198e6af43bfdedc55ab791faed4fbd361d789575ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] [[package]] name = "byteorder" @@ -563,6 +600,16 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f88a43d011fc4a6876cb7344703e297c71dda42494fee094d5f7c76bf13f746" +[[package]] +name = "cobs" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd93fd2c1b27acd030440c9dbd9d14c1122aad622374fe05a670b67a4bc034be" +dependencies = [ + "heapless 0.9.3", + "thiserror 2.0.18", +] + [[package]] name = "colorchoice" version = "1.0.5" @@ -575,7 +622,7 @@ version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "faf9468729b8cbcea668e36183cb69d317348c2e08e994829fb56ebfdfbaac34" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.48.0", ] [[package]] @@ -602,6 +649,15 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "console" version = "0.16.3" @@ -674,6 +730,16 @@ dependencies = [ "crossterm 0.29.0", ] +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -949,6 +1015,16 @@ dependencies = [ "darling_macro 0.13.4", ] +[[package]] +name = "darling" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" +dependencies = [ + "darling_core 0.20.11", + "darling_macro 0.20.11", +] + [[package]] name = "darling" version = "0.23.0" @@ -973,6 +1049,20 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "darling_core" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.11.1", + "syn 2.0.117", +] + [[package]] name = "darling_core" version = "0.23.0" @@ -997,6 +1087,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "darling_macro" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" +dependencies = [ + "darling_core 0.20.11", + "quote", + "syn 2.0.117", +] + [[package]] name = "darling_macro" version = "0.23.0" @@ -1014,6 +1115,31 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac6b926516df9c60bfa16e107b21086399f8285a44ca9711344b9e553c5146e2" +[[package]] +name = "deku" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9711031e209dc1306d66985363b4397d4c7b911597580340b93c9729b55f6eb" +dependencies = [ + "bitvec", + "deku_derive", + "no_std_io2", + "rustversion", +] + +[[package]] +name = "deku_derive" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58cb0719583cbe4e81fb40434ace2f0d22ccc3e39a74bb3796c22b451b4f139d" +dependencies = [ + "darling 0.20.11", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.117", +] + [[package]] name = "deltae" version = "0.3.2" @@ -1089,6 +1215,18 @@ dependencies = [ "syn 2.0.117", ] +[[package]] +name = "devinfo" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fb596a92f5b22f2ccd0f3dcaf11516ae8cff8b9f5448919893d561b4bfeb418" +dependencies = [ + "anyhow", + "libc", + "libdevinfo-sys", + "num_enum", +] + [[package]] name = "digest" version = "0.10.7" @@ -1113,6 +1251,37 @@ dependencies = [ "zeroize", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "docsplay" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8547ea80db62c5bb9d7796fcce5e6e07d1136bdc1a02269095061e806758fab4" +dependencies = [ + "docsplay-macros", +] + +[[package]] +name = "docsplay-macros" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11772ed3eb3db124d826f3abeadf5a791a557f62c19b123e3f07288158a71fdd" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + [[package]] name = "document-features" version = "0.2.12" @@ -1146,17 +1315,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" -[[package]] -name = "enum-primitive-derive" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c375b9c5eadb68d0a6efee2999fef292f45854c3444c86f09d8ab086ba942b0e" -dependencies = [ - "num-traits", - "quote", - "syn 1.0.109", -] - [[package]] name = "env_filter" version = "1.0.1" @@ -1193,7 +1351,49 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.52.0", +] + +[[package]] +name = "esp-idf-part" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5ebc2381d030e4e89183554c3fcd4ad44dc5ab34961ab09e09b4adbe4f94b61" +dependencies = [ + "bitflags 2.11.1", + "csv", + "deku", + "md-5 0.10.6", + "parse_int", + "regex", + "serde", + "serde_plain", + "strum 0.27.2", + "thiserror 2.0.18", +] + +[[package]] +name = "espflash" +version = "4.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d6712ab7c4bd91d8ff9e09bcb1356e25bf19d191177eaac264db8632707236" +dependencies = [ + "base64 0.22.1", + "bitflags 2.11.1", + "bytemuck", + "esp-idf-part", + "flate2", + "gimli 0.32.3", + "libc", + "log", + "md-5 0.11.0", + "miette", + "nix 0.30.1", + "object 0.39.1", + "serde", + "sha2 0.10.9", + "strum 0.28.0", + "thiserror 2.0.18", ] [[package]] @@ -1205,12 +1405,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "fallible-iterator" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" - [[package]] name = "fallible-iterator" version = "0.3.0" @@ -1308,6 +1502,15 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + [[package]] name = "funty" version = "2.0.0" @@ -1320,6 +1523,22 @@ version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" +[[package]] +name = "futures-io" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" + +[[package]] +name = "futures-lite" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad" +dependencies = [ + "futures-core", + "pin-project-lite", +] + [[package]] name = "futures-task" version = "0.3.32" @@ -1398,11 +1617,12 @@ dependencies = [ [[package]] name = "gimli" -version = "0.26.2" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" +checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" dependencies = [ - "fallible-iterator 0.2.0", + "fallible-iterator", + "indexmap 2.14.0", "stable_deref_trait", ] @@ -1432,7 +1652,7 @@ checksum = "983a6aafb3b12d4c41ea78d39e189af4298ce747353945ff5105b54a056e5cd9" dependencies = [ "log", "plain", - "scroll 0.13.0", + "scroll", ] [[package]] @@ -1455,6 +1675,15 @@ dependencies = [ "byteorder", ] +[[package]] +name = "hash32" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" +dependencies = [ + "byteorder", +] + [[package]] name = "hashbrown" version = "0.12.3" @@ -1497,35 +1726,41 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" dependencies = [ "atomic-polyfill", - "hash32", + "hash32 0.2.1", "rustc_version", "serde", "spin", "stable_deref_trait", ] +[[package]] +name = "heapless" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25ba4bd83f9415b58b4ed8dc5714c76e626a105be4646c02630ad730ad3b5aa4" +dependencies = [ + "hash32 0.3.1", + "stable_deref_trait", +] + [[package]] name = "heck" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +[[package]] +name = "hermit-abi" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" + [[package]] name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" -[[package]] -name = "hidapi" -version = "1.4.1" -source = "git+https://github.com/oxidecomputer/hidapi-rs?branch=oxide-stable#69f84deac74461bfc08adefd1feb8abe4fcdda26" -dependencies = [ - "cc", - "libc", - "pkg-config", -] - [[package]] name = "hif" version = "0.3.1" @@ -1630,7 +1865,7 @@ name = "humility-bin" version = "0.12.17" dependencies = [ "anyhow", - "bitfield 0.19.4", + "bitfield", "cargo_metadata", "clap", "colored", @@ -1698,14 +1933,14 @@ dependencies = [ "humility-cortex", "indexmap 2.14.0", "indicatif", - "jep106 0.3.0", + "jep106", "log", "multimap", "num-derive 0.4.2", "num-traits", "parse_int", "pmbus", - "scroll 0.13.0", + "scroll", "serde", "spd", "toml", @@ -2125,7 +2360,7 @@ dependencies = [ "humility-cli", "humility-cmd", "humility-core", - "rusb", + "nusb", ] [[package]] @@ -2493,7 +2728,7 @@ dependencies = [ "humility-i2c", "humility-log", "humility-spd", - "jep106 0.3.0", + "jep106", "parse_int", "spd", ] @@ -2645,7 +2880,7 @@ version = "0.1.0" dependencies = [ "addr2line", "anyhow", - "bitfield 0.19.4", + "bitfield", "capstone", "clap", "gimli 0.33.0", @@ -2670,7 +2905,7 @@ dependencies = [ "regex", "ron 0.12.1", "rustc-demangle", - "scroll 0.13.0", + "scroll", "serde", "serde_json", "strsim 0.11.1", @@ -2686,9 +2921,9 @@ name = "humility-cortex" version = "0.1.0" dependencies = [ "anyhow", - "bitfield 0.19.4", + "bitfield", "humility-core", - "jep106 0.3.0", + "jep106", "log", "multimap", "num-derive 0.4.2", @@ -2811,9 +3046,9 @@ dependencies = [ "log", "num-derive 0.4.2", "num-traits", + "nusb", "parse_int", "probe-rs", - "rusb", "thiserror 2.0.18", ] @@ -2896,48 +3131,151 @@ dependencies = [ ] [[package]] -name = "id-arena" -version = "2.3.0" +name = "icu_collections" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" +checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" +dependencies = [ + "displaydoc", + "potential_utf", + "utf8_iter", + "yoke", + "zerofrom", + "zerovec", +] [[package]] -name = "ident_case" -version = "1.0.1" +name = "icu_locale_core" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "idol" -version = "0.6.0" -source = "git+https://github.com/oxidecomputer/idolatry.git#2c43ec5122030a4de12861bd7071e657f8d25b7f" +checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" dependencies = [ - "indexmap 1.9.3", - "once_cell", - "prettyplease", - "proc-macro2", - "quote", - "ron 0.8.1", - "serde", - "serde_with 3.18.0", - "syn 2.0.117", + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", ] [[package]] -name = "idt8a3xxxx" -version = "0.1.0" -source = "git+https://github.com/oxidecomputer/idt8a3xxxx#68ca4e7c486c79f734fa1225383c50487bdccf23" +name = "icu_normalizer" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" dependencies = [ - "anyhow", - "ron 0.6.6", - "serde", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec 1.15.1", + "zerovec", ] [[package]] -name = "ihex" -version = "3.0.0" +name = "icu_normalizer_data" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "365a784774bb381e8c19edb91190a90d7f2625e057b55de2bc0f6b57bc779ff2" +checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" + +[[package]] +name = "icu_properties" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" + +[[package]] +name = "icu_provider" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "id-arena" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec 1.15.1", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "idol" +version = "0.6.0" +source = "git+https://github.com/oxidecomputer/idolatry.git#2c43ec5122030a4de12861bd7071e657f8d25b7f" +dependencies = [ + "indexmap 1.9.3", + "once_cell", + "prettyplease", + "proc-macro2", + "quote", + "ron 0.8.1", + "serde", + "serde_with 3.18.0", + "syn 2.0.117", +] + +[[package]] +name = "idt8a3xxxx" +version = "0.1.0" +source = "git+https://github.com/oxidecomputer/idt8a3xxxx#68ca4e7c486c79f734fa1225383c50487bdccf23" +dependencies = [ + "anyhow", + "ron 0.6.6", + "serde", +] + +[[package]] +name = "ihex" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "365a784774bb381e8c19edb91190a90d7f2625e057b55de2bc0f6b57bc779ff2" [[package]] name = "indexmap" @@ -3006,6 +3344,16 @@ dependencies = [ "syn 2.0.117", ] +[[package]] +name = "io-kit-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06d3a048d09fbb6597dbf7c69f40d14df4a49487db1487191618c893fc3b1c26" +dependencies = [ + "core-foundation-sys", + "mach2", +] + [[package]] name = "ipcc-data" version = "0.0.1" @@ -3048,27 +3396,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" -[[package]] -name = "jaylink" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f58b72b6aa9d25083b8c19d292fe015a936185fa200d15e225e1524a18222e9" -dependencies = [ - "bitflags 1.3.2", - "byteorder", - "log", - "rusb", -] - -[[package]] -name = "jep106" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c5995914d637fbd88c82bc73357c6c64417a12de380250df492e8e7c5f6d145" -dependencies = [ - "serde", -] - [[package]] name = "jep106" version = "0.3.0" @@ -3191,6 +3518,12 @@ version = "0.2.186" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" +[[package]] +name = "libdevinfo-sys" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e92d2955daf279495d959fb506f3db6d17e2d62ab103f27c7d30be27a763cec1" + [[package]] name = "libm" version = "0.2.16" @@ -3209,17 +3542,6 @@ dependencies = [ "redox_syscall 0.7.4", ] -[[package]] -name = "libusb1-sys" -version = "0.5.0" -source = "git+https://github.com/oxidecomputer/rusb?branch=probe-rs-0.12-libusb-v1.0.26#b97a32d2b36c3db5c67f58aca015039536416439" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "line-clipping" version = "0.3.7" @@ -3229,18 +3551,18 @@ dependencies = [ "bitflags 2.11.1", ] -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - [[package]] name = "linux-raw-sys" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" +[[package]] +name = "litemap" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" + [[package]] name = "litrs" version = "1.0.0" @@ -3267,7 +3589,7 @@ name = "lpc55_areas" version = "0.2.5" source = "git+https://github.com/oxidecomputer/lpc55_support#fc64732faf5511850b35f1734d572b9953d73374" dependencies = [ - "bitfield 0.19.4", + "bitfield", "clap", "packed_struct", "serde", @@ -3331,16 +3653,45 @@ version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0aeb26bf5e836cc1c341c8106051b573f1766dfa05aa87f0b98be5e51b02303" dependencies = [ - "nix", + "nix 0.29.0", "winapi", ] +[[package]] +name = "mach2" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a1b95cd5421ec55b445b5ae102f5ea0e768de1f82bd3001e11f426c269c3aea" +dependencies = [ + "libc", +] + [[package]] name = "maybe-uninit" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" +[[package]] +name = "md-5" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if", + "digest 0.10.7", +] + +[[package]] +name = "md-5" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69b6441f590336821bb897fb28fc622898ccceb1d6cea3fde5ea86b090c4de98" +dependencies = [ + "cfg-if", + "digest 0.11.2", +] + [[package]] name = "measurement-token" version = "0.1.0" @@ -3376,6 +3727,28 @@ dependencies = [ "autocfg", ] +[[package]] +name = "miette" +version = "7.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f98efec8807c63c752b5bd61f862c165c115b0a35685bdcfd9238c7aeb592b7" +dependencies = [ + "cfg-if", + "miette-derive", + "unicode-width 0.1.14", +] + +[[package]] +name = "miette-derive" +version = "7.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db5b29714e950dbb20d5e6f74f9dcec4edbcc1067bb7f8ed198c097b8c1a818b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + [[package]] name = "minimad" version = "0.13.1" @@ -3456,6 +3829,27 @@ dependencies = [ "memoffset", ] +[[package]] +name = "nix" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6" +dependencies = [ + "bitflags 2.11.1", + "cfg-if", + "cfg_aliases", + "libc", +] + +[[package]] +name = "no_std_io2" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a3564ce7035b1e4778d8cb6cacebb5d766b5e8fe5a75b9e441e33fb61a872c6" +dependencies = [ + "memchr", +] + [[package]] name = "nodrop" version = "0.1.14" @@ -3553,6 +3947,28 @@ dependencies = [ "libm", ] +[[package]] +name = "num_enum" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0bca838442ec211fa11de3a8b0e0e8f3a4522575b5c4c06ed722e005036f26" +dependencies = [ + "num_enum_derive", + "rustversion", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "680998035259dcfcafe653688bf2aa6d3e2dc05e98be6ab46afb089dc84f1df8" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.117", +] + [[package]] name = "num_threads" version = "0.1.7" @@ -3562,11 +3978,30 @@ dependencies = [ "libc", ] +[[package]] +name = "nusb" +version = "0.2.3" +source = "git+https://github.com/oxidecomputer/nusb.git?branch=add_illumos#899ccceef9a50946e87a4af4d5615e18abfc41d9" +dependencies = [ + "core-foundation", + "core-foundation-sys", + "devinfo", + "futures-core", + "io-kit-sys", + "libc", + "linux-raw-sys", + "log", + "once_cell", + "rustix", + "slab", + "windows-sys 0.61.2", +] + [[package]] name = "object" -version = "0.27.1" +version = "0.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ac1d3f9a1d3616fd9a60c8d74296f22406a238b6a72f5cc1e6f314df4ffbf9" +checksum = "271638cd5fa9cca89c4c304675ca658efc4e64a66c716b7cfe1afb4b9611dbbc" dependencies = [ "memchr", ] @@ -3613,7 +4048,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d8fae84b431384b68627d0f9b3b1245fcf9f46f6c0e3dc902e9dce64edd1967" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.48.0", ] [[package]] @@ -3644,6 +4079,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "parking" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" + [[package]] name = "parking_lot" version = "0.12.5" @@ -3887,6 +4328,20 @@ dependencies = [ "serde_with 1.14.0", ] +[[package]] +name = "polling" +version = "3.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218" +dependencies = [ + "cfg-if", + "concurrent-queue", + "hermit-abi", + "pin-project-lite", + "rustix", + "windows-sys 0.61.2", +] + [[package]] name = "portable-atomic" version = "1.13.1" @@ -3908,7 +4363,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a25c0b0ae06fcffe600ad392aabfa535696c8973f2253d9ac83171924c58a858" dependencies = [ - "heapless", + "heapless 0.7.17", "postcard-cobs", "serde", ] @@ -3919,6 +4374,15 @@ version = "0.1.5-pre" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c68cb38ed13fd7bc9dd5db8f165b7c8d9c1a315104083a2b10f11354c2af97f" +[[package]] +name = "potential_utf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" +dependencies = [ + "zerovec", +] + [[package]] name = "powerfmt" version = "0.2.0" @@ -3952,43 +4416,57 @@ dependencies = [ [[package]] name = "probe-rs" -version = "0.12.0" -source = "git+https://github.com/oxidecomputer/probe-rs.git?branch=oxide-v0.12.0#078eafb444c4e03fa7d41c7273264d00564210ce" +version = "0.31.0" +source = "git+https://github.com/oxidecomputer/probe-rs.git?branch=oxide_v0.31.0#2cfc92e4a10ea1f2755af2091bd1a06b13dc9112" dependencies = [ "anyhow", - "base64 0.13.1", + "async-io", "bincode", - "bitfield 0.13.2", + "bitfield", "bitvec", - "enum-primitive-derive", - "gimli 0.26.2", - "hidapi", + "cobs", + "docsplay", + "dunce", + "espflash", + "flate2", + "futures-lite", "ihex", - "jaylink", - "jep106 0.2.10", - "log", - "num-traits", - "object 0.27.1", - "once_cell", + "itertools 0.14.0", + "jep106", + "nusb", + "object 0.38.1", + "parking_lot", "probe-rs-target", - "rusb", - "scroll 0.10.2", + "rmp-serde", + "scroll", "serde", "serde_yaml", - "static_assertions", - "svg", - "thiserror 1.0.69", - "thousands", + "thiserror 2.0.18", + "tracing", + "uf2-decode", + "zerocopy", ] [[package]] name = "probe-rs-target" -version = "0.12.0" -source = "git+https://github.com/oxidecomputer/probe-rs.git?branch=oxide-v0.12.0#078eafb444c4e03fa7d41c7273264d00564210ce" +version = "0.31.0" +source = "git+https://github.com/oxidecomputer/probe-rs.git?branch=oxide_v0.31.0#2cfc92e4a10ea1f2755af2091bd1a06b13dc9112" dependencies = [ - "base64 0.13.1", - "jep106 0.2.10", + "base64 0.22.1", + "indexmap 2.14.0", + "jep106", "serde", + "serde_with 3.18.0", + "url", +] + +[[package]] +name = "proc-macro-crate" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" +dependencies = [ + "toml_edit 0.25.11+spec-1.1.0", ] [[package]] @@ -4264,6 +4742,25 @@ version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" +[[package]] +name = "rmp" +version = "0.8.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ba8be72d372b2c9b35542551678538b562e7cf86c3315773cae48dfbfe7790c" +dependencies = [ + "num-traits", +] + +[[package]] +name = "rmp-serde" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72f81bee8c8ef9b577d1681a70ebbc962c232461e397b22c208c43c04b67a155" +dependencies = [ + "rmp", + "serde", +] + [[package]] name = "ron" version = "0.6.6" @@ -4323,16 +4820,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "rusb" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9a5084628cc5be77b1c750b3e5ee0cc519d2f2491b3f06b78b3aac3328b00ad" -dependencies = [ - "libc", - "libusb1-sys", -] - [[package]] name = "rustc-demangle" version = "0.1.27" @@ -4358,7 +4845,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -4421,12 +4908,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "scroll" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda28d4b4830b807a8b43f7b0e6b5df875311b3e7621d84577188c175b6ec1ec" - [[package]] name = "scroll" version = "0.13.0" @@ -4532,6 +5013,15 @@ dependencies = [ "zmij", ] +[[package]] +name = "serde_plain" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1fc6db65a611022b23a0dec6975d63fb80a302cb3388835ff02c097258d50" +dependencies = [ + "serde", +] + [[package]] name = "serde_spanned" version = "1.1.1" @@ -4596,14 +5086,15 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.8.26" +version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 1.9.3", + "indexmap 2.14.0", + "itoa", "ryu", "serde", - "yaml-rust", + "unsafe-libyaml", ] [[package]] @@ -4837,6 +5328,9 @@ name = "strum" version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9628de9b8791db39ceda2b119bbe13134770b56c138ec1d3af810d045c04f9bd" +dependencies = [ + "strum_macros 0.28.0", +] [[package]] name = "strum_macros" @@ -4868,12 +5362,6 @@ version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" -[[package]] -name = "svg" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02d815ad337e8449d2374d4248448645edfe74e699343dd5719139d93fa87112" - [[package]] name = "syn" version = "1.0.109" @@ -4896,6 +5384,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + [[package]] name = "tap" version = "1.0.1" @@ -4912,7 +5411,7 @@ dependencies = [ "getrandom 0.4.2", "once_cell", "rustix", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -4996,7 +5495,7 @@ dependencies = [ "libc", "log", "memmem", - "nix", + "nix 0.29.0", "num-derive 0.4.2", "num-traits", "ordered-float", @@ -5060,12 +5559,6 @@ dependencies = [ "syn 2.0.117", ] -[[package]] -name = "thousands" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bf63baf9f5039dadc247375c29eb13706706cfde997d0330d05aa63a77d8820" - [[package]] name = "time" version = "0.3.47" @@ -5100,6 +5593,16 @@ dependencies = [ "time-core", ] +[[package]] +name = "tinystr" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tls_codec" version = "0.4.2" @@ -5178,6 +5681,18 @@ dependencies = [ "serde", ] +[[package]] +name = "toml_edit" +version = "0.25.11+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b59c4d22ed448339746c59b905d24568fcbb3ab65a500494f7b8c3e97739f2b" +dependencies = [ + "indexmap 2.14.0", + "toml_datetime", + "toml_parser", + "winnow", +] + [[package]] name = "toml_parser" version = "1.1.2+spec-1.1.0" @@ -5193,6 +5708,37 @@ version = "1.1.1+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "756daf9b1013ebe47a8776667b466417e2d4c5679d441c26230efd9ef78692db" +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", +] + [[package]] name = "trycmd" version = "0.13.7" @@ -5206,7 +5752,7 @@ dependencies = [ "serde", "shlex", "snapbox", - "toml_edit", + "toml_edit 0.14.4", ] [[package]] @@ -5250,6 +5796,12 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" +[[package]] +name = "uf2-decode" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca77d41ab27e3fa45df42043f96c79b80c6d8632eed906b54681d8d47ab00623" + [[package]] name = "unicode-ident" version = "1.0.24" @@ -5297,6 +5849,37 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81e544489bf3d8ef66c953931f56617f423cd4b5494be343d9b9d3dda037b9a3" +[[package]] +name = "unsafe-libyaml" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" + +[[package]] +name = "unty" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d49784317cd0d1ee7ec5c716dd598ec5b4483ea832a2dced265471cc0f690ae" + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", + "serde_derive", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.2" @@ -5315,18 +5898,18 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +[[package]] +name = "virtue" +version = "0.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "051eb1abcf10076295e815102942cc58f9d5e3b4560e46e53c21e8ff6f3af7b1" + [[package]] name = "void" version = "1.0.2" @@ -5589,7 +6172,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.48.0", ] [[package]] @@ -5810,6 +6393,9 @@ name = "winnow" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2ee1708bef14716a11bae175f579062d4554d95be2c6829f518df847b7b3fdd0" +dependencies = [ + "memchr", +] [[package]] name = "wit-bindgen" @@ -5905,6 +6491,12 @@ dependencies = [ "wasmparser", ] +[[package]] +name = "writeable" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" + [[package]] name = "wyz" version = "0.5.1" @@ -5943,12 +6535,26 @@ dependencies = [ ] [[package]] -name = "yaml-rust" -version = "0.4.5" +name = "yoke" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abe8c5fda708d9ca3df187cae8bfb9ceda00dd96231bed36e445a1a48e66f9ca" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" +checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" dependencies = [ - "linked-hash-map", + "proc-macro2", + "quote", + "syn 2.0.117", + "synstructure", ] [[package]] @@ -5971,6 +6577,27 @@ dependencies = [ "syn 2.0.117", ] +[[package]] +name = "zerofrom" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69faa1f2a1ea75661980b013019ed6687ed0e83d069bc1114e2cc74c6c04c4df" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", + "synstructure", +] + [[package]] name = "zeroize" version = "1.8.2" @@ -5991,6 +6618,39 @@ dependencies = [ "syn 2.0.117", ] +[[package]] +name = "zerotrie" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + [[package]] name = "zip" version = "8.6.0" diff --git a/Cargo.toml b/Cargo.toml index 5ce4297f9..4d41538b4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -102,12 +102,17 @@ tlvc-text = { git = "https://github.com/oxidecomputer/tlvc", version = "0.4.0" } turin-post-decoder = { git = "https://github.com/oxidecomputer/turin-post-decoder" } vsc7448-info = { git = "https://github.com/oxidecomputer/vsc7448.git" } vsc7448-types = { git = "https://github.com/oxidecomputer/vsc7448.git" } +# This will ideally be merged soon +nusb = { git = "https://github.com/oxidecomputer/nusb.git", branch = "add_illumos" } # # We depend on the oxide-stable branch of Oxide's fork of probe-rs to assure -# that we can float necessary patches on probe-rs. +# that we can float necessary patches on probe-rs. # -probe-rs = { git = "https://github.com/oxidecomputer/probe-rs.git", branch = "oxide-v0.12.0" } +# As of this commit the patches are pretty minimal: an updated nusb branch +# with illumos support and some tweaks to avoid the need to pull in +# serialport. The dream would still be to run a regular probe-rs release. +probe-rs = { git = "https://github.com/oxidecomputer/probe-rs.git", branch = "oxide_v0.31.0", default-features = false, features = ["builtin-targets"] } # Local `path`-based deps humility = { path = "./humility-core", package = "humility-core" } @@ -233,7 +238,6 @@ raw-cpuid = { version = "11.0.0", features = ["display"] } rayon = "1.7" regex = "1.5.5" ron = "0.12" -rusb = "0.8.1" rustc-demangle = "0.1.21" scroll = "0.13" serde = { version = "1.0.228", features = ["derive"] } @@ -263,7 +267,3 @@ debug = true inherits = "release" debug = false debug-assertions = true - -[patch.crates-io] -libusb1-sys = { git = "https://github.com/oxidecomputer/rusb", branch = "probe-rs-0.12-libusb-v1.0.26" } -hidapi = { git = "https://github.com/oxidecomputer/hidapi-rs", branch = "oxide-stable" } diff --git a/cmd/debugmailbox/src/lib.rs b/cmd/debugmailbox/src/lib.rs index 6de6a9011..d286c8011 100644 --- a/cmd/debugmailbox/src/lib.rs +++ b/cmd/debugmailbox/src/lib.rs @@ -33,17 +33,18 @@ use byteorder::{ByteOrder, LittleEndian, WriteBytesExt}; use clap::{CommandFactory, Parser}; use humility_cli::ExecutionContext; use humility_cmd::Command; -use probe_rs::{ - DebugProbeError, DebugProbeSelector, Probe, - architecture::arm::{ApAddress, ArmProbeInterface, DapError, DpAddress}, +use probe_rs::architecture::arm::{ + ArmDebugInterface, ArmError, DapError, FullyQualifiedApAddress, + sequences::DefaultArmSequence, }; +use probe_rs::probe::DebugProbeSelector; // The debug mailbox registers // See 51.5.5.1 of Rev 2.4 of the LPC55 manual -const CSW: u8 = 0x0; -const REQUEST: u8 = 0x4; -const RETURN: u8 = 0x8; -const IDR: u8 = 0xFC; +const CSW: u64 = 0x0; +const REQUEST: u64 = 0x4; +const RETURN: u64 = 0x8; +const IDR: u64 = 0xFC; // Are we talking to the wrong chip? const SP_IDR: u32 = 0x54770002; @@ -104,9 +105,9 @@ enum DebugMailboxCmd { } fn poll_raw_ap_register( - probe: &mut Box, - ap: &ApAddress, - addr: u8, + probe: &mut Box, + ap: &FullyQualifiedApAddress, + addr: u64, mut f: impl FnMut(u32) -> Result, mut timeout_ms: usize, ) -> Result { @@ -118,30 +119,13 @@ fn poll_raw_ap_register( // this initial delay. std::thread::sleep(std::time::Duration::from_millis(10)); - match probe.read_raw_ap_register(*ap, addr) { + match probe.read_raw_ap_register(ap, addr) { Ok(val) => match f(val) { Ok(true) => return Ok(val), Ok(false) => (), Err(e) => return Err(e), }, - Err(DebugProbeError::ArchitectureSpecific(arch_err)) => { - match arch_err.downcast::() { - Ok(dap_err) => match *dap_err { - DapError::WaitResponse => {} - e => { - return Err(DebugProbeError::ArchitectureSpecific( - e.into(), - ) - .into()); - } - }, - Err(e) => { - return Err( - DebugProbeError::ArchitectureSpecific(e).into() - ); - } - } - } + Err(ArmError::Dap(DapError::WaitResponse)) => {} Err(x) => return Err(x.into()), } @@ -155,12 +139,12 @@ fn poll_raw_ap_register( } fn alive<'a>( - probe: &mut Box, - addr: &ApAddress, + probe: &mut Box, + addr: &FullyQualifiedApAddress, reset: bool, ) -> Result<()> { if reset { - probe.write_raw_ap_register(*addr, CSW, 0x21)?; + probe.write_raw_ap_register(addr, CSW, 0x21)?; println!("Resetting chip via SYSREQRESET!"); } @@ -171,11 +155,11 @@ fn alive<'a>( } fn write_request_reg<'a>( - probe: &mut Box, - addr: &ApAddress, + probe: &mut Box, + addr: &FullyQualifiedApAddress, val: u32, ) -> Result<()> { - probe.write_raw_ap_register(*addr, REQUEST, val)?; + probe.write_raw_ap_register(addr, REQUEST, val)?; let _ = poll_raw_ap_register( probe, @@ -198,8 +182,8 @@ fn write_request_reg<'a>( } fn write_req<'a>( - probe: &mut Box, - addr: &ApAddress, + probe: &mut Box, + addr: &FullyQualifiedApAddress, command: DMCommand, args: &[u32], ) -> Result> { @@ -258,8 +242,8 @@ fn write_req<'a>( } fn read_return<'a>( - probe: &mut Box, - addr: &ApAddress, + probe: &mut Box, + addr: &FullyQualifiedApAddress, ) -> Result { poll_raw_ap_register(probe, addr, RETURN, |_| Ok(true), 1000) .context("Reading debugmailbox RETURN register") @@ -269,14 +253,15 @@ fn debugmailboxcmd(context: &mut ExecutionContext) -> Result<()> { let subargs = DebugMailboxArgs::try_parse_from(&context.cli.cmd)?; // Get a list of all available debug probes. - let probes = Probe::list_all(); + let list = probe_rs::probe::list::Lister::new(); + let probes = list.list_all(); if probes.is_empty() { bail!("No probes found!"); } let mut probe = match &context.cli.probe { - Some(p) => match TryInto::::try_into(p.clone()) { + Some(p) => match p.parse::() { Ok(selector) => { let vid = selector.vendor_id; let pid = selector.product_id; @@ -301,12 +286,10 @@ fn debugmailboxcmd(context: &mut ExecutionContext) -> Result<()> { probe.attach_to_unspecified()?; let mut iface = probe - .try_into_arm_interface() - .unwrap() - .initialize_unspecified() + .try_into_arm_debug_interface(DefaultArmSequence::create()) .unwrap(); - let dm_port = ApAddress { dp: DpAddress::Default, ap: 2 }; + let dm_port = FullyQualifiedApAddress::v1_with_default_dp(2); // Check if this is a debug mailbox. This is based on the sequence from // the LPC55 Debug Mailbox user manual @@ -315,7 +298,7 @@ fn debugmailboxcmd(context: &mut ExecutionContext) -> Result<()> { // handles this for us // Check the IDR - let val = iface.read_raw_ap_register(dm_port, IDR)?; + let val = iface.read_raw_ap_register(&dm_port, IDR)?; if val != DM_ID { if val == SP_IDR { diff --git a/cmd/lsusb/Cargo.toml b/cmd/lsusb/Cargo.toml index 6117765df..03e879dfd 100644 --- a/cmd/lsusb/Cargo.toml +++ b/cmd/lsusb/Cargo.toml @@ -10,4 +10,4 @@ humility-cmd = { workspace = true } humility-cli = { workspace = true } clap = { workspace = true } anyhow = { workspace = true } -rusb = {workspace = true} +nusb = {workspace = true} diff --git a/cmd/lsusb/src/lib.rs b/cmd/lsusb/src/lib.rs index 4a52c7283..0fdbffae0 100644 --- a/cmd/lsusb/src/lib.rs +++ b/cmd/lsusb/src/lib.rs @@ -11,6 +11,7 @@ use anyhow::{Context, Result, anyhow}; use clap::{CommandFactory, Parser}; use humility_cli::ExecutionContext; use humility_cmd::Command; +use nusb::{MaybeFuture, descriptors::language_id::US_ENGLISH}; use std::collections::HashMap; use std::time::Duration; @@ -34,17 +35,17 @@ fn lsusb(context: &mut ExecutionContext) -> Result<()> { HashMap::new() }; - let devices = rusb::devices()?; + let devices = nusb::list_devices().wait()?; let mut successes = vec![]; let mut failures = vec![]; - for dev in devices.iter() { + for dev in devices { match list1(&dev) { Ok(summary) => successes.push(summary), Err(e) => { failures.push(( - dev.bus_number(), - dev.address(), - dev.port_number(), + dev.busnum(), + dev.device_address(), + dev.port_chain()[0], e, )); } @@ -106,36 +107,51 @@ fn lsusb(context: &mut ExecutionContext) -> Result<()> { Ok(()) } -fn list1( - dev: &rusb::Device, -) -> Result<(String, String)> { - const TIMEOUT: Duration = Duration::from_secs(1); - - let desc = dev.device_descriptor()?; - let vid = desc.vendor_id(); - let pid = desc.product_id(); +fn list1(dev: &nusb::DeviceInfo) -> Result<(String, String)> { + let timeout = Duration::from_millis(100); + let vid = dev.vendor_id(); + let pid = dev.product_id(); + + let dev = dev + .open() + .wait() + .map_err(|e| anyhow!("{vid:04x}:{pid:04x}:???\topen failed: {e}"))?; + let dev_descriptor = dev.device_descriptor(); + + let languages: Vec = dev + .get_string_descriptor_supported_languages(timeout) + .wait() + .map(|i| i.collect()) + .unwrap_or_default(); + + let language = languages.first().copied().unwrap_or(US_ENGLISH); + + let man = if let Some(i_manufacturer) = + dev_descriptor.manufacturer_string_index() + { + dev.get_string_descriptor(i_manufacturer, language, timeout) + .wait() + .unwrap_or("(manufacturer unknown)".to_string()) + } else { + "(manufacturer unknown)".to_string() + }; - let handle = match dev.open() { - Ok(handle) => handle, - Err(e) => { - return Err(anyhow!("{vid:04x}:{pid:04x}:???\topen failed: {e}")); - } + let prod = if let Some(i_product) = dev_descriptor.product_string_index() { + dev.get_string_descriptor(i_product, language, timeout) + .wait() + .unwrap_or("(product unknown)".to_string()) + } else { + "(product unknown)".to_string() }; - let lang = *handle - .read_languages(TIMEOUT)? - .iter() - .find(|lang| lang.primary_language() == rusb::PrimaryLanguage::English) - .ok_or_else(|| anyhow!("can't find English strings"))?; - - let man = handle - .read_manufacturer_string(lang, &desc, TIMEOUT) - .unwrap_or_else(|_| "(manufacturer unknown)".to_string()); - let prod = handle - .read_product_string(lang, &desc, TIMEOUT) - .unwrap_or_else(|_| "(product unknown)".to_string()); - let serial = handle - .read_serial_number_string(lang, &desc, TIMEOUT) - .unwrap_or_else(|_| "(serial unknown)".to_string()); + + let serial = + if let Some(i_serial) = dev_descriptor.serial_number_string_index() { + dev.get_string_descriptor(i_serial, language, timeout) + .wait() + .unwrap_or("(serial unknown)".to_string()) + } else { + "(serial unknown)".to_string() + }; Ok((format!("{vid:04x}:{pid:04x}:{serial}"), format!("{man}\t{prod}"))) } diff --git a/cmd/rendmp/src/lib.rs b/cmd/rendmp/src/lib.rs index ad3cde1aa..595bb4015 100644 --- a/cmd/rendmp/src/lib.rs +++ b/cmd/rendmp/src/lib.rs @@ -166,7 +166,7 @@ use std::io::Write; use std::io::prelude::*; use std::thread; use std::time::{Duration, Instant}; -use strum::VariantNames; +use strum::VariantNames as _; use strum_macros::VariantNames; use zerocopy::{FromBytes, IntoBytes}; diff --git a/humility-probes-core/Cargo.toml b/humility-probes-core/Cargo.toml index 4bc77dc69..abfe649c9 100644 --- a/humility-probes-core/Cargo.toml +++ b/humility-probes-core/Cargo.toml @@ -18,4 +18,4 @@ num-traits.workspace = true parse_int.workspace = true probe-rs.workspace = true thiserror.workspace = true -rusb.workspace = true +nusb.workspace = true diff --git a/humility-probes-core/src/lib.rs b/humility-probes-core/src/lib.rs index 89ca2e881..23f321d67 100644 --- a/humility-probes-core/src/lib.rs +++ b/humility-probes-core/src/lib.rs @@ -3,8 +3,11 @@ // file, You can obtain one at https://mozilla.org/MPL/2.0/. use ::probe_rs::{ - DebugProbeError, DebugProbeInfo, DebugProbeSelector, Probe, - ProbeCreationError, + Permissions, + probe::{ + DebugProbeError, DebugProbeInfo, DebugProbeSelector, Probe, + ProbeCreationError, + }, }; use humility::core::{Core, ProbeError}; @@ -34,7 +37,8 @@ fn parse_probe(probe: &str) -> (&str, Option) { } fn get_usb_probe(index: Option) -> Result { - let probes = Probe::list_all(); + let lister = ::probe_rs::probe::list::Lister::new(); + let probes = lister.list_all(); if probes.is_empty() { return Err(ProbeError::NoProbeFound.into()); @@ -60,44 +64,43 @@ fn get_usb_probe(index: Option) -> Result { } } -/// [`probe_rs::Probe::open`] with specialized error messages and speed -/// configuration -fn open_probe + Clone>( - selector: T, +fn open_probe_from_selector( + selector: DebugProbeSelector, speed_khz: Option, ) -> Result { - let probe_selector: DebugProbeSelector = selector.clone().into(); - let res = Probe::open(selector); - - // the following error customizations could be a match statement but until - // if let guards stabilize it would be a kludge - - if let Err(DebugProbeError::ProbeCouldNotBeCreated( - ProbeCreationError::NotFound, - )) = res - { - if probe_selector.serial_number.is_some() { - bail!( - "Could not find probe {}.\n\ + let lister = ::probe_rs::probe::list::Lister::new(); + let mut probe = match lister.open(selector.clone()) { + Ok(p) => p, + Err(DebugProbeError::ProbeCouldNotBeCreated( + ProbeCreationError::NotFound, + )) => { + if selector.serial_number.is_some() { + bail!( + "Could not find probe {}.\n\ \n\ Because a serial number is present, this may be due to not \ running humility with permission to read USB device serial \ numbers; if not root already, run again as root?", - probe_selector - ); - } else { - bail!("Could not find probe {}.", probe_selector); + selector + ); + } else { + bail!("Could not find probe {}.", selector); + } } - } - - if let Err(DebugProbeError::Usb(Some(ref err))) = res - && let Some(rcode) = err.downcast_ref::() - && *rcode == rusb::Error::Busy - { - bail!("USB link in use; is OpenOCD or another debugger running?"); - } - - let mut probe = res?; + Err(DebugProbeError::Usb(err)) => { + let msg = format!("Usb Error: {err:?}"); + if let Ok(rcode) = err.downcast::() + && rcode.kind() == nusb::ErrorKind::Busy + { + bail!( + "USB link in use; is OpenOCD or another debugger running?" + ); + } else { + bail!(msg); + } + } + Err(e) => bail!("{e:?}"), + }; if let Some(speed) = speed_khz { probe.set_speed(speed)?; @@ -117,7 +120,10 @@ pub fn attach_to_probe( "usb" => { let probe_info = get_usb_probe(index)?; - let probe = open_probe(&probe_info, speed_khz)?; + let mut probe = probe_info.open()?; + if let Some(speed) = speed_khz { + probe.set_speed(speed)?; + } crate::msg!("Opened probe {}", probe_info.identifier); Ok(Box::new(unattached::UnattachedCore::new( @@ -129,13 +135,13 @@ pub fn attach_to_probe( ))) } "auto" => attach_to_probe("usb", speed_khz), - _ => match TryInto::::try_into(probe) { + _ => match probe.parse::() { Ok(selector) => { let vidpid = probe; let vid = selector.vendor_id; let pid = selector.product_id; let serial = selector.serial_number.clone(); - let probe = open_probe(selector, speed_khz)?; + let probe = open_probe_from_selector(selector, speed_khz)?; let name = probe.get_name(); crate::msg!("Opened {vidpid} via {name}"); @@ -160,20 +166,27 @@ pub fn attach_to_chip( "usb" => { let probe_info = get_usb_probe(index)?; - let probe = open_probe(&probe_info, speed_khz)?; + let mut probe = probe_info.open()?; + if let Some(speed) = speed_khz { + probe.set_speed(speed)?; + } let name = probe.get_name(); // // probe-rs needs us to specify a chip that it knows about -- but // it only really uses this information for flashing the part. If // we are attaching to the part for not pusposes of flashing, we - // specify a generic ARMv7-M (but then we also indicate that can't + + // specify a generic Cortex-M3 (but then we also indicate that can't // flash to assure that we can fail explicitly should flashing be // attempted). // let (session, can_flash) = match chip { - Some(chip) => (probe.attach(chip)?, true), - None => (probe.attach("armv7m")?, false), + Some(chip) => ( + probe.attach(chip, Permissions::new().allow_erase_all())?, + true, + ), + None => (probe.attach("Cortex-M3", Permissions::new())?, false), }; crate::msg!("attached via {name}"); @@ -189,7 +202,7 @@ pub fn attach_to_chip( } "auto" => attach_to_chip("usb", chip, speed_khz), - _ => match TryInto::::try_into(probe) { + _ => match probe.parse::() { Ok(selector) => { let vidpid = probe; @@ -197,16 +210,24 @@ pub fn attach_to_chip( let pid = selector.product_id; let serial = selector.serial_number.clone(); - let probe = open_probe(selector, speed_khz)?; + let probe = open_probe_from_selector(selector, speed_khz)?; let name = probe.get_name(); // // See the block comment in the generic "usb" attach for - // why we use armv7m here. + // why we use Cortex-M3 here. // let (session, can_flash) = match chip { - Some(chip) => (probe.attach(chip)?, true), - None => (probe.attach("armv7m")?, false), + Some(chip) => ( + probe.attach( + chip, + Permissions::new().allow_erase_all(), + )?, + true, + ), + None => { + (probe.attach("Cortex-M3", Permissions::new())?, false) + } }; crate::msg!("attached to {vidpid} via {name}"); diff --git a/humility-probes-core/src/probe_rs.rs b/humility-probes-core/src/probe_rs.rs index 3cfa9b2f7..4dce95c05 100644 --- a/humility-probes-core/src/probe_rs.rs +++ b/humility-probes-core/src/probe_rs.rs @@ -5,14 +5,17 @@ use anyhow::{Context, Result, bail}; use humility::core::Core; use humility_arch_arm::ARMRegister; -use std::cell::RefCell; -use std::collections::BTreeMap; +use std::collections::{BTreeMap, HashMap}; use std::path::Path; -use std::rc::Rc; use probe_rs::MemoryInterface; use probe_rs::flashing; +use indicatif::{MultiProgress, ProgressBar, ProgressStyle}; +use probe_rs::flashing::Format; +use probe_rs::flashing::ProgressEvent; +use std::time::Duration; + pub struct ProbeCore { pub session: probe_rs::Session, pub identifier: String, @@ -68,6 +71,155 @@ impl ProbeCore { } } +// This is based on what probe-rs was doing for its internal tooling + +#[derive(Clone, Copy, PartialEq, Eq, Hash)] +enum Operation { + /// Reading back flash contents to restore erased regions that should be kept unchanged. + Fill, + + /// Erasing flash sectors. + Erase, + + /// Writing data to flash. + Program, + + /// Checking flash contents. + Verify, +} + +impl From for Operation { + fn from(operation: flashing::ProgressOperation) -> Self { + match operation { + flashing::ProgressOperation::Fill => Operation::Fill, + flashing::ProgressOperation::Erase => Operation::Erase, + flashing::ProgressOperation::Program => Operation::Program, + flashing::ProgressOperation::Verify => Operation::Verify, + } + } +} + +#[derive(Default)] +pub struct ProgressBars { + bars: HashMap, +} + +impl ProgressBars { + fn get_mut>( + &mut self, + operation: T, + ) -> &mut ProgressBarGroup { + let operation = operation.into(); + self.bars.entry(operation).or_insert_with(|| { + let message = match operation { + Operation::Erase => "Erasing", + Operation::Fill => "Reading flash", + Operation::Program => "Programming", + Operation::Verify => "Verifying", + }; + ProgressBarGroup::new(format!("{message:>13}")) + }) + } +} + +pub struct ProgressBarGroup { + message: String, + bars: Vec, + selected: usize, +} + +impl ProgressBarGroup { + pub fn new(message: String) -> Self { + Self { message, bars: vec![], selected: 0 } + } + + fn idle(has_length: bool) -> ProgressStyle { + let template = if has_length { + "{msg:.green.bold} {spinner} {percent:>3}% [{bar:20}]" + } else { + "{msg:.green.bold} {spinner}" + }; + ProgressStyle::with_template(template) + .expect("Error in progress bar creation. This is a bug, please report it.") + .progress_chars("--") + } + + fn active(has_length: bool) -> ProgressStyle { + let template = if has_length { + "{msg:.green.bold} {spinner} {percent:>3}% [{bar:20}] {bytes:>10} @ {bytes_per_sec:>12} (ETA {eta})" + } else { + "{msg:.green.bold} {spinner} {elapsed}" + }; + ProgressStyle::with_template(template) + .expect("Error in progress bar creation. This is a bug, please report it.") + .progress_chars("##-") + } + + fn finished(has_length: bool) -> ProgressStyle { + let template = if has_length { + "{msg:.green.bold} {spinner} {percent:>3}% [{bar:20}] {bytes:>10} @ {bytes_per_sec:>12} (took {elapsed})" + } else { + "{msg:.green.bold} {spinner} {elapsed}" + }; + ProgressStyle::with_template(template) + .expect("Error in progress bar creation. This is a bug, please report it.") + .progress_chars("##") + } + + pub fn add(&mut self, bar: ProgressBar) { + if !self.bars.is_empty() { + bar.set_message(format!( + "{} {}", + self.message, + self.bars.len() + 1 + )); + } else { + bar.set_message(self.message.clone()); + } + bar.set_style(Self::idle(bar.length().is_some())); + bar.enable_steady_tick(Duration::from_millis(100)); + bar.reset_elapsed(); + + self.bars.push(bar); + } + + pub fn inc(&mut self, size: u64) { + if let Some(bar) = self.bars.get(self.selected) { + bar.set_style(Self::active(bar.length().is_some())); + bar.inc(size); + } + } + + pub fn abandon(&mut self) { + if let Some(bar) = self.bars.get(self.selected) { + bar.abandon(); + } + self.next(); + } + + pub fn finish(&mut self) { + if let Some(bar) = self.bars.get(self.selected) { + bar.set_style(Self::finished(bar.length().is_some())); + if let Some(length) = bar.length() { + bar.inc(length.saturating_sub(bar.position())); + } + bar.finish(); + } + self.next(); + } + pub fn next(&mut self) { + self.selected += 1; + } + + pub fn mark_start_now(&mut self) { + if let Some(bar) = self.bars.get(self.selected) { + bar.set_style(Self::active(bar.length().is_some())); + bar.reset_elapsed(); + bar.reset_eta(); + } + } +} + pub const CORE_MAX_READSIZE: usize = 65536; // 64K ought to be enough for anyone #[rustfmt::skip::macros(anyhow, bail)] @@ -93,7 +245,7 @@ impl Core for ProbeCore { && addr + 4 < range.0 + range.1 { let mut core = self.session.core(0)?; - return core.read_word_32(addr).with_context(|| { + return core.read_word_32(addr.into()).with_context(|| { format!( "failed to perform unhalted word read at address {addr:#x}", ) @@ -101,7 +253,7 @@ impl Core for ProbeCore { } self.halt_and_read(|core| { - rval = core.read_word_32(addr).with_context(|| { + rval = core.read_word_32(addr.into()).with_context(|| { format!( "failed to perform halted word read at address {addr:#x}" ) @@ -123,7 +275,7 @@ impl Core for ProbeCore { && addr + (data.len() as u32) < range.0 + range.1 { let mut core = self.session.core(0)?; - return core.read_8(addr, data).with_context(|| { + return core.read_8(addr.into(), data).with_context(|| { format!( "failed to perform unhalted read at address \ {addr:#x} for length {}", @@ -133,7 +285,7 @@ impl Core for ProbeCore { } self.halt_and_read(|core| { - core.read_8(addr, data).with_context(|| { + core.read_8(addr.into(), data).with_context(|| { format!( "failed to perform halted read at address \ {addr:#x} for length {}", @@ -147,7 +299,7 @@ impl Core for ProbeCore { let mut core = self.session.core(0)?; use num_traits::ToPrimitive; - Ok(core.read_core_reg(Into::::into( + Ok(core.read_core_reg(Into::::into( ARMRegister::to_u16(®).unwrap(), ))?) } @@ -157,7 +309,7 @@ impl Core for ProbeCore { use num_traits::ToPrimitive; core.write_core_reg( - Into::::into( + Into::::into( ARMRegister::to_u16(®).unwrap(), ), value, @@ -168,13 +320,13 @@ impl Core for ProbeCore { fn write_word_32(&mut self, addr: u32, data: u32) -> Result<()> { let mut core = self.session.core(0)?; - core.write_word_32(addr, data)?; + core.write_word_32(addr.into(), data)?; Ok(()) } fn write_8(&mut self, addr: u32, data: &[u8]) -> Result<()> { let mut core = self.session.core(0)?; - core.write_8(addr, data)?; + core.write_8(addr.into(), data)?; Ok(()) } @@ -205,85 +357,51 @@ impl Core for ProbeCore { } fn load(&mut self, path: &Path) -> Result<()> { - #[derive(Debug, Default)] - struct LoadProgress { - /// total bytes that need to be erased - total_erase: usize, - - /// bytes that have been erased - erased: usize, - - /// total bytes that need to be written - total_write: usize, - - /// number of bytes that have been written - written: usize, - } - - use indicatif::{ProgressBar, ProgressStyle}; - if !self.can_flash { bail!("cannot flash without explicitly attaching to flash"); } - let progress = - Rc::new(RefCell::new(LoadProgress { ..Default::default() })); + let multi_progress = MultiProgress::new(); + let mut progress_bars = ProgressBars::default(); - let bar = ProgressBar::new(0); - let erase_style = ProgressStyle::default_bar() - .template("humility: erasing [{bar:30}] {bytes}/{total_bytes}")?; - let flash_style = ProgressStyle::default_bar() - .template("humility: flashing [{bar:30}] {bytes}/{total_bytes}")?; let progress = flashing::FlashProgress::new(move |event| match event { - flashing::ProgressEvent::Initialized { flash_layout } => { - progress.borrow_mut().total_erase = flash_layout - .sectors() - .iter() - .map(|s| s.size() as usize) - .sum(); - - progress.borrow_mut().total_write = flash_layout - .pages() - .iter() - .map(|s| s.size() as usize) - .sum(); - - bar.set_style(erase_style.clone()); - bar.set_length(progress.borrow().total_erase as u64); + ProgressEvent::FlashLayoutReady { .. } => {} + + ProgressEvent::AddProgressBar { operation, total } => { + let bar = multi_progress.add(if let Some(total) = total { + // We were promised a length, but in this implementation it + // may come later in the Started message. Set to at least 1 + // to avoid progress bars starting from 100% + ProgressBar::new(total.max(1)) + } else { + ProgressBar::no_length() + }); + progress_bars.get_mut(operation).add(bar); } - - flashing::ProgressEvent::SectorErased { size, .. } => { - progress.borrow_mut().erased += size as usize; - bar.set_position(progress.borrow().erased as u64); + ProgressEvent::Started(operation) => { + progress_bars.get_mut(operation).mark_start_now(); } - - flashing::ProgressEvent::PageProgrammed { size, .. } => { - let mut progress = progress.borrow_mut(); - - if progress.written == 0 { - progress.erased = progress.total_erase; - bar.set_style(flash_style.clone()); - bar.set_length(progress.total_write as u64); - } - - progress.written += size as usize; - bar.set_position(progress.written as u64); + ProgressEvent::Progress { operation, size, time: _ } => { + progress_bars.get_mut(operation).inc(size); } - - flashing::ProgressEvent::FinishedProgramming => { - bar.finish_and_clear(); + ProgressEvent::Failed(operation) => { + progress_bars.get_mut(operation).abandon(); + } + ProgressEvent::Finished(operation) => { + progress_bars.get_mut(operation).finish(); + } + ProgressEvent::DiagnosticMessage { message } => { + println!("{}", message); } - - _ => {} }); let mut options = flashing::DownloadOptions::default(); - options.progress = Some(&progress); + options.progress = progress; if let Err(e) = flashing::download_file_with_options( &mut self.session, path, - flashing::Format::Hex, + Format::Hex, options, ) { bail!("Flash loading failed {:?}", e); diff --git a/humility-probes-core/src/unattached.rs b/humility-probes-core/src/unattached.rs index 67d3d566f..f4173f704 100644 --- a/humility-probes-core/src/unattached.rs +++ b/humility-probes-core/src/unattached.rs @@ -8,7 +8,7 @@ use humility_arch_arm::ARMRegister; use std::path::Path; pub struct UnattachedCore { - pub probe: probe_rs::Probe, + pub probe: probe_rs::probe::Probe, pub identifier: String, pub vendor_id: u16, pub product_id: u16, @@ -17,7 +17,7 @@ pub struct UnattachedCore { impl UnattachedCore { pub(crate) fn new( - probe: probe_rs::Probe, + probe: probe_rs::probe::Probe, identifier: String, vendor_id: u16, product_id: u16,