Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Failed to connect to the device" on Adafruit QT PY ESP32-S2 #670

Closed
dylif opened this issue Aug 16, 2024 · 10 comments
Closed

"Failed to connect to the device" on Adafruit QT PY ESP32-S2 #670

dylif opened this issue Aug 16, 2024 · 10 comments

Comments

@dylif
Copy link

dylif commented Aug 16, 2024

Info:

  • OS: Arch Linux 6.10.5-arch1-1
  • Board: Adafruit QT PY ESP32-S2
  • Toolchains: esp-13.2.0_20230928, xtensa-esp32-elf-clang
  • ESP-IDF Version: 5.2.2

I've put the board into boot loader mode, and I can communicate with it using esptool:

Serial port /dev/ttyACM0
Connecting...
Detecting chip type... Unsupported detection protocol, switching and trying again...
Detecting chip type... ESP32-S2
Chip is ESP32-S2FNR2 (revision v0.0)
Features: WiFi, Embedded Flash 4MB, Embedded PSRAM 2MB, ADC and temperature sensor calibration in BLK2 of efuse V1
Crystal is 40MHz
MAC: 70:04:1d:f2:f6:d6
Uploading stub...
Running stub...
Stub running...
Manufacturer: 20
Device: 4016
Detected flash size: 4MB
Flash type set in eFuse: quad (4 data lines)
Staying in bootloader.

When I run espflash flash target/xtensa-esp32s2-espidf/debug/humid --monitor , I get the following error:

[2024-08-16T02:59:47Z INFO ] Serial port: '/dev/ttyACM0'
[2024-08-16T02:59:47Z INFO ] Connecting...
Error: espflash::connection_failed

  × Error while connecting to device
  ╰─▶ Failed to connect to the device
  help: Ensure that the device is connected and the reset and boot pins are not being held down

Please let me know if you need any further information.

@GamePad64
Copy link

I have the same issue on 3.1.0 and 3.1.1 on my custom-designed ESP32-S2 board. Works perfectly with espflash 2.x and esptool.py

@MabezDev
Copy link
Member

Does it work if you pass --no-stub?

@dylif
Copy link
Author

dylif commented Aug 16, 2024

Does it work if you pass --no-stub?

Unfortunately, this does not work.

I have the same issue on 3.1.0 and 3.1.1 on my custom-designed ESP32-S2 board. Works perfectly with espflash 2.x and esptool.py

I just tried using espflash 2.1.0 and it works! Not sure what changed between the versions. Leaving the ticket open as this seems like a bug.

@dylif dylif changed the title "Failed to connect to device" on Adafruit QT PY ESP32-S2 "Failed to connect to the device" on Adafruit QT PY ESP32-S2 Aug 16, 2024
@superkooks
Copy link

I'm having the same issue with an ESP32 on a custom board. I have bisected the issue and found 2f3d110 is the first bad commit.
Interestingly, strace says that espflash doesn't even read or write to the serial port. I can confirm that it doesn't write anything as the LEDs on my UART adapter don't flash.

@superkooks
Copy link

I believe my case is actually a separate issue, but I think setting the flags --before no-reset-no-sync -c esp32s2 might help in your case.

@FreeMasen
Copy link

FreeMasen commented Aug 26, 2024

I am having the same problem. Here are some additional details to hopefully point us all in the right direction

Successful Arduino Build->Upload
--chip esp32s2 \
    --port "/dev/cu.usbmodem01" \
    --baud 921600 \
    --before default_reset \
    --after no-reset \
    write_flash  \
    -z \
    --flash_mode keep \
    --flash_freq keep \
    --flash_size keep \
        0x1000 "<snip>/esp-test2.ino.bootloader.bin" \
        0x8000 "<snip>/esp-test2.ino.partitions.bin" \
        0xe000 "<snip>Arduino15/packages/esp32/hardware/esp32/3.0.4/tools/partitions/boot_app0.bin" \
        0x10000 "<snip>/esp-test2.ino.bin" \
        0x2d0000 "<snip>/Library/Arduino15/packages/esp32/hardware/esp32/3.0.4/variants/adafruit_qtpy_esp32s2/tinyuf2.bin"
esptool.py v4.6
successful trace logs from espflash 2.1.0
RUST_LOG=trace cargo run --release 
    Finished `release` profile [optimized] target(s) in 0.08s
     Running `espflash flash --monitor target/xtensa-esp32s2-espidf/release/esp-test`
[2024-08-26T22:58:39Z DEBUG] Flash(
        FlashArgs {
            connect_args: ConnectArgs {
                baud: None,
                port: None,
                no_stub: false,
            },
            flash_config_args: FlashConfigArgs {
                flash_freq: None,
                flash_mode: None,
                flash_size: None,
            },
            flash_args: FlashArgs {
                bootloader: None,
                erase_parts: None,
                erase_data_parts: None,
                format: None,
                monitor: true,
                monitor_baud: None,
                partition_table: None,
                ram: false,
            },
            image: "target/xtensa-esp32s2-espidf/release/esp-test",
        },
    )
[2024-08-26T22:58:39Z DEBUG] connecting to crates.io:443 at 54.230.202.35:443
[2024-08-26T22:58:39Z DEBUG] No cached session for DnsName("crates.io")
[2024-08-26T22:58:39Z DEBUG] Not resuming any session
[2024-08-26T22:58:39Z TRACE] Sending ClientHello Message {
        version: TLSv1_0,
        payload: Handshake {
            parsed: HandshakeMessagePayload {
                typ: ClientHello,
                payload: ClientHello(
                    ClientHelloPayload {
                        client_version: TLSv1_2,
                        random: 899eb091190d431e0c643cc0b1f7fea44f6cd79e98868018ec15136885723b84,
                        session_id: 4355aacac9e47dfc73fc4953423ba57f325dfbad1c37593b3935b59854974d60,
                        cipher_suites: [
                            TLS13_AES_256_GCM_SHA384,
                            TLS13_AES_128_GCM_SHA256,
                            TLS13_CHACHA20_POLY1305_SHA256,
                            TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
                            TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
                            TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,
                            TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
                            TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
                            TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
                            TLS_EMPTY_RENEGOTIATION_INFO_SCSV,
                        ],
                        compression_methods: [
                            Null,
                        ],
                        extensions: [
                            SupportedVersions(
                                [
                                    TLSv1_3,
                                    TLSv1_2,
                                ],
                            ),
                            KeyShare(
                                [
                                    KeyShareEntry {
                                        group: X25519,
                                        payload: 7ebdc0f0413c85bc3c12995a36541b16e65863ac40421b5fe44ddb3a7dad9324,
                                    },
                                ],
                            ),
                            SignatureAlgorithms(
                                [
                                    ECDSA_NISTP384_SHA384,
                                    ECDSA_NISTP256_SHA256,
                                    ED25519,
                                    RSA_PSS_SHA512,
                                    RSA_PSS_SHA384,
                                    RSA_PSS_SHA256,
                                    RSA_PKCS1_SHA512,
                                    RSA_PKCS1_SHA384,
                                    RSA_PKCS1_SHA256,
                                ],
                            ),
                            PresharedKeyModes(
                                [
                                    PSK_DHE_KE,
                                ],
                            ),
                            CertificateStatusRequest(
                                Ocsp(
                                    OcspCertificateStatusRequest {
                                        responder_ids: [],
                                        extensions: ,
                                    },
                                ),
                            ),
                            ExtendedMasterSecretRequest,
                            NamedGroups(
                                [
                                    X25519,
                                    secp256r1,
                                    secp384r1,
                                ],
                            ),
                            ServerName(
                                [
                                    ServerName {
                                        typ: HostName,
                                        payload: HostName(
                                            DnsName(
                                                "crates.io",
                                            ),
                                        ),
                                    },
                                ],
                            ),
                            EcPointFormats(
                                [
                                    Uncompressed,
                                ],
                            ),
                            SessionTicket(
                                Request,
                            ),
                        ],
                    },
                ),
            },
            encoded: 010000e30303899eb091190d431e0c643cc0b1f7fea44f6cd79e98868018ec15136885723b84204355aacac9e47dfc73fc4953423ba57f325dfbad1c37593b3935b59854974d600014130213011303c02cc02bcca9c030c02fcca800ff01000086002b00050403040303003300260024001d00207ebdc0f0413c85bc3c12995a36541b16e65863ac40421b5fe44ddb3a7dad9324000d00140012050304030807080608050804060105010401002d0002010100050005010000000000170000000a00080006001d001700180000000e000c0000096372617465732e696f000b0002010000230000,
        },
    }
