diff --git a/async/rust-toolchain.toml b/async/rust-toolchain.toml index 549c09309e4ec5378a36667cd306ebf243a6ecc3..5f813cc7a05c100742c6799b30c74bf6fea9cae3 100644 --- a/async/rust-toolchain.toml +++ b/async/rust-toolchain.toml @@ -1,7 +1,9 @@ # Before upgrading check that everything is available on all tier1 targets here: # https://rust-lang.github.io/rustup-components-history + +# 2023-04-15 has ICE building picow demo [toolchain] -channel = "nightly-2023-04-07" +channel = "nightly-2023-04-08" components = [ "rust-src", "rustfmt" ] targets = [ "thumbv6m-none-eabi", diff --git a/embassy/demos/picow/Cargo.lock b/embassy/demos/picow/Cargo.lock index b0b6eac96a00479c6702d5579c1de3d700cf5cab..6200bf3fdade9afc73418ae0b06ee9f9f2440f03 100644 --- a/embassy/demos/picow/Cargo.lock +++ b/embassy/demos/picow/Cargo.lock @@ -14,6 +14,21 @@ dependencies = [ "zeroize", ] +[[package]] +name = "aho-corasick" +version = "0.7.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +dependencies = [ + "memchr", +] + +[[package]] +name = "arrayvec" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" + [[package]] name = "as-slice" version = "0.1.5" @@ -41,6 +56,15 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16" +[[package]] +name = "ascii-canvas" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" +dependencies = [ + "term", +] + [[package]] name = "atomic-polyfill" version = "0.1.11" @@ -92,6 +116,21 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8fe8f5a8a398345e52358e18ff07cc17a568fbca5c6f73873d3a62056309603" +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + [[package]] name = "bitfield" version = "0.13.2" @@ -134,6 +173,12 @@ dependencies = [ "sha2", ] +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" + [[package]] name = "cfg-if" version = "1.0.0" @@ -162,6 +207,16 @@ dependencies = [ "zeroize", ] +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + [[package]] name = "cortex-m" version = "0.7.7" @@ -220,6 +275,12 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6548a0ad5d2549e111e1f6a11a6c2e2d00ce6a3dafe22948d67c2b443f775e52" +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + [[package]] name = "crypto-common" version = "0.1.6" @@ -242,7 +303,7 @@ dependencies = [ [[package]] name = "cyw43" version = "0.1.0" -source = "git+https://github.com/embassy-rs/cyw43/#e3492862e994b0c46b23b486cae2935c2c0e05a0" +source = "git+https://github.com/embassy-rs/cyw43/?rev=46efce6ea2d4280d5e8e1eaece53269a94fb4847#46efce6ea2d4280d5e8e1eaece53269a94fb4847" dependencies = [ "atomic-polyfill 0.1.11", "cortex-m", @@ -252,12 +313,23 @@ dependencies = [ "embassy-net-driver-channel", "embassy-sync", "embassy-time", - "embedded-hal 1.0.0-alpha.9", - "embedded-hal-async", + "embedded-hal 1.0.0-alpha.10", "futures", "num_enum", ] +[[package]] +name = "cyw43-pio" +version = "0.1.0" +source = "git+https://github.com/embassy-rs/cyw43/?rev=46efce6ea2d4280d5e8e1eaece53269a94fb4847#46efce6ea2d4280d5e8e1eaece53269a94fb4847" +dependencies = [ + "cyw43", + "defmt", + "embassy-rp", + "pio", + "pio-proc", +] + [[package]] name = "darling" version = "0.13.4" @@ -332,6 +404,12 @@ dependencies = [ "defmt", ] +[[package]] +name = "diff" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" + [[package]] name = "digest" version = "0.10.6" @@ -343,6 +421,27 @@ dependencies = [ "subtle", ] +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + [[package]] name = "doc-comment" version = "0.3.3" @@ -358,10 +457,16 @@ dependencies = [ "signature 1.6.4", ] +[[package]] +name = "either" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" + [[package]] name = "embassy-cortex-m" version = "0.1.0" -source = "git+https://github.com/embassy-rs/embassy?rev=e1eac15c429f88b1176109d6ce42185e2774ac86#e1eac15c429f88b1176109d6ce42185e2774ac86" +source = "git+https://github.com/embassy-rs/embassy?rev=5a03b2e9e802626127038cff5634795f576f1c69#5a03b2e9e802626127038cff5634795f576f1c69" dependencies = [ "atomic-polyfill 1.0.1", "cfg-if", @@ -376,11 +481,11 @@ dependencies = [ [[package]] name = "embassy-embedded-hal" version = "0.1.0" -source = "git+https://github.com/embassy-rs/embassy?rev=e1eac15c429f88b1176109d6ce42185e2774ac86#e1eac15c429f88b1176109d6ce42185e2774ac86" +source = "git+https://github.com/embassy-rs/embassy?rev=5a03b2e9e802626127038cff5634795f576f1c69#5a03b2e9e802626127038cff5634795f576f1c69" dependencies = [ "embassy-sync", "embedded-hal 0.2.7", - "embedded-hal 1.0.0-alpha.9", + "embedded-hal 1.0.0-alpha.10", "embedded-hal-async", "embedded-storage", "embedded-storage-async", @@ -390,10 +495,10 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy?rev=e1eac15c429f88b1176109d6ce42185e2774ac86#e1eac15c429f88b1176109d6ce42185e2774ac86" +source = "git+https://github.com/embassy-rs/embassy?rev=5a03b2e9e802626127038cff5634795f576f1c69#5a03b2e9e802626127038cff5634795f576f1c69" dependencies = [ "atomic-polyfill 1.0.1", - "cfg-if", + "cortex-m", "critical-section 1.1.1", "defmt", "embassy-macros", @@ -405,12 +510,12 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.0" -source = "git+https://github.com/embassy-rs/embassy?rev=e1eac15c429f88b1176109d6ce42185e2774ac86#e1eac15c429f88b1176109d6ce42185e2774ac86" +source = "git+https://github.com/embassy-rs/embassy?rev=5a03b2e9e802626127038cff5634795f576f1c69#5a03b2e9e802626127038cff5634795f576f1c69" [[package]] name = "embassy-hal-common" version = "0.1.0" -source = "git+https://github.com/embassy-rs/embassy?rev=e1eac15c429f88b1176109d6ce42185e2774ac86#e1eac15c429f88b1176109d6ce42185e2774ac86" +source = "git+https://github.com/embassy-rs/embassy?rev=5a03b2e9e802626127038cff5634795f576f1c69#5a03b2e9e802626127038cff5634795f576f1c69" dependencies = [ "defmt", "num-traits", @@ -419,7 +524,7 @@ dependencies = [ [[package]] name = "embassy-macros" version = "0.1.0" -source = "git+https://github.com/embassy-rs/embassy?rev=e1eac15c429f88b1176109d6ce42185e2774ac86#e1eac15c429f88b1176109d6ce42185e2774ac86" +source = "git+https://github.com/embassy-rs/embassy?rev=5a03b2e9e802626127038cff5634795f576f1c69#5a03b2e9e802626127038cff5634795f576f1c69" dependencies = [ "darling", "proc-macro2", @@ -430,7 +535,7 @@ dependencies = [ [[package]] name = "embassy-net" version = "0.1.0" -source = "git+https://github.com/embassy-rs/embassy?rev=e1eac15c429f88b1176109d6ce42185e2774ac86#e1eac15c429f88b1176109d6ce42185e2774ac86" +source = "git+https://github.com/embassy-rs/embassy?rev=5a03b2e9e802626127038cff5634795f576f1c69#5a03b2e9e802626127038cff5634795f576f1c69" dependencies = [ "as-slice 0.2.1", "atomic-polyfill 1.0.1", @@ -453,7 +558,7 @@ dependencies = [ [[package]] name = "embassy-net-driver" version = "0.1.0" -source = "git+https://github.com/embassy-rs/embassy?rev=e1eac15c429f88b1176109d6ce42185e2774ac86#e1eac15c429f88b1176109d6ce42185e2774ac86" +source = "git+https://github.com/embassy-rs/embassy?rev=5a03b2e9e802626127038cff5634795f576f1c69#5a03b2e9e802626127038cff5634795f576f1c69" dependencies = [ "defmt", ] @@ -461,7 +566,7 @@ dependencies = [ [[package]] name = "embassy-net-driver-channel" version = "0.1.0" -source = "git+https://github.com/embassy-rs/embassy?rev=e1eac15c429f88b1176109d6ce42185e2774ac86#e1eac15c429f88b1176109d6ce42185e2774ac86" +source = "git+https://github.com/embassy-rs/embassy?rev=5a03b2e9e802626127038cff5634795f576f1c69#5a03b2e9e802626127038cff5634795f576f1c69" dependencies = [ "embassy-futures", "embassy-net-driver", @@ -471,7 +576,7 @@ dependencies = [ [[package]] name = "embassy-rp" version = "0.1.0" -source = "git+https://github.com/embassy-rs/embassy?rev=e1eac15c429f88b1176109d6ce42185e2774ac86#e1eac15c429f88b1176109d6ce42185e2774ac86" +source = "git+https://github.com/embassy-rs/embassy?rev=5a03b2e9e802626127038cff5634795f576f1c69#5a03b2e9e802626127038cff5634795f576f1c69" dependencies = [ "atomic-polyfill 1.0.1", "cfg-if", @@ -488,7 +593,7 @@ dependencies = [ "embassy-time", "embassy-usb-driver", "embedded-hal 0.2.7", - "embedded-hal 1.0.0-alpha.9", + "embedded-hal 1.0.0-alpha.10", "embedded-hal-async", "embedded-hal-nb", "embedded-io", @@ -496,6 +601,8 @@ dependencies = [ "futures", "nb 1.0.0", "paste", + "pio", + "pio-proc", "rand_core", "rp2040-pac2", ] @@ -503,7 +610,7 @@ dependencies = [ [[package]] name = "embassy-sync" version = "0.1.0" -source = "git+https://github.com/embassy-rs/embassy?rev=e1eac15c429f88b1176109d6ce42185e2774ac86#e1eac15c429f88b1176109d6ce42185e2774ac86" +source = "git+https://github.com/embassy-rs/embassy?rev=5a03b2e9e802626127038cff5634795f576f1c69#5a03b2e9e802626127038cff5634795f576f1c69" dependencies = [ "cfg-if", "critical-section 1.1.1", @@ -515,7 +622,7 @@ dependencies = [ [[package]] name = "embassy-time" version = "0.1.0" -source = "git+https://github.com/embassy-rs/embassy?rev=e1eac15c429f88b1176109d6ce42185e2774ac86#e1eac15c429f88b1176109d6ce42185e2774ac86" +source = "git+https://github.com/embassy-rs/embassy?rev=5a03b2e9e802626127038cff5634795f576f1c69#5a03b2e9e802626127038cff5634795f576f1c69" dependencies = [ "atomic-polyfill 1.0.1", "cfg-if", @@ -530,7 +637,7 @@ dependencies = [ [[package]] name = "embassy-usb-driver" version = "0.1.0" -source = "git+https://github.com/embassy-rs/embassy?rev=e1eac15c429f88b1176109d6ce42185e2774ac86#e1eac15c429f88b1176109d6ce42185e2774ac86" +source = "git+https://github.com/embassy-rs/embassy?rev=5a03b2e9e802626127038cff5634795f576f1c69#5a03b2e9e802626127038cff5634795f576f1c69" dependencies = [ "defmt", ] @@ -547,26 +654,26 @@ dependencies = [ [[package]] name = "embedded-hal" -version = "1.0.0-alpha.9" +version = "1.0.0-alpha.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "129b101ddfee640565f7c07b301a31d95aa21e5acef21a491c307139f5fa4c91" +checksum = "f65c4d073f5d91c66e629b216818a4c9747eeda0debedf2deda9a0a947e4e93b" [[package]] name = "embedded-hal-async" -version = "0.2.0-alpha.0" +version = "0.2.0-alpha.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608a322808d65da06715e03109c0cb69f79a5459af756fba393ab83e875d4969" +checksum = "8042370aa7af48de36d5312cda14c18ed8ca6b7ce64f5a07832fedc9dc83063f" dependencies = [ - "embedded-hal 1.0.0-alpha.9", + "embedded-hal 1.0.0-alpha.10", ] [[package]] name = "embedded-hal-nb" -version = "1.0.0-alpha.1" +version = "1.0.0-alpha.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e0760ec0a3bf76859d5e33f39542af103f157d5b2ecfb00ace56dd461472e3a" +checksum = "1465fffd56a95bbc105c17965bca1c1d5815027b1cc6bb183bc05d04563d065c" dependencies = [ - "embedded-hal 1.0.0-alpha.9", + "embedded-hal 1.0.0-alpha.10", "nb 1.0.0", ] @@ -610,13 +717,49 @@ checksum = "156d7a2fdd98ebbf9ae579cbceca3058cff946e13f8e17b90e3511db0508c723" [[package]] name = "embedded-storage-async" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ff04af74e47e9bb4315bd7aa2b01f3d1b05f33c03a6c4e9c3b20e9ce9cd8d79" +checksum = "052997a894670d0cde873faa7405bc98e2fd29f569d2acd568561bc1c396b35a" dependencies = [ "embedded-storage", ] +[[package]] +name = "ena" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c533630cf40e9caa44bd91aadc88a75d75a4c3a12b4cfde353cbed41daa1e1f1" +dependencies = [ + "log", +] + +[[package]] +name = "errno" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + [[package]] name = "fnv" version = "1.0.7" @@ -744,6 +887,12 @@ dependencies = [ "byteorder", ] +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + [[package]] name = "heapless" version = "0.7.16" @@ -764,6 +913,12 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + [[package]] name = "hmac" version = "0.12.1" @@ -779,6 +934,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown", +] + [[package]] name = "inout" version = "0.1.3" @@ -788,12 +953,82 @@ dependencies = [ "generic-array 0.14.6", ] +[[package]] +name = "io-lifetimes" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "is-terminal" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" +dependencies = [ + "hermit-abi", + "io-lifetimes", + "rustix", + "windows-sys 0.48.0", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "lalrpop" +version = "0.19.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f34313ec00c2eb5c3c87ca6732ea02dcf3af99c3ff7a8fb622ffb99c9d860a87" +dependencies = [ + "ascii-canvas", + "bit-set", + "diff", + "ena", + "is-terminal", + "itertools", + "lalrpop-util", + "petgraph", + "pico-args", + "regex", + "regex-syntax", + "string_cache", + "term", + "tiny-keccak", + "unicode-xid", +] + +[[package]] +name = "lalrpop-util" +version = "0.19.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5c1f7869c94d214466c5fd432dfed12c379fd87786768d36455892d46b18edd" +dependencies = [ + "regex", +] + [[package]] name = "libc" version = "0.2.139" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" +[[package]] +name = "linux-raw-sys" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59d8c75012853d2e872fb56bc8a2e53718e2cafe1a4c823143141c6d90c322f" + [[package]] name = "lock_api" version = "0.4.9" @@ -819,6 +1054,12 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ca88d725a0a943b096803bd34e73a4437208b6077654cc4ecb2947a5f91618d" +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + [[package]] name = "menu" version = "0.3.2" @@ -840,6 +1081,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "546c37ac5d9e56f55e73b677106873d9d9f5190605e41a856503623648488cae" +[[package]] +name = "new_debug_unreachable" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" + [[package]] name = "no-panic" version = "0.1.20" @@ -892,6 +1139,12 @@ dependencies = [ "syn", ] +[[package]] +name = "once_cell" +version = "1.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" + [[package]] name = "opaque-debug" version = "0.3.0" @@ -908,12 +1161,60 @@ dependencies = [ "defmt", ] +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-sys 0.45.0", +] + [[package]] name = "paste" version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" +[[package]] +name = "petgraph" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "phf_shared" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pico-args" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db8bcd96cb740d03149cbad5518db9fd87126a10ab519c011893b1754134c468" + [[package]] name = "pin-project-lite" version = "0.2.9" @@ -926,6 +1227,44 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pio" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76e09694b50f89f302ed531c1f2a7569f0be5867aee4ab4f8f729bbeec0078e3" +dependencies = [ + "arrayvec", + "num_enum", + "paste", +] + +[[package]] +name = "pio-parser" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57e25a6443ddde6cf1122debd1ee58d002390934fa2a0415e660d6f6d7842b06" +dependencies = [ + "lalrpop", + "lalrpop-util", + "pio", +] + +[[package]] +name = "pio-proc" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1e7e61a9dc0a0f8fa54ab33a6ab52bf17f221b86f157c79f09a08cc2a8c7e4" +dependencies = [ + "codespan-reporting", + "lalrpop-util", + "pio", + "pio-parser", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "poly1305" version = "0.8.0" @@ -943,6 +1282,12 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + [[package]] name = "pretty-hex" version = "0.3.0" @@ -1019,6 +1364,43 @@ dependencies = [ "getrandom", ] +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom", + "redox_syscall", + "thiserror", +] + +[[package]] +name = "regex" +version = "1.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + [[package]] name = "rp2040-pac2" version = "0.1.0" @@ -1046,6 +1428,26 @@ dependencies = [ "semver 1.0.16", ] +[[package]] +name = "rustix" +version = "0.37.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b24138615de35e32031d041a09032ef3487a616d901ca4db224e7d557efae2" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys 0.45.0", +] + +[[package]] +name = "rustversion" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" + [[package]] name = "salty" version = "0.2.0" @@ -1106,6 +1508,18 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fe458c98333f9c8152221191a77e2a44e8325d0193484af2e9421a53019e57d" +[[package]] +name = "siphasher" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" + +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + [[package]] name = "smoltcp" version = "0.9.1" @@ -1166,6 +1580,19 @@ dependencies = [ "atomic-polyfill 1.0.1", ] +[[package]] +name = "string_cache" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" +dependencies = [ + "new_debug_unreachable", + "once_cell", + "parking_lot", + "phf_shared", + "precomputed-hash", +] + [[package]] name = "strsim" version = "0.10.0" @@ -1189,6 +1616,7 @@ dependencies = [ "ctr", "digest", "embedded-io", + "futures", "getrandom", "heapless", "hmac", @@ -1196,6 +1624,7 @@ dependencies = [ "no-panic", "poly1305", "pretty-hex", + "rand_core", "salty", "sha2", "signature 2.0.0", @@ -1215,6 +1644,7 @@ dependencies = [ "cortex-m-rt", "critical-section 1.1.1", "cyw43", + "cyw43-pio", "defmt", "defmt-rtt", "embassy-executor", @@ -1224,7 +1654,7 @@ dependencies = [ "embassy-rp", "embassy-sync", "embassy-time", - "embedded-hal 1.0.0-alpha.9", + "embedded-hal 1.0.0-alpha.10", "embedded-hal-async", "embedded-io", "getrandom", @@ -1282,6 +1712,55 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "term" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +dependencies = [ + "dirs-next", + "rustversion", + "winapi", +] + +[[package]] +name = "termcolor" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "thiserror" +version = "1.0.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5ab016db510546d856297882807df8da66a16fb8c4101cb8b30054b0d5b2d9c" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5420d42e90af0c38c3290abcca25b9b3bdf379fc9f55c528f53a269d9c9a267e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + [[package]] name = "typenum" version = "1.16.0" @@ -1294,6 +1773,12 @@ version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + [[package]] name = "unicode-xid" version = "0.2.4" @@ -1349,6 +1834,169 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.0", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + [[package]] name = "zeroize" version = "1.5.7" diff --git a/embassy/demos/picow/Cargo.toml b/embassy/demos/picow/Cargo.toml index 52047b7823798eb2894f13938581c89060d67f2f..6e6dbf3b7cd11b001b1c34d9d0e02e4dcab17b16 100644 --- a/embassy/demos/picow/Cargo.toml +++ b/embassy/demos/picow/Cargo.toml @@ -7,11 +7,12 @@ edition = "2021" # blank [dependencies] -cyw43 = { git = "https://github.com/embassy-rs/cyw43/", features = ["defmt"]} +cyw43 = { git = "https://github.com/embassy-rs/cyw43/", rev = "46efce6ea2d4280d5e8e1eaece53269a94fb4847", features = ["defmt"]} +cyw43-pio = { git = "https://github.com/embassy-rs/cyw43/", rev = "46efce6ea2d4280d5e8e1eaece53269a94fb4847" } # cyw43 = { path = "/home/matt/3rd/rs/cyw43", features = ["defmt"]} -embassy-executor = { version = "0.1.0", features = ["defmt", "integrated-timers"] } +embassy-executor = { version = "0.1.0", features = ["defmt", "integrated-timers", "executor-thread", "arch-cortex-m"] } embassy-time = { version = "0.1.0", features = ["defmt", "defmt-timestamp-uptime"] } -embassy-rp = { version = "0.1.0", features = ["defmt", "unstable-traits", "nightly", "unstable-pac"] } +embassy-rp = { version = "0.1.0", features = ["defmt", "unstable-traits", "nightly", "unstable-pac", "pio"] } # embassy-net/nightly is required for asynch::Read/Write on TcpReader/TcpWriter embassy-net = { version = "0.1.0", features = ["tcp", "dhcpv4", "medium-ethernet", "nightly", "defmt"] } embassy-net-driver = { version = "0.1.0" } @@ -27,8 +28,8 @@ panic-probe = { version = "0.3", features = ["print-defmt"] } cortex-m = { version = "0.7.6", features = ["critical-section-single-core"]} cortex-m-rt = "0.7.0" -embedded-hal-1 = { package = "embedded-hal", version = "1.0.0-alpha.8" } -embedded-hal-async = { version = "0.2.0-alpha.0" } +embedded-hal-1 = { package = "embedded-hal", version = "1.0.0-alpha.10" } +embedded-hal-async = { version = "0.2.0-alpha.1" } embedded-io = { version = "0.4", features = ["async", "defmt"] } heapless = "0.7.15" @@ -55,15 +56,15 @@ defmt = [] romfw = [] [patch.crates-io] -embassy-executor = { git = "https://github.com/embassy-rs/embassy", rev = "e1eac15c429f88b1176109d6ce42185e2774ac86" } -embassy-time = { git = "https://github.com/embassy-rs/embassy", rev = "e1eac15c429f88b1176109d6ce42185e2774ac86" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy", rev = "e1eac15c429f88b1176109d6ce42185e2774ac86" } -embassy-sync = { git = "https://github.com/embassy-rs/embassy", rev = "e1eac15c429f88b1176109d6ce42185e2774ac86" } -embassy-rp = { git = "https://github.com/embassy-rs/embassy", rev = "e1eac15c429f88b1176109d6ce42185e2774ac86" } -embassy-net = { git = "https://github.com/embassy-rs/embassy", rev = "e1eac15c429f88b1176109d6ce42185e2774ac86" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy", rev = "5a03b2e9e802626127038cff5634795f576f1c69" } +embassy-time = { git = "https://github.com/embassy-rs/embassy", rev = "5a03b2e9e802626127038cff5634795f576f1c69" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy", rev = "5a03b2e9e802626127038cff5634795f576f1c69" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy", rev = "5a03b2e9e802626127038cff5634795f576f1c69" } +embassy-rp = { git = "https://github.com/embassy-rs/embassy", rev = "5a03b2e9e802626127038cff5634795f576f1c69" } +embassy-net = { git = "https://github.com/embassy-rs/embassy", rev = "5a03b2e9e802626127038cff5634795f576f1c69" } # for cyw43 -embassy-net-driver-channel = { git = "https://github.com/embassy-rs/embassy", rev = "e1eac15c429f88b1176109d6ce42185e2774ac86" } -embassy-net-driver = { git = "https://github.com/embassy-rs/embassy", rev = "e1eac15c429f88b1176109d6ce42185e2774ac86" } +embassy-net-driver-channel = { git = "https://github.com/embassy-rs/embassy", rev = "5a03b2e9e802626127038cff5634795f576f1c69" } +embassy-net-driver = { git = "https://github.com/embassy-rs/embassy", rev = "5a03b2e9e802626127038cff5634795f576f1c69" } [profile.dev] debug = 2 diff --git a/embassy/demos/picow/rust-toolchain.toml b/embassy/demos/picow/rust-toolchain.toml index 549c09309e4ec5378a36667cd306ebf243a6ecc3..5f813cc7a05c100742c6799b30c74bf6fea9cae3 100644 --- a/embassy/demos/picow/rust-toolchain.toml +++ b/embassy/demos/picow/rust-toolchain.toml @@ -1,7 +1,9 @@ # Before upgrading check that everything is available on all tier1 targets here: # https://rust-lang.github.io/rustup-components-history + +# 2023-04-15 has ICE building picow demo [toolchain] -channel = "nightly-2023-04-07" +channel = "nightly-2023-04-08" components = [ "rust-src", "rustfmt" ] targets = [ "thumbv6m-none-eabi", diff --git a/embassy/demos/picow/src/main.rs b/embassy/demos/picow/src/main.rs index 39eb0e24a4c998a700be893d1bff662718598c78..acb0b3926ab573ce5cee7753266518acedd40f6f 100644 --- a/embassy/demos/picow/src/main.rs +++ b/embassy/demos/picow/src/main.rs @@ -3,11 +3,12 @@ #![feature(type_alias_impl_trait)] #![feature(async_fn_in_trait)] #![allow(incomplete_features)] +//#![feature(impl_trait_in_assoc_type)] use defmt::*; use embassy_executor::Spawner; use embassy_net::Stack; -use embassy_rp::gpio::{Flex, Level, Output}; +use embassy_rp::pio::PioPeripheral; use {defmt_rtt as _, panic_probe as _}; use static_cell::StaticCell; @@ -45,13 +46,9 @@ async fn main(spawner: Spawner) { caprand::setup(&mut p.PIN_10).unwrap(); getrandom::register_custom_getrandom!(caprand::getrandom); - let pwr = Output::new(p.PIN_23, Level::Low); - let cs = Output::new(p.PIN_25, Level::High); - let clk = Output::new(p.PIN_29, Level::Low); - let dio = Flex::new(p.PIN_24); - + let (_, sm, _, _, _) = p.PIO0.split(); // spawn the wifi stack - let stack = wifi::wifi_stack(&spawner, pwr, cs, clk, dio).await; + let stack = wifi::wifi_stack(&spawner, p.PIN_23, p.PIN_24, p.PIN_25, p.PIN_29, p.DMA_CH0, sm).await; let stack = &*singleton!(stack); unwrap!(spawner.spawn(net_task(&stack))); diff --git a/embassy/demos/picow/src/wifi.rs b/embassy/demos/picow/src/wifi.rs index fac465c2a180dcfc0bee2c50e4958ffe57b74162..bc7246d341da7bc14068b826230298d204b5bf83 100644 --- a/embassy/demos/picow/src/wifi.rs +++ b/embassy/demos/picow/src/wifi.rs @@ -2,14 +2,13 @@ // Copyright (c) 2019-2022 Embassy project contributors // MIT or Apache-2.0 license -use core::convert::Infallible; - -use embassy_rp::gpio::{Flex, Output}; -use embassy_rp::peripherals::{PIN_23, PIN_24, PIN_25, PIN_29}; +use embassy_rp::gpio::{Level, Output}; +use embassy_rp::pio::{PioStateMachineInstance, Sm0, Pio0}; +use embassy_rp::peripherals::*; use embassy_executor::Spawner; use embassy_net::{Stack, StackResources}; -use embedded_hal_1::spi::ErrorType; -use embedded_hal_async::spi::{ExclusiveDevice, SpiBusFlush, SpiBusRead, SpiBusWrite}; + +use cyw43_pio::PioSpi; use static_cell::StaticCell; @@ -19,121 +18,36 @@ use rand::RngCore; use crate::singleton; #[embassy_executor::task] -pub(crate) async fn wifi_task( - runner: cyw43::Runner<'static, Output<'static, PIN_23>, ExclusiveDevice<MySpi, Output<'static, PIN_25>>>, +async fn wifi_task( + runner: cyw43::Runner< + 'static, + Output<'static, PIN_23>, + PioSpi<PIN_25, PioStateMachineInstance<Pio0, Sm0>, DMA_CH0>, + >, ) -> ! { runner.run().await } -pub(crate) struct MySpi { - /// SPI clock - pub clk: Output<'static, PIN_29>, - - /// 4 signals, all in one!! - /// - SPI MISO - /// - SPI MOSI - /// - IRQ - /// - strap to set to gSPI mode on boot. - pub dio: Flex<'static, PIN_24>, -} - -impl ErrorType for MySpi { - type Error = Infallible; -} - -impl SpiBusFlush for MySpi { - async fn flush(&mut self) -> Result<(), Self::Error> { - Ok(()) - } -} +// It would be nice to make Pio0, Sm0, DMA_CH0 generic, but wifi_task can't have generics. +pub(crate) async fn wifi_stack(spawner: &Spawner, + p23: PIN_23, p24: PIN_24, p25: PIN_25, p29: PIN_29, dma: DMA_CH0, + sm: PioStateMachineInstance<Pio0, Sm0>, + ) -> embassy_net::Stack<cyw43::NetDriver<'static>> + { -impl SpiBusRead<u32> for MySpi { - async fn read(&mut self, words: &mut [u32]) -> Result<(), Self::Error> { - self.dio.set_as_input(); - for word in words { - let mut w = 0; - for _ in 0..32 { - w = w << 1; - - // rising edge, sample data - if self.dio.is_high() { - w |= 0x01; - } - self.clk.set_high(); - - // falling edge - self.clk.set_low(); - } - *word = w - } - - Ok(()) - } -} - -impl SpiBusWrite<u32> for MySpi { - async fn write(&mut self, words: &[u32]) -> Result<(), Self::Error> { - self.dio.set_as_output(); - for word in words { - let mut word = *word; - for _ in 0..32 { - // falling edge, setup data - self.clk.set_low(); - if word & 0x8000_0000 == 0 { - self.dio.set_low(); - } else { - self.dio.set_high(); - } - - // rising edge - self.clk.set_high(); - - word = word << 1; - } - } - self.clk.set_low(); - - self.dio.set_as_input(); - Ok(()) - } -} + let (fw, clm) = get_fw(); -pub(crate) async fn wifi_stack(spawner: &Spawner, pwr: Output<'static, PIN_23>, cs: Output<'static, PIN_25>, - clk: Output<'static, PIN_29>, mut dio: Flex<'static, PIN_24>) - -> embassy_net::Stack<cyw43::NetDriver<'static>> { - - dio.set_low(); - dio.set_as_output(); - - let bus = MySpi { clk, dio }; - let spi = ExclusiveDevice::new(bus, cs); - - // Include the WiFi firmware and Country Locale Matrix (CLM) blobs. - #[cfg(not(feature = "romfw"))] - let (fw, clm) = ( - include_bytes!("../firmware/43439A0.bin"), - include_bytes!("../firmware/43439A0_clm.bin"), - ); - - // To make flashing faster for development, you may want to flash the firmwares independently - // at hardcoded addresses, instead of baking them into the program with `include_bytes!`: - // probe-rs-cli download 43439A0.bin --format bin --chip RP2040 --base-address 0x10100000 - // probe-rs-cli download 43439A0_clm.bin --format bin --chip RP2040 --base-address 0x10140000 - #[cfg(feature = "romfw")] - let (fw, clm) = ( - unsafe { core::slice::from_raw_parts(0x10100000 as *const u8, 224190) }, - unsafe { core::slice::from_raw_parts(0x10140000 as *const u8, 4752) }, - ); + let pwr = Output::new(p23, Level::Low); + let cs = Output::new(p25, Level::High); + let spi = PioSpi::new(sm, cs, p24, p29, dma); let state = singleton!(cyw43::State::new()); let (net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await; - spawner.spawn(wifi_task(runner)).unwrap(); control.init(clm).await; // control.set_power_management(cyw43::PowerManagementMode::PowerSave).await; - let net = option_env!("WIFI_NETWORK").unwrap_or("guest"); let pw = option_env!("WIFI_PASSWORD"); if let Some(pw) = pw { @@ -143,21 +57,35 @@ pub(crate) async fn wifi_stack(spawner: &Spawner, pwr: Output<'static, PIN_23>, } let config = embassy_net::Config::Dhcp(Default::default()); - //let config = embassy_net::ConfigStrategy::Static(embassy_net::Config { - // address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 2), 24), - // dns_servers: Vec::new(), - // gateway: Some(Ipv4Address::new(192, 168, 69, 1)), - //}); let seed = OsRng.next_u64(); // Init network stack - let stack = Stack::new( + Stack::new( net_device, config, singleton!(StackResources::<{crate::NUM_SOCKETS}>::new()), seed - ); + ) +} + +fn get_fw() -> (&'static [u8], &'static [u8]) { + // Include the WiFi firmware and Country Locale Matrix (CLM) blobs. + #[cfg(not(feature = "romfw"))] + let (fw, clm) = ( + include_bytes!("../firmware/43439A0.bin"), + include_bytes!("../firmware/43439A0_clm.bin"), + ); + + // To make flashing faster for development, you may want to flash the firmwares independently + // at hardcoded addresses, instead of baking them into the program with `include_bytes!`: + // probe-rs-cli download 43439A0.bin --format bin --chip RP2040 --base-address 0x10100000 + // probe-rs-cli download 43439A0_clm.bin --format bin --chip RP2040 --base-address 0x10140000 + #[cfg(feature = "romfw")] + let (fw, clm) = ( + unsafe { core::slice::from_raw_parts(0x10100000 as *const u8, 224190) }, + unsafe { core::slice::from_raw_parts(0x10140000 as *const u8, 4752) }, + ); - stack + (fw, clm) } diff --git a/embassy/demos/std/Cargo.lock b/embassy/demos/std/Cargo.lock index 5a0749bf724c85523f518784dd6f53a3342902ae..48d2cafc3699c5967383b3630ac9b4f46f77a84b 100644 --- a/embassy/demos/std/Cargo.lock +++ b/embassy/demos/std/Cargo.lock @@ -269,35 +269,6 @@ dependencies = [ "syn", ] -[[package]] -name = "defmt" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3a0ae7494d9bff013d7b89471f4c424356a71e9752e0c78abe7e6c608a16bb3" -dependencies = [ - "bitflags", - "defmt-macros", -] - -[[package]] -name = "defmt-macros" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8500cbe4cca056412efce4215a63d0bc20492942aeee695f23b624a53e0a6854" -dependencies = [ - "defmt-parser", - "proc-macro-error", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "defmt-parser" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0db23d29972d99baa3de2ee2ae3f104c10564a6d05a346eb3f4c4f2c0525a06e" - [[package]] name = "digest" version = "0.10.6" @@ -326,8 +297,9 @@ dependencies = [ [[package]] name = "embassy-executor" -version = "0.1.1" -source = "git+https://github.com/embassy-rs/embassy?rev=e1eac15c429f88b1176109d6ce42185e2774ac86#e1eac15c429f88b1176109d6ce42185e2774ac86" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "294010b830993602cebbc1ec6e75b8bbe5eeb257c508c23a784435ef05bafb63" dependencies = [ "atomic-polyfill 1.0.1", "cfg-if", @@ -342,12 +314,12 @@ dependencies = [ [[package]] name = "embassy-futures" version = "0.1.0" -source = "git+https://github.com/embassy-rs/embassy?rev=e1eac15c429f88b1176109d6ce42185e2774ac86#e1eac15c429f88b1176109d6ce42185e2774ac86" +source = "git+https://github.com/embassy-rs/embassy?rev=5a03b2e9e802626127038cff5634795f576f1c69#5a03b2e9e802626127038cff5634795f576f1c69" [[package]] name = "embassy-hal-common" version = "0.1.0" -source = "git+https://github.com/embassy-rs/embassy?rev=e1eac15c429f88b1176109d6ce42185e2774ac86#e1eac15c429f88b1176109d6ce42185e2774ac86" +source = "git+https://github.com/embassy-rs/embassy?rev=5a03b2e9e802626127038cff5634795f576f1c69#5a03b2e9e802626127038cff5634795f576f1c69" dependencies = [ "num-traits", ] @@ -355,7 +327,8 @@ dependencies = [ [[package]] name = "embassy-macros" version = "0.1.0" -source = "git+https://github.com/embassy-rs/embassy?rev=e1eac15c429f88b1176109d6ce42185e2774ac86#e1eac15c429f88b1176109d6ce42185e2774ac86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8f57fb96af50e126bb4ae0826604ac5b9f9ac1d32fb3576d552f7285bf68e67" dependencies = [ "darling", "proc-macro2", @@ -366,7 +339,7 @@ dependencies = [ [[package]] name = "embassy-net" version = "0.1.0" -source = "git+https://github.com/embassy-rs/embassy?rev=e1eac15c429f88b1176109d6ce42185e2774ac86#e1eac15c429f88b1176109d6ce42185e2774ac86" +source = "git+https://github.com/embassy-rs/embassy?rev=5a03b2e9e802626127038cff5634795f576f1c69#5a03b2e9e802626127038cff5634795f576f1c69" dependencies = [ "as-slice 0.2.1", "atomic-polyfill 1.0.1", @@ -389,12 +362,12 @@ dependencies = [ [[package]] name = "embassy-net-driver" version = "0.1.0" -source = "git+https://github.com/embassy-rs/embassy?rev=e1eac15c429f88b1176109d6ce42185e2774ac86#e1eac15c429f88b1176109d6ce42185e2774ac86" +source = "git+https://github.com/embassy-rs/embassy?rev=5a03b2e9e802626127038cff5634795f576f1c69#5a03b2e9e802626127038cff5634795f576f1c69" [[package]] name = "embassy-sync" version = "0.1.0" -source = "git+https://github.com/embassy-rs/embassy?rev=e1eac15c429f88b1176109d6ce42185e2774ac86#e1eac15c429f88b1176109d6ce42185e2774ac86" +source = "git+https://github.com/embassy-rs/embassy?rev=5a03b2e9e802626127038cff5634795f576f1c69#5a03b2e9e802626127038cff5634795f576f1c69" dependencies = [ "cfg-if", "critical-section", @@ -406,7 +379,7 @@ dependencies = [ [[package]] name = "embassy-time" version = "0.1.0" -source = "git+https://github.com/embassy-rs/embassy?rev=e1eac15c429f88b1176109d6ce42185e2774ac86#e1eac15c429f88b1176109d6ce42185e2774ac86" +source = "git+https://github.com/embassy-rs/embassy?rev=5a03b2e9e802626127038cff5634795f576f1c69#5a03b2e9e802626127038cff5634795f576f1c69" dependencies = [ "atomic-polyfill 1.0.1", "cfg-if", @@ -448,9 +421,6 @@ name = "embedded-io" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" -dependencies = [ - "defmt", -] [[package]] name = "embedded-nal" @@ -857,30 +827,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6fa0831dd7cc608c38a5e323422a0077678fa5744aa2be4ad91c4ece8eec8d5" -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - [[package]] name = "proc-macro2" version = "1.0.51" @@ -1089,6 +1035,7 @@ dependencies = [ "ctr", "digest", "embedded-io", + "futures", "getrandom", "heapless", "hmac", @@ -1096,6 +1043,7 @@ dependencies = [ "no-panic", "poly1305", "pretty-hex", + "rand_core", "salty", "sha2", "signature 2.0.0", @@ -1360,3 +1308,8 @@ dependencies = [ "syn", "synstructure", ] + +[[patch.unused]] +name = "embassy-executor" +version = "0.1.1" +source = "git+https://github.com/embassy-rs/embassy?rev=5a03b2e9e802626127038cff5634795f576f1c69#5a03b2e9e802626127038cff5634795f576f1c69" diff --git a/embassy/demos/std/Cargo.toml b/embassy/demos/std/Cargo.toml index 62b2d183954f0fd45d372d7aa31833976d2d8922..ef3dd5e4a369accc00f852939b2a5ed0a6abb3c1 100644 --- a/embassy/demos/std/Cargo.toml +++ b/embassy/demos/std/Cargo.toml @@ -22,7 +22,7 @@ env_logger = "0.9.0" embedded-hal-1 = { package = "embedded-hal", version = "1.0.0-alpha.8" } embedded-hal-async = { version = "0.1.0-alpha.2" } -embedded-io = { version = "0.4", features = ["async", "defmt"] } +embedded-io = { version = "0.4", features = ["async"] } heapless = "0.7.15" # for tuntap @@ -39,13 +39,13 @@ rand = { version = "0.8", default-features = false, features = ["getrandom"] } sha2 = { version = "0.10", default-features = false } [patch.crates-io] -embassy-executor = { git = "https://github.com/embassy-rs/embassy", rev = "e1eac15c429f88b1176109d6ce42185e2774ac86" } -embassy-time = { git = "https://github.com/embassy-rs/embassy", rev = "e1eac15c429f88b1176109d6ce42185e2774ac86" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy", rev = "e1eac15c429f88b1176109d6ce42185e2774ac86" } -embassy-sync = { git = "https://github.com/embassy-rs/embassy", rev = "e1eac15c429f88b1176109d6ce42185e2774ac86" } -embassy-net = { git = "https://github.com/embassy-rs/embassy", rev = "e1eac15c429f88b1176109d6ce42185e2774ac86" } +embassy-executor = { git = "https://github.com/embassy-rs/embassy", rev = "5a03b2e9e802626127038cff5634795f576f1c69" } +embassy-time = { git = "https://github.com/embassy-rs/embassy", rev = "5a03b2e9e802626127038cff5634795f576f1c69" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy", rev = "5a03b2e9e802626127038cff5634795f576f1c69" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy", rev = "5a03b2e9e802626127038cff5634795f576f1c69" } +embassy-net = { git = "https://github.com/embassy-rs/embassy", rev = "5a03b2e9e802626127038cff5634795f576f1c69" } # for tuntap -embassy-net-driver = { git = "https://github.com/embassy-rs/embassy", rev = "e1eac15c429f88b1176109d6ce42185e2774ac86" } +embassy-net-driver = { git = "https://github.com/embassy-rs/embassy", rev = "5a03b2e9e802626127038cff5634795f576f1c69" } [profile.dev] debug = 2 diff --git a/embassy/demos/std/rust-toolchain.toml b/embassy/demos/std/rust-toolchain.toml index 549c09309e4ec5378a36667cd306ebf243a6ecc3..5f813cc7a05c100742c6799b30c74bf6fea9cae3 100644 --- a/embassy/demos/std/rust-toolchain.toml +++ b/embassy/demos/std/rust-toolchain.toml @@ -1,7 +1,9 @@ # Before upgrading check that everything is available on all tier1 targets here: # https://rust-lang.github.io/rustup-components-history + +# 2023-04-15 has ICE building picow demo [toolchain] -channel = "nightly-2023-04-07" +channel = "nightly-2023-04-08" components = [ "rust-src", "rustfmt" ] targets = [ "thumbv6m-none-eabi", diff --git a/embassy/rust-toolchain.toml b/embassy/rust-toolchain.toml index 549c09309e4ec5378a36667cd306ebf243a6ecc3..5f813cc7a05c100742c6799b30c74bf6fea9cae3 100644 --- a/embassy/rust-toolchain.toml +++ b/embassy/rust-toolchain.toml @@ -1,7 +1,9 @@ # Before upgrading check that everything is available on all tier1 targets here: # https://rust-lang.github.io/rustup-components-history + +# 2023-04-15 has ICE building picow demo [toolchain] -channel = "nightly-2023-04-07" +channel = "nightly-2023-04-08" components = [ "rust-src", "rustfmt" ] targets = [ "thumbv6m-none-eabi", diff --git a/src/noasync.rs b/src/noasync.rs index 693fba15b3d974e2f514c05bd935523b94b311c1..ee087efad18958cb2263ead71053cd95bcee3000 100644 --- a/src/noasync.rs +++ b/src/noasync.rs @@ -9,6 +9,7 @@ use crate::*; use core::task::{Context, Poll}; use core::future::Future; +#[derive(Debug)] pub struct PendingAwait; /// Runs an async function that is not expected to `.await`. diff --git a/src/sshwire.rs b/src/sshwire.rs index ab57217fbf0ea4361d05dc2899373e65509166f4..aaaabe4547aa0639a537c2f9d9112c7de7fd5d70 100644 --- a/src/sshwire.rs +++ b/src/sshwire.rs @@ -586,6 +586,7 @@ impl DigestUpdate for sha2::Sha256 { } } +#[cfg(feature = "rsa")] fn top_bit_set(b: &[u8]) -> bool { b.first().unwrap_or(&0) & 0x80 != 0 }