[2024-08-26T22:58:39Z TRACE] We got ServerHello ServerHelloPayload {
        legacy_version: TLSv1_2,
        random: b945aa496636dd3699e144db8384dffc054769dc0bee333103448e057d53d998,
        session_id: 4355aacac9e47dfc73fc4953423ba57f325dfbad1c37593b3935b59854974d60,
        cipher_suite: TLS13_AES_128_GCM_SHA256,
        compression_method: Null,
        extensions: [
            SupportedVersions(
                TLSv1_3,
            ),
            KeyShare(
                KeyShareEntry {
                    group: X25519,
                    payload: d37ba4cf41624429702f1e3ce95aee3e0c137dc70c2743c583e6f624f790a55d,
                },
            ),
        ],
    }
[2024-08-26T22:58:39Z DEBUG] Using ciphersuite TLS13_AES_128_GCM_SHA256
[2024-08-26T22:58:39Z DEBUG] Not resuming
[2024-08-26T22:58:39Z TRACE] EarlyData rejected
[2024-08-26T22:58:39Z TRACE] Dropping CCS
[2024-08-26T22:58:39Z DEBUG] TLS1.3 encrypted extensions: [ServerNameAck]
[2024-08-26T22:58:39Z DEBUG] ALPN protocol is None
[2024-08-26T22:58:39Z TRACE] Server cert is CertificateChain([CertificateDer(0x308205ff308204e7a00302010202100412af120056170134892f8989d6d5ae300d06092a864886f70d01010b0500303c310b3009060355040613025553310f300d060355040a1306416d617a6f6e311c301a06035504031313416d617a6f6e205253412032303438204d3032301e170d3233313232363030303030305a170d3235303132333233353935395a301431123010060355040313096372617465732e696f30820122300d06092a864886f70d01010105000382010f003082010a0282010100cb685a2ceefcede31c39219ee2a7a103e026caeab200c16a2de177dd7c908de47e18abe9a60c8c9c805904777a689871c429fcb4679f2d47ce1cdd1f4215858d0a89969481d291a538cd4db1d28446153130e53cfe559d74fa2384b0d5e628b7b45c03373d21484a7d0b53def9dc53b3b430334408a0c5b1d22941baef7b35bf2916243d1005b9e1092473756012f66c4dc9a7d3f19d4d7cd421dc5f5b0b1d6ce4f73a9ebb172766fa681beb00677ca1075546215e47493b7a97c90dc298a8fa247b65e9cbb333be45f1661ecc77cdae7bb03d9ba95995b46baca7312e5457c743417f01c38293bc152025db2dcd79f06deaadbf5ecd2a5cc8743650f89ae1310203010001a38203233082031f301f0603551d23041830168014c03152cd5a50c3827c7471cecbe99cf97aeb82e2301d0603551d0e041604142f604fc71d49e5ef1d9a80befd9d3776d45ea0cb30540603551d11044d304b82096372617465732e696f821b636c6f756466726f6e742d7374617469632e6372617465732e696f820f696e6465782e6372617465732e696f82107374617469632e6372617465732e696f30130603551d20040c300a3008060667810c010201300e0603551d0f0101ff0404030205a0301d0603551d250416301406082b0601050507030106082b06010505070302303b0603551d1f043430323030a02ea02c862a687474703a2f2f63726c2e72326d30322e616d617a6f6e74727573742e636f6d2f72326d30322e63726c307506082b0601050507010104693067302d06082b060105050730018621687474703a2f2f6f6373702e72326d30322e616d617a6f6e74727573742e636f6d303606082b06010505073002862a687474703a2f2f6372742e72326d30322e616d617a6f6e74727573742e636f6d2f72326d30322e636572300c0603551d130101ff040230003082017f060a2b06010401d6790204020482016f0482016b01690076004e75a3275c9a10c3385b6cd4df3f52eb1df0e08e1b8d69c0b1fa64b1629a39df0000018ca4ec78a00000040300473045022100a4648e92ea738b6b0f6c6bc09ded16e1617e850fd86eee5061d17a6a493752cd02200a41b7afdde3c1914a17dbec7c066318860418bcf1944082024e254f5300fc9d0077007d591e12e1782a7b1c61677c5efdf8d0875c14a04e959eb9032fd90e8c2e79b80000018ca4ec78ca0000040300483046022100d7463d54e1e1fb9eb94a5c1e35f33239e15c983ccba2a259116034e6e56fffb9022100c817150c80a1df94cd2673aff3fc1212d45aff1fe92175d0e5527752eacd9d88007600e6d2316340778cc1104106d771b9cec1d240f6968486fbba87321dfd1e378e500000018ca4ec78f3000004030047304502205c25f8bb7e37a0006bee2c2c5e19c6b23ae5e4c7f48815fbd32160943755ac15022100c6881f90e102f19adbf2d2613a877d961a4103883a9534915365c129b1291892300d06092a864886f70d01010b0500038201010075a67251c261484ffeed0818068e9abdbb7b0161e9d08789ed278b9ea0c9687d1a1ac4d56f81bd63a337750983e8dadcc99d7c7e1754d7fb6868c0555023d48febc60657b65a1c234fc226901ad23a53738437c35ac1b67c2b0ba2b44cad9a98b5f80bad56cbe5d75c50858bc94ccbcee08c736f6cfc29facd431d8b975cf15e1ab27635fb541a77e8517a367ea8b60c4bee8dfd68d1216d8e8f9e99cedd353a53c37bdee0cc7b9cc925782cb88f262e886aa610bc9934777d902bd74bdbbbce370a21a5f620a7a15279d26bc655a6f48db825fd2ab5cd8cd8cf08c66ebe75db00ffa9f1f814a0850b98ee02482bc6b16fe5081b326e0aeb6d8df62e0e30e3d7), CertificateDer(0x3082045e30820346a00302010202130773124a4bcbd44ec7b53beaf194842d3a0fa1300d06092a864886f70d01010b05003039310b3009060355040613025553310f300d060355040a1306416d617a6f6e3119301706035504031310416d617a6f6e20526f6f742043412031301e170d3232303832333232323533305a170d3330303832333232323533305a303c310b3009060355040613025553310f300d060355040a1306416d617a6f6e311c301a06035504031313416d617a6f6e205253412032303438204d303230820122300d06092a864886f70d01010105000382010f003082010a0282010100bb4318c65aa879de29e8b56f2ebea543cf2e58d3075e374a2e95a4458f73a9929058596ffeaaae4672a079502db0d89c8d83ee10f4b1dcc4a9f9ee02322cb9740b1b703c4ef5fa577a053411557bc3652c91ef06c78a63cf2c68bc2e7f191957093be20e275a534c5f395af58e45df0c111f03151f8e37c46cfa52d192652a90f78785c795fb4e5aadf30862f2a09a29d679acd6a4fabf6751384e78296a15de285f2721fff45ced8d1e5f528d587612235364df59988222b726f1f4eb783e2bdb4703add979380a82776587e588fb3bfb8b8e077a94598c0d45630619f55bfff54902e58cfcff253ae5f823684fb05473387bf6320b6a2cacf584ee027e75730203010001a382015a3082015630120603551d130101ff040830060101ff020100300e0603551d0f0101ff040403020186301d0603551d250416301406082b0601050507030106082b06010505070302301d0603551d0e04160414c03152cd5a50c3827c7471cecbe99cf97aeb82e2301f0603551d230418301680148418cc8534ecbc0c94942e08599cc7b2104e0a08307b06082b06010505070101046f306d302f06082b060105050730018623687474703a2f2f6f6373702e726f6f746361312e616d617a6f6e74727573742e636f6d303a06082b06010505073002862e687474703a2f2f6372742e726f6f746361312e616d617a6f6e74727573742e636f6d2f726f6f746361312e636572303f0603551d1f043830363034a032a030862e687474703a2f2f63726c2e726f6f746361312e616d617a6f6e74727573742e636f6d2f726f6f746361312e63726c30130603551d20040c300a3008060667810c010201300d06092a864886f70d01010b050003820101002d4e2e85b340337e2fa2c26ee3af3f824b11c7fae1e5ecb6b0dcc4125d5b51f11579dcfb51eabffa80da6a97376866ae0529b0038b5bfd06e9fc458f03e75b9e7517e3b1b7a8762cde041f275e67b20f7dc4a7b5404e3e28cdc777d581557e0461bd34b136bad394da569149349b704c3eff2c837f351e103ab84628904e6af6ec2cff76242aa462133dd3b1a5a626a21166131b8007e9eceec55301486fb508b29a206522b13c8589a7188fa374dc05a99b6d5b5039c3515b3e6a090743b25236c9acaad27d935e81f23422c41fcae9b0945520b16c8348dcec1685acc9c5e3adbe6a349e8608f5d8889d35e44de3397e12835a59da675a776f4a900492ad8f), CertificateDer(0x308204923082037aa0030201020213067f944a2a27cdf3fac2ae2b01f908eeb9c4c6300d06092a864886f70d01010b0500308198310b30090603550406130255533110300e060355040813074172697a6f6e61311330110603550407130a53636f74747364616c6531253023060355040a131c537461726669656c6420546563686e6f6c6f676965732c20496e632e313b303906035504031332537461726669656c6420536572766963657320526f6f7420436572746966696361746520417574686f72697479202d204732301e170d3135303532353132303030305a170d3337313233313031303030305a3039310b3009060355040613025553310f300d060355040a1306416d617a6f6e3119301706035504031310416d617a6f6e20526f6f74204341203130820122300d06092a864886f70d01010105000382010f003082010a0282010100b2788071ca78d5e371af478050747d6ed8d78876f49968f7582160f97484012fac022d86d3a0437a4eb2a4d036ba01be8ddb48c80717364cf4ee8823c73eeb37f5b519f84968b0ded7b976381d619ea4fe8236a5e54a56e445e1f9fdb416fa74da9c9b35392ffab02050066c7ad080b2a6f9afec47198f503807dca2873958f8bad5a9f948673096ee94785e6f89a351c0308666a14566ba54eba3c391f948dcffd1e8302d7d2d747035d78824f79ec4596ebb738717f2324628b843fab71daacab4f29f240e2d4bf7715c5e69ffea9502cb388aae50386fdbfb2d621bc5c71e54e177e067c80f9c8723d63f40207f2080c4804c3e3b24268e04ae6c9ac8aa0d0203010001a38201313082012d300f0603551d130101ff040530030101ff300e0603551d0f0101ff040403020186301d0603551d0e041604148418cc8534ecbc0c94942e08599cc7b2104e0a08301f0603551d230418301680149c5f00dfaa01d7302b3888a2b86d4a9cf2119183307806082b06010505070101046c306a302e06082b060105050730018622687474703a2f2f6f6373702e726f6f7467322e616d617a6f6e74727573742e636f6d303806082b06010505073002862c687474703a2f2f6372742e726f6f7467322e616d617a6f6e74727573742e636f6d2f726f6f7467322e636572303d0603551d1f043630343032a030a02e862c687474703a2f2f63726c2e726f6f7467322e616d617a6f6e74727573742e636f6d2f726f6f7467322e63726c30110603551d20040a300830060604551d2000300d06092a864886f70d01010b050003820101006237425cbc10b53e8b2ce90c9b6c45e207007af9c5580bb9088c3eedb3253cb56f50e4cd356aa79334963221a94844ab9ced3db4aa736de47f1680896ccf280318834779a3107e305bac3bb060e077d408a6e11d7c5ec0bbf99a7b229da700097eac461783dc9c265799303962968feddadeaac5cc1b3eca43686c5716bcd50e202efeffc26a5d2ea04a6d14588794e639315f7c73cb90886a84119627a6edd98146a67ea372000a523e83880763778969170f3985d2ab08454dd0513afd5d5d37644c7e30b25524429d36b05d9c178161f1caf9100224abeb0d74918d7b4529503988b2a68935251e146a4723312f5c9afaad9a0e6251a42aa9c4f9349d2118), CertificateDer(0x308204753082035da003020102020900a70e4a4c3482b77f300d06092a864886f70d01010b05003068310b300906035504061302555331253023060355040a131c537461726669656c6420546563686e6f6c6f676965732c20496e632e31323030060355040b1329537461726669656c6420436c61737320322043657274696669636174696f6e20417574686f72697479301e170d3039303930323030303030305a170d3334303632383137333931365a308198310b30090603550406130255533110300e060355040813074172697a6f6e61311330110603550407130a53636f74747364616c6531253023060355040a131c537461726669656c6420546563686e6f6c6f676965732c20496e632e313b303906035504031332537461726669656c6420536572766963657320526f6f7420436572746966696361746520417574686f72697479202d20473230820122300d06092a864886f70d01010105000382010f003082010a0282010100d50c3ac42af94ee2f5be19975f8e8853b11f3fcbcf9f20136d293ac80f7d3cf76b763863d93660a89b5e5c0080b22f597ff687f9254386e7691b529a90e171e3d82d0d4e6ff6c849d9b6f31a56ae2bb67414ebcffb26e31aba1d962e6a3b5894894756ff25a093705383da847414c3679e04683adf8e405a1d4a4ecf43913be756d60070cb52ee7b7dae3ae7bc31f945f6c260cf1359022b80cc3447dfb9de90656d02cf2c91a6a6e7de8518497c664ea33a6da9b5ee342eba0d03b833df47ebb16b8d25d99bce81d1454632967087de020e494385b66c73bb64ea6141acc9d454df872fc722b226cc9f5954689ffcbe2a2fc4551c75406017850255398b7f050203010001a381f03081ed300f0603551d130101ff040530030101ff300e0603551d0f0101ff040403020186301d0603551d0e041604149c5f00dfaa01d7302b3888a2b86d4a9cf2119183301f0603551d23041830168014bf5fb7d1cedd1f86f45b55acdcd710c20ea988e7304f06082b0601050507010104433041301c06082b060105050730018610687474703a2f2f6f2e7373322e75732f302106082b060105050730028615687474703a2f2f782e7373322e75732f782e63657230260603551d1f041f301d301ba019a0178615687474703a2f2f732e7373322e75732f722e63726c30110603551d20040a300830060604551d2000300d06092a864886f70d01010b05000382010100231de38a57ca7de917794cf11e55fdcc536e3e470fdfc655f2b20436ed801f53c45d34286bbec755fc67eacb3f7f90b233cd1b58108202f8f82ff51360d405cef18108c1dda775974f18b96ddef7939108ba7e402cedc1eabb769e3306771d0d087f53dd1b64ab8227f169d54d5eaef4a1c375a758442df23c7098acba69b695777f0f315e2cfca0873a4769f0795ff41454a4955e1178126027ce9fc277ff2353775dbaffea59e7dbcfaf9296ef249a35107a9c91c60e7d99f63f19dff57254e115a907597b83bf522e468cb20064761c48d3d879e86e56ccae2c0390d7193899e4ca09195bff0796b0a87f3449df56a9f7b05fed33ed8c47b730035df4038c)])
[2024-08-26T22:58:39Z TRACE] Unvalidated OCSP response: [48, 130, 1, 211, 10, 1, 0, 160, 130, 1, 204, 48, 130, 1, 200, 6, 9, 43, 6, 1, 5, 5, 7, 48, 1, 1, 4, 130, 1, 185, 48, 130, 1, 181, 48, 129, 158, 162, 22, 4, 20, 192, 49, 82, 205, 90, 80, 195, 130, 124, 116, 113, 206, 203, 233, 156, 249, 122, 235, 130, 226, 24, 15, 50, 48, 50, 52, 48, 56, 50, 54, 49, 48, 53, 52, 50, 56, 90, 48, 115, 48, 113, 48, 73, 48, 9, 6, 5, 43, 14, 3, 2, 26, 5, 0, 4, 20, 102, 109, 11, 112, 156, 137, 228, 190, 75, 235, 236, 19, 69, 71, 228, 182, 149, 54, 15, 140, 4, 20, 192, 49, 82, 205, 90, 80, 195, 130, 124, 116, 113, 206, 203, 233, 156, 249, 122, 235, 130, 226, 2, 16, 4, 18, 175, 18, 0, 86, 23, 1, 52, 137, 47, 137, 137, 214, 213, 174, 128, 0, 24, 15, 50, 48, 50, 52, 48, 56, 50, 54, 49, 48, 51, 57, 48, 50, 90, 160, 17, 24, 15, 50, 48, 50, 52, 48, 57, 48, 50, 48, 57, 51, 57, 48, 50, 90, 48, 13, 6, 9, 42, 134, 72, 134, 247, 13, 1, 1, 11, 5, 0, 3, 130, 1, 1, 0, 120, 98, 229, 204, 117, 47, 73, 30, 170, 83, 222, 119, 118, 234, 227, 79, 223, 38, 213, 108, 128, 145, 176, 236, 185, 151, 79, 169, 237, 134, 34, 82, 225, 59, 121, 247, 70, 162, 222, 106, 226, 78, 119, 220, 253, 102, 202, 174, 246, 156, 83, 81, 176, 82, 46, 116, 82, 237, 221, 145, 68, 235, 39, 195, 159, 147, 26, 189, 124, 184, 207, 6, 187, 114, 85, 177, 254, 175, 123, 75, 131, 171, 168, 24, 192, 150, 3, 249, 17, 144, 64, 243, 82, 151, 40, 252, 64, 58, 88, 35, 112, 47, 195, 6, 225, 59, 192, 94, 193, 236, 59, 159, 252, 34, 120, 130, 253, 13, 93, 221, 156, 63, 217, 139, 69, 132, 60, 114, 59, 195, 123, 62, 86, 179, 12, 151, 131, 253, 211, 163, 254, 37, 56, 238, 238, 38, 252, 158, 169, 22, 29, 13, 63, 1, 239, 170, 28, 183, 167, 254, 15, 190, 188, 115, 219, 47, 214, 58, 1, 25, 233, 115, 181, 155, 239, 154, 207, 185, 253, 69, 163, 71, 162, 149, 152, 8, 87, 231, 166, 182, 52, 177, 196, 193, 127, 239, 239, 22, 93, 129, 217, 153, 42, 134, 209, 111, 180, 122, 32, 141, 236, 200, 239, 223, 230, 220, 19, 64, 109, 18, 111, 171, 103, 74, 42, 207, 129, 46, 148, 89, 163, 249, 26, 64, 167, 26, 148, 46, 133, 163, 198, 57, 168, 87, 153, 9, 197, 71, 163, 245, 45, 170, 153, 12, 187, 86]
[2024-08-26T22:58:39Z DEBUG] created stream: Stream(RustlsStream)
[2024-08-26T22:58:39Z DEBUG] sending request GET https://crates.io/api/v1/crates/espflash/versions
[2024-08-26T22:58:39Z DEBUG] writing prelude: GET /api/v1/crates/espflash/versions HTTP/1.1
    Host: crates.io
    User-Agent: ureq/2.10.1
    Accept: */*
    accept-encoding: gzip
[2024-08-26T22:58:39Z DEBUG] Chunked body in response
[2024-08-26T22:58:39Z DEBUG] response 200 to GET https://crates.io/api/v1/crates/espflash/versions
[2024-08-26T22:58:39Z DEBUG] dropping stream: Stream(RustlsStream)
[2024-08-26T22:58:39Z INFO ] 🚀 A new version of espflash is available: v3.1.1
[2024-08-26T22:58:39Z INFO ] Detected 4 serial ports
[2024-08-26T22:58:39Z INFO ] Ports which match a known common dev board are highlighted
[2024-08-26T22:58:39Z INFO ] Please select a port
[2024-08-26T22:58:42Z INFO ] Serial port: '/dev/cu.usbmodem01'
[2024-08-26T22:58:42Z INFO ] Connecting...
[2024-08-26T22:59:13Z INFO ] Using flash stub
[2024-08-26T22:59:13Z DEBUG] Loading flash stub for chip: Esp32s2
[2024-08-26T22:59:13Z DEBUG] Write 4336 byte stub text
[2024-08-26T22:59:13Z DEBUG] Write 160 byte stub data
[2024-08-26T22:59:13Z DEBUG] Finish stub write
[2024-08-26T22:59:13Z DEBUG] Stub written!
[2024-08-26T22:59:13Z DEBUG] Re-detected chip: Esp32s2
[2024-08-26T22:59:13Z DEBUG] Attempting flash enable with: SpiAttachParams { clk: 0, q: 0, d: 0, hd: 0, cs: 0 }
[2024-08-26T22:59:13Z DEBUG] Flash detect OK!
Chip type:         esp32s2 (revision v0.0)
Crystal frequency: 40MHz
Flash size:        4MB
Features:          WiFi, Embedded Flash 4MB, Embedded PSRAM 2MB, ADC and temperature sensor calibration in BLK2 of efuse V1
MAC address:       84:f7:03:f6:9a:c8
App/part. size:    385,984/4,128,768 bytes, 9.35%
[00:00:00] [========================================]       7/7       0x1000    [00:00:00] [========================================]       1/1       0x8000    [00:00:03] [========================================]     110/110     0x10000   [2024-08-26T22:59:17Z INFO ] Flashing has completed!
Commands:
    CTRL+R    Reset chip
    CTRL+C    Exit

[2024-08-26T22:59:23Z TRACE] registering event source with poller: token=Token(0), interests=READABLE2024-08-26T22:59:23Z TRACE] registering event source with poller: token=Token(1), interests=READABLE
3.1.1 trace logs
➜  esp-test git:(master) ✗ RUST_LOG=trace cargo run --release 
    Finished `release` profile [optimized] target(s) in 0.16s
     Running `espflash flash --monitor target/xtensa-esp32s2-espidf/release/esp-test`
[2024-08-27T02:47:08Z DEBUG] Flash(
        FlashArgs {
            connect_args: ConnectArgs {
                after: HardReset,
                baud: None,
                before: DefaultReset,
                chip: None,
                confirm_port: false,
                list_all_ports: false,
                no_stub: false,
                port: None,
            },
            flash_config_args: FlashConfigArgs {
                flash_freq: None,
                flash_mode: None,
                flash_size: None,
            },
            flash_args: FlashArgs {
                erase_parts: None,
                erase_data_parts: None,
                log_format: Serial,
                monitor: true,
                monitor_baud: None,
                ram: false,
                no_verify: false,
                no_skip: false,
                image: ImageArgs {
                    bootloader: None,
                    partition_table: None,
                    partition_table_offset: None,
                    target_app_partition: None,
                    min_chip_rev: 0,
                },
            },
            image: "target/xtensa-esp32s2-espidf/release/esp-test",
        },
    )
[2024-08-27T02:47:09Z DEBUG] connecting to crates.io:443 at 54.230.202.82:443
[2024-08-27T02:47:09Z DEBUG] No cached session for DnsName("crates.io")
[2024-08-27T02:47:09Z DEBUG] Not resuming any session
[2024-08-27T02:47:09Z TRACE] Sending ClientHello Message {
        version: TLSv1_0,
        payload: Handshake {
            parsed: HandshakeMessagePayload {
                typ: ClientHello,
                payload: ClientHello(
                    ClientHelloPayload {
                        client_version: TLSv1_2,
                        random: ae11f53009ef876ddc0397bcdaeba3a9b26e3b96718843be1158d6f26db3b064,
                        session_id: a55e1070692b7d060baa76454a30e0e95a016cd955eaf883255ddfbc8bc91076,
                        cipher_suites: [
                            TLS13_AES_256_GCM_SHA384,
                            TLS13_AES_128_GCM_SHA256,
                            TLS13_CHACHA20_POLY1305_SHA256,
                            TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
                            TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
                            TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,
                            TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
                            TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
                            TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
                            TLS_EMPTY_RENEGOTIATION_INFO_SCSV,
                        ],
                        compression_methods: [
                            Null,
                        ],
                        extensions: [
                            ExtendedMasterSecretRequest,
                            SessionTicket(
                                Request,
                            ),
                            PresharedKeyModes(
                                [
                                    PSK_DHE_KE,
                                ],
                            ),
                            SupportedVersions(
                                [
                                    TLSv1_3,
                                    TLSv1_2,
                                ],
                            ),
                            KeyShare(
                                [
                                    KeyShareEntry {
                                        group: X25519,
                                        payload: 1c2277eb18bdc1d977f421f46b9a12f237895c2016d17244ce43021937b0ee4c,
                                    },
                                ],
                            ),
                            ServerName(
                                [
                                    ServerName {
                                        typ: HostName,
                                        payload: HostName(
                                            DnsName(
                                                "crates.io",
                                            ),
                                        ),
                                    },
                                ],
                            ),
                            SignatureAlgorithms(
                                [
                                    ECDSA_NISTP384_SHA384,
                                    ECDSA_NISTP256_SHA256,
                                    ED25519,
                                    RSA_PSS_SHA512,
                                    RSA_PSS_SHA384,
                                    RSA_PSS_SHA256,
                                    RSA_PKCS1_SHA512,
                                    RSA_PKCS1_SHA384,
                                    RSA_PKCS1_SHA256,
                                ],
                            ),
                            EcPointFormats(
                                [
                                    Uncompressed,
                                ],
                            ),
                            NamedGroups(
                                [
                                    X25519,
                                    secp256r1,
                                    secp384r1,
                                ],
                            ),
                            CertificateStatusRequest(
                                Ocsp(
                                    OcspCertificateStatusRequest {
                                        responder_ids: [],
                                        extensions: ,
                                    },
                                ),
                            ),
                        ],
                    },
                ),
            },
            encoded: 010000e30303ae11f53009ef876ddc0397bcdaeba3a9b26e3b96718843be1158d6f26db3b06420a55e1070692b7d060baa76454a30e0e95a016cd955eaf883255ddfbc8bc910760014130213011303c02cc02bcca9c030c02fcca800ff010000860017000000230000002d00020101002b00050403040303003300260024001d00201c2277eb18bdc1d977f421f46b9a12f237895c2016d17244ce43021937b0ee4c0000000e000c0000096372617465732e696f000d00140012050304030807080608050804060105010401000b00020100000a00080006001d00170018000500050100000000,
        },
    }
[2024-08-27T02:47:09Z TRACE] We got ServerHello ServerHelloPayload {
        legacy_version: TLSv1_2,
        random: 0731e0cf868e445caee0e5f77c101931b52d6d2b52e90c56c191828ef4d00365,
        session_id: a55e1070692b7d060baa76454a30e0e95a016cd955eaf883255ddfbc8bc91076,
        cipher_suite: TLS13_AES_128_GCM_SHA256,
        compression_method: Null,
        extensions: [
            SupportedVersions(
                TLSv1_3,
            ),
            KeyShare(
                KeyShareEntry {
                    group: X25519,
                    payload: cbb51fbb5d6557c39386e6bef34a9f28c9f1b6b18f3b4552b649f9479ff2995f,
                },
            ),
        ],
    }
[2024-08-27T02:47:09Z DEBUG] Using ciphersuite TLS13_AES_128_GCM_SHA256
[2024-08-27T02:47:09Z DEBUG] Not resuming
[2024-08-27T02:47:09Z TRACE] EarlyData rejected
[2024-08-27T02:47:09Z TRACE] Dropping CCS
[2024-08-27T02:47:09Z DEBUG] TLS1.3 encrypted extensions: [ServerNameAck]
[2024-08-27T02:47:09Z DEBUG] ALPN protocol is None
[2024-08-27T02:47:09Z TRACE] Server cert is CertificateChain([CertificateDer(0x308205ff308204e7a00302010202100412af120056170134892f8989d6d5ae300d06092a864886f70d01010b0500303c310b3009060355040613025553310f300d060355040a1306416d617a6f6e311c301a06035504031313416d617a6f6e205253412032303438204d3032301e170d3233313232363030303030305a170d3235303132333233353935395a301431123010060355040313096372617465732e696f30820122300d06092a864886f70d01010105000382010f003082010a0282010100cb685a2ceefcede31c39219ee2a7a103e026caeab200c16a2de177dd7c908de47e18abe9a60c8c9c805904777a689871c429fcb4679f2d47ce1cdd1f4215858d0a89969481d291a538cd4db1d28446153130e53cfe559d74fa2384b0d5e628b7b45c03373d21484a7d0b53def9dc53b3b430334408a0c5b1d22941baef7b35bf2916243d1005b9e1092473756012f66c4dc9a7d3f19d4d7cd421dc5f5b0b1d6ce4f73a9ebb172766fa681beb00677ca1075546215e47493b7a97c90dc298a8fa247b65e9cbb333be45f1661ecc77cdae7bb03d9ba95995b46baca7312e5457c743417f01c38293bc152025db2dcd79f06deaadbf5ecd2a5cc8743650f89ae1310203010001a38203233082031f301f0603551d23041830168014c03152cd5a50c3827c7471cecbe99cf97aeb82e2301d0603551d0e041604142f604fc71d49e5ef1d9a80befd9d3776d45ea0cb30540603551d11044d304b82096372617465732e696f821b636c6f756466726f6e742d7374617469632e6372617465732e696f820f696e6465782e6372617465732e696f82107374617469632e6372617465732e696f30130603551d20040c300a3008060667810c010201300e0603551d0f0101ff0404030205a0301d0603551d250416301406082b0601050507030106082b06010505070302303b0603551d1f043430323030a02ea02c862a687474703a2f2f63726c2e72326d30322e616d617a6f6e74727573742e636f6d2f72326d30322e63726c307506082b0601050507010104693067302d06082b060105050730018621687474703a2f2f6f6373702e72326d30322e616d617a6f6e74727573742e636f6d303606082b06010505073002862a687474703a2f2f6372742e72326d30322e616d617a6f6e74727573742e636f6d2f72326d30322e636572300c0603551d130101ff040230003082017f060a2b06010401d6790204020482016f0482016b01690076004e75a3275c9a10c3385b6cd4df3f52eb1df0e08e1b8d69c0b1fa64b1629a39df0000018ca4ec78a00000040300473045022100a4648e92ea738b6b0f6c6bc09ded16e1617e850fd86eee5061d17a6a493752cd02200a41b7afdde3c1914a17dbec7c066318860418bcf1944082024e254f5300fc9d0077007d591e12e1782a7b1c61677c5efdf8d0875c14a04e959eb9032fd90e8c2e79b80000018ca4ec78ca0000040300483046022100d7463d54e1e1fb9eb94a5c1e35f33239e15c983ccba2a259116034e6e56fffb9022100c817150c80a1df94cd2673aff3fc1212d45aff1fe92175d0e5527752eacd9d88007600e6d2316340778cc1104106d771b9cec1d240f6968486fbba87321dfd1e378e500000018ca4ec78f3000004030047304502205c25f8bb7e37a0006bee2c2c5e19c6b23ae5e4c7f48815fbd32160943755ac15022100c6881f90e102f19adbf2d2613a877d961a4103883a9534915365c129b1291892300d06092a864886f70d01010b0500038201010075a67251c261484ffeed0818068e9abdbb7b0161e9d08789ed278b9ea0c9687d1a1ac4d56f81bd63a337750983e8dadcc99d7c7e1754d7fb6868c0555023d48febc60657b65a1c234fc226901ad23a53738437c35ac1b67c2b0ba2b44cad9a98b5f80bad56cbe5d75c50858bc94ccbcee08c736f6cfc29facd431d8b975cf15e1ab27635fb541a77e8517a367ea8b60c4bee8dfd68d1216d8e8f9e99cedd353a53c37bdee0cc7b9cc925782cb88f262e886aa610bc9934777d902bd74bdbbbce370a21a5f620a7a15279d26bc655a6f48db825fd2ab5cd8cd8cf08c66ebe75db00ffa9f1f814a0850b98ee02482bc6b16fe5081b326e0aeb6d8df62e0e30e3d7), CertificateDer(0x3082045e30820346a00302010202130773124a4bcbd44ec7b53beaf194842d3a0fa1300d06092a864886f70d01010b05003039310b3009060355040613025553310f300d060355040a1306416d617a6f6e3119301706035504031310416d617a6f6e20526f6f742043412031301e170d3232303832333232323533305a170d3330303832333232323533305a303c310b3009060355040613025553310f300d060355040a1306416d617a6f6e311c301a06035504031313416d617a6f6e205253412032303438204d303230820122300d06092a864886f70d01010105000382010f003082010a0282010100bb4318c65aa879de29e8b56f2ebea543cf2e58d3075e374a2e95a4458f73a9929058596ffeaaae4672a079502db0d89c8d83ee10f4b1dcc4a9f9ee02322cb9740b1b703c4ef5fa577a053411557bc3652c91ef06c78a63cf2c68bc2e7f191957093be20e275a534c5f395af58e45df0c111f03151f8e37c46cfa52d192652a90f78785c795fb4e5aadf30862f2a09a29d679acd6a4fabf6751384e78296a15de285f2721fff45ced8d1e5f528d587612235364df59988222b726f1f4eb783e2bdb4703add979380a82776587e588fb3bfb8b8e077a94598c0d45630619f55bfff54902e58cfcff253ae5f823684fb05473387bf6320b6a2cacf584ee027e75730203010001a382015a3082015630120603551d130101ff040830060101ff020100300e0603551d0f0101ff040403020186301d0603551d250416301406082b0601050507030106082b06010505070302301d0603551d0e04160414c03152cd5a50c3827c7471cecbe99cf97aeb82e2301f0603551d230418301680148418cc8534ecbc0c94942e08599cc7b2104e0a08307b06082b06010505070101046f306d302f06082b060105050730018623687474703a2f2f6f6373702e726f6f746361312e616d617a6f6e74727573742e636f6d303a06082b06010505073002862e687474703a2f2f6372742e726f6f746361312e616d617a6f6e74727573742e636f6d2f726f6f746361312e636572303f0603551d1f043830363034a032a030862e687474703a2f2f63726c2e726f6f746361312e616d617a6f6e74727573742e636f6d2f726f6f746361312e63726c30130603551d20040c300a3008060667810c010201300d06092a864886f70d01010b050003820101002d4e2e85b340337e2fa2c26ee3af3f824b11c7fae1e5ecb6b0dcc4125d5b51f11579dcfb51eabffa80da6a97376866ae0529b0038b5bfd06e9fc458f03e75b9e7517e3b1b7a8762cde041f275e67b20f7dc4a7b5404e3e28cdc777d581557e0461bd34b136bad394da569149349b704c3eff2c837f351e103ab84628904e6af6ec2cff76242aa462133dd3b1a5a626a21166131b8007e9eceec55301486fb508b29a206522b13c8589a7188fa374dc05a99b6d5b5039c3515b3e6a090743b25236c9acaad27d935e81f23422c41fcae9b0945520b16c8348dcec1685acc9c5e3adbe6a349e8608f5d8889d35e44de3397e12835a59da675a776f4a900492ad8f), CertificateDer(0x308204923082037aa0030201020213067f944a2a27cdf3fac2ae2b01f908eeb9c4c6300d06092a864886f70d01010b0500308198310b30090603550406130255533110300e060355040813074172697a6f6e61311330110603550407130a53636f74747364616c6531253023060355040a131c537461726669656c6420546563686e6f6c6f676965732c20496e632e313b303906035504031332537461726669656c6420536572766963657320526f6f7420436572746966696361746520417574686f72697479202d204732301e170d3135303532353132303030305a170d3337313233313031303030305a3039310b3009060355040613025553310f300d060355040a1306416d617a6f6e3119301706035504031310416d617a6f6e20526f6f74204341203130820122300d06092a864886f70d01010105000382010f003082010a0282010100b2788071ca78d5e371af478050747d6ed8d78876f49968f7582160f97484012fac022d86d3a0437a4eb2a4d036ba01be8ddb48c80717364cf4ee8823c73eeb37f5b519f84968b0ded7b976381d619ea4fe8236a5e54a56e445e1f9fdb416fa74da9c9b35392ffab02050066c7ad080b2a6f9afec47198f503807dca2873958f8bad5a9f948673096ee94785e6f89a351c0308666a14566ba54eba3c391f948dcffd1e8302d7d2d747035d78824f79ec4596ebb738717f2324628b843fab71daacab4f29f240e2d4bf7715c5e69ffea9502cb388aae50386fdbfb2d621bc5c71e54e177e067c80f9c8723d63f40207f2080c4804c3e3b24268e04ae6c9ac8aa0d0203010001a38201313082012d300f0603551d130101ff040530030101ff300e0603551d0f0101ff040403020186301d0603551d0e041604148418cc8534ecbc0c94942e08599cc7b2104e0a08301f0603551d230418301680149c5f00dfaa01d7302b3888a2b86d4a9cf2119183307806082b06010505070101046c306a302e06082b060105050730018622687474703a2f2f6f6373702e726f6f7467322e616d617a6f6e74727573742e636f6d303806082b06010505073002862c687474703a2f2f6372742e726f6f7467322e616d617a6f6e74727573742e636f6d2f726f6f7467322e636572303d0603551d1f043630343032a030a02e862c687474703a2f2f63726c2e726f6f7467322e616d617a6f6e74727573742e636f6d2f726f6f7467322e63726c30110603551d20040a300830060604551d2000300d06092a864886f70d01010b050003820101006237425cbc10b53e8b2ce90c9b6c45e207007af9c5580bb9088c3eedb3253cb56f50e4cd356aa79334963221a94844ab9ced3db4aa736de47f1680896ccf280318834779a3107e305bac3bb060e077d408a6e11d7c5ec0bbf99a7b229da700097eac461783dc9c265799303962968feddadeaac5cc1b3eca43686c5716bcd50e202efeffc26a5d2ea04a6d14588794e639315f7c73cb90886a84119627a6edd98146a67ea372000a523e83880763778969170f3985d2ab08454dd0513afd5d5d37644c7e30b25524429d36b05d9c178161f1caf9100224abeb0d74918d7b4529503988b2a68935251e146a4723312f5c9afaad9a0e6251a42aa9c4f9349d2118), CertificateDer(0x308204753082035da003020102020900a70e4a4c3482b77f300d06092a864886f70d01010b05003068310b300906035504061302555331253023060355040a131c537461726669656c6420546563686e6f6c6f676965732c20496e632e31323030060355040b1329537461726669656c6420436c61737320322043657274696669636174696f6e20417574686f72697479301e170d3039303930323030303030305a170d3334303632383137333931365a308198310b30090603550406130255533110300e060355040813074172697a6f6e61311330110603550407130a53636f74747364616c6531253023060355040a131c537461726669656c6420546563686e6f6c6f676965732c20496e632e313b303906035504031332537461726669656c6420536572766963657320526f6f7420436572746966696361746520417574686f72697479202d20473230820122300d06092a864886f70d01010105000382010f003082010a0282010100d50c3ac42af94ee2f5be19975f8e8853b11f3fcbcf9f20136d293ac80f7d3cf76b763863d93660a89b5e5c0080b22f597ff687f9254386e7691b529a90e171e3d82d0d4e6ff6c849d9b6f31a56ae2bb67414ebcffb26e31aba1d962e6a3b5894894756ff25a093705383da847414c3679e04683adf8e405a1d4a4ecf43913be756d60070cb52ee7b7dae3ae7bc31f945f6c260cf1359022b80cc3447dfb9de90656d02cf2c91a6a6e7de8518497c664ea33a6da9b5ee342eba0d03b833df47ebb16b8d25d99bce81d1454632967087de020e494385b66c73bb64ea6141acc9d454df872fc722b226cc9f5954689ffcbe2a2fc4551c75406017850255398b7f050203010001a381f03081ed300f0603551d130101ff040530030101ff300e0603551d0f0101ff040403020186301d0603551d0e041604149c5f00dfaa01d7302b3888a2b86d4a9cf2119183301f0603551d23041830168014bf5fb7d1cedd1f86f45b55acdcd710c20ea988e7304f06082b0601050507010104433041301c06082b060105050730018610687474703a2f2f6f2e7373322e75732f302106082b060105050730028615687474703a2f2f782e7373322e75732f782e63657230260603551d1f041f301d301ba019a0178615687474703a2f2f732e7373322e75732f722e63726c30110603551d20040a300830060604551d2000300d06092a864886f70d01010b05000382010100231de38a57ca7de917794cf11e55fdcc536e3e470fdfc655f2b20436ed801f53c45d34286bbec755fc67eacb3f7f90b233cd1b58108202f8f82ff51360d405cef18108c1dda775974f18b96ddef7939108ba7e402cedc1eabb769e3306771d0d087f53dd1b64ab8227f169d54d5eaef4a1c375a758442df23c7098acba69b695777f0f315e2cfca0873a4769f0795ff41454a4955e1178126027ce9fc277ff2353775dbaffea59e7dbcfaf9296ef249a35107a9c91c60e7d99f63f19dff57254e115a907597b83bf522e468cb20064761c48d3d879e86e56ccae2c0390d7193899e4ca09195bff0796b0a87f3449df56a9f7b05fed33ed8c47b730035df4038c)])
[2024-08-27T02:47:09Z DEBUG] created stream: Stream(RustlsStream)
[2024-08-27T02:47:09Z DEBUG] sending request GET https://crates.io/api/v1/crates/espflash/versions
[2024-08-27T02:47:09Z DEBUG] writing prelude: GET /api/v1/crates/espflash/versions HTTP/1.1
    Host: crates.io
    User-Agent: ureq/2.10.1
    Accept: */*
    accept-encoding: gzip
[2024-08-27T02:47:09Z DEBUG] Chunked body in response
[2024-08-27T02:47:09Z DEBUG] response 200 to GET https://crates.io/api/v1/crates/espflash/versions
[2024-08-27T02:47:09Z DEBUG] dropping stream: Stream(RustlsStream)
[2024-08-27T02:47:09Z DEBUG] Config: Config {
        baudrate: None,
        bootloader: None,
        connection: Connection {
            serial: None,
        },
        partition_table: None,
        usb_device: [
            UsbDevice {
                vid: 9114,
                pid: 33041,
            },
            UsbDevice {
                vid: 12346,
                pid: 2,
            },
        ],
        flash: FlashSettings {
            mode: None,
            size: None,
            freq: None,
        },
        save_path: "/Users/robertmasen/Library/Application Support/rs.esp.espflash/espflash.toml",
    }
[2024-08-27T02:47:09Z INFO ] Detected 2 serial ports
[2024-08-27T02:47:09Z INFO ] Ports which match a known common dev board are highlighted
[2024-08-27T02:47:09Z INFO ] Please select a port
[2024-08-27T02:47:11Z INFO ] Serial port: '/dev/cu.usbmodem01'
[2024-08-27T02:47:11Z INFO ] Connecting...
[2024-08-27T02:47:11Z DEBUG] Using UnixTight reset strategy with delay of 50ms
[2024-08-27T02:47:13Z DEBUG] Failed to reset, error Connection(
        Serial(
            Error {
                kind: Io(
                    Uncategorized,
                ),
                description: "Device not configured (os error 6)",
            },
        ),
    ), retrying
[2024-08-27T02:47:13Z DEBUG] Using UnixTight reset strategy with delay of 500ms
[2024-08-27T02:47:13Z DEBUG] Failed to reset, error Connection(
        Serial(
            Error {
                kind: Io(
                    Uncategorized,
                ),
                description: "Device not configured (os error 6)",
            },
        ),
    ), retrying
[2024-08-27T02:47:13Z DEBUG] Using Classic reset strategy with delay of 50ms
[2024-08-27T02:47:13Z DEBUG] Failed to reset, error Connection(
        Serial(
            Error {
                kind: Unknown,
                description: "No such device or address",
            },
        ),
    ), retrying
[2024-08-27T02:47:13Z DEBUG] Using Classic reset strategy with delay of 500ms
[2024-08-27T02:47:13Z DEBUG] Failed to reset, error Connection(
        Serial(
            Error {
                kind: Unknown,
                description: "No such device or address",
            },
        ),
    ), retrying
[2024-08-27T02:47:13Z DEBUG] Using UnixTight reset strategy with delay of 50ms
[2024-08-27T02:47:13Z DEBUG] Failed to reset, error Connection(
        Serial(
            Error {
                kind: Io(
                    Uncategorized,
                ),
                description: "Device not configured (os error 6)",
            },
        ),
    ), retrying
[2024-08-27T02:47:13Z DEBUG] Using UnixTight reset strategy with delay of 500ms
[2024-08-27T02:47:13Z DEBUG] Failed to reset, error Connection(
        Serial(
            Error {
                kind: Io(
                    Uncategorized,
                ),
                description: "Device not configured (os error 6)",
            },
        ),
    ), retrying
[2024-08-27T02:47:13Z DEBUG] Using Classic reset strategy with delay of 50ms
[2024-08-27T02:47:13Z DEBUG] Failed to reset, error Connection(
        Serial(
            Error {
                kind: Unknown,
                description: "No such device or address",
            },
        ),
    ), retrying
Error: espflash::connection_failed

  × Error while connecting to device
  ╰─▶ Failed to connect to the device
  help: Ensure that the device is connected and the reset and boot pins are
        not being held down

➜  esp-test git:(master) ✗ 

@FreeMasen
Copy link

Here are the logs every permutation I though would be worth trying

  • before
    • default-reset
    • no-reset
    • no-reset-no-sync
    • usb-reset
  • after
    • hard-reset
    • no-reset
    • no-reset-no-stub
  • flash-mode
    • qio
    • qout
    • dio
    • dout

out.log

@sekwah41
Copy link

sekwah41 commented Aug 30, 2024

Having the same issue so if there is anything I can provide to help or test I will also be able to :)

Though having the same issue running on ubuntu in wsl2 as well as on mac.

@dylif
Copy link
Author

dylif commented Sep 3, 2024

I believe my case is actually a separate issue, but I think setting the flags --before no-reset-no-sync -c esp32s2 might help in your case.

I apologize for the late response. Unfortunately this does not work for me. I get a different error now. I have confirmed the device is in bootloader mode and the correct serial port is selected.

[2024-09-03T00:57:49Z WARN ] Pre-connection option 'NoResetNoSync' was selected. Connection may fail if the chip is not in bootloader or flasher stub mode.
[2024-09-03T00:57:49Z INFO ] Serial port: '/dev/ttyACM0'
[2024-09-03T00:57:49Z INFO ] Connecting...
Error: espflash::timeout

  × Error while connecting to device
  ╰─▶ Timeout while running ReadReg command

@dylif
Copy link
Author

dylif commented Sep 28, 2024

I actually ended up getting this to work with the following command:
espflash flash --port /dev/ttyACM0 --after hard-reset --before no-reset --no-stub --flash-mode qio --flash-size 4mb -c esp32s2

But now I'm struggling to monitor the serial port after flashing. It seems like something related to #621

EDIT: Fixed the monitoring issue (keep in mind I'm using esp-idf-template i.e. std enabled)

  1. Add CONFIG_ESP_CONSOLE_USB_CDC=y to sdkconfig.defaults
  2. Make sure to cargo clean and cargo build
  3. Reflash using command above (I got espflash flash --before no-reset --no-stub working provided the chip was in bootloader mode)
  4. Monitor using espflash monitor -b no-reset-no-sync -c esp32s2

@dylif dylif closed this as completed Sep 28, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in esp-rs Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

6 participants