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

Error on xtensa-esp32s3-espidf #102

Open
lorenzo-pirchio opened this issue Jun 21, 2024 · 5 comments
Open

Error on xtensa-esp32s3-espidf #102

lorenzo-pirchio opened this issue Jun 21, 2024 · 5 comments

Comments

@lorenzo-pirchio
Copy link

Hi,
I am currently working on a project for esp32 in Rust.
I followed the instructions of https://docs.esp-rs.org/book/tooling/debugging/probe-rs.html.
So I did cargo install probe-rs-tools on cmd and I downloaded probe-rs extention for vscode and I added probe-rs.exe as debugger in the extention settings.
I downloaded the esp-idf-template and I added the launch.json file.
But when I launch the debug I get this:
image
Can anyone help me?
Could it be a problem that I didn't set up the cmake extention?
Thanks

@bugadani
Copy link
Contributor

This particular error looks like what happens if you set server: yourself in your launch.json, but then don't actually start probe-rs yourself. The port number seems to support this, can you please try either following Connecting to a standalone probe-rs dap-server server or removing server from your launch config?

Other than that, even if you manage to resolve this particular error, our esp-idf support isn't really done (we don't correctly reset Xtensa ESP32s currently) so you might run into other issues.

@lorenzo-pirchio
Copy link
Author

lorenzo-pirchio commented Jun 24, 2024

This is my launch.json.

{
    "version": "0.24.0",
    "configurations": [
        {
            "type": "probe-rs-debug",
            "request": "launch",
            "name": "Launch",
            "cwd": "C:\\prova-debug4",
            "chip": "esp32s3", //!MODIFY
            "flashingConfig": {
                "flashingEnabled": true,
            },
            "coreConfigs": [
                {
                    "coreIndex": 0,
                    "programBinary": "C:\\S3WifiCD\\xtensa-esp32s3-espidf\\debug", //!MODIFY
                }
            ]
        },
        {
            "type": "probe-rs-debug",
            "request": "attach",
            "name": "Attach",
            "cwd": "C:\\prova-debug4",
            "chip": "esp32s3", //!MODIFY
            "coreConfigs": [
                {
                    "coreIndex": 0,
                    "programBinary": "C:\\S3WifiCD\\xtensa-esp32s3-espidf\\debug", //!MODIFY
                }
            ]
        }
    ]
}

I don't set any server and I removed the lines for the reset but I still have the same problems.
Everytime I get the error, the port number is different.

@bugadani
Copy link
Contributor

Okay thank you. I'm not sure what's going on, maybe @noppej knows how we can get an ECONNREFUSED for a partially supported target 🤔

Also, while this is irrelevant to your issue, "version": "0.24.0" is not correct: the version is related to the launch.json format which should be 0.2.0.

@lorenzo-pirchio
Copy link
Author

lorenzo-pirchio commented Jun 25, 2024

To be sure that I set up the debug environment correctly, I explain all the steps.
First of all, I'm using a Windows pc and Esp32S3.

  1. I did cargo install probe-rs-tools
  2. I downloaded the extension for VSCode
  3. I put the path to probe-rs.exe as debugger in the extension.
  4. I generated launch.json in my project which is the following:
    {
    "version": "0.2.0",
    "configurations": [
    {
    "type": "probe-rs-debug",
    "request": "launch",
    "name": "Launch",
    "cwd": "C:\prova-debug4",
    "chip": "esp32s3", //!MODIFY
    "flashingConfig": {
    "flashingEnabled": true,
    },
    "coreConfigs": [
    {
    "coreIndex": 0,
    "programBinary": "C:\S3WifiCD\xtensa-esp32s3-espidf\debug", //!MODIFY
    }
    ]
    },
    {
    "type": "probe-rs-debug",
    "request": "attach",
    "name": "Attach",
    "cwd": "C:\prova-debug4",
    "chip": "esp32s3", //!MODIFY
    "coreConfigs": [
    {
    "coreIndex": 0,
    "programBinary": "C:\S3WifiCD\xtensa-esp32s3-espidf\debug", //!MODIFY
    }
    ]
    }
    ]
    }
  5. I changed config.toml adding:
    [target.'cfg(any(target_arch = "riscv32", target_arch = "xtensa"))']
    runner = "probe-rs run --chip esp32s3"
    linker = "ldproxy"

I have a doubt, Do I need to have cmake installed in my pc to use probe-rs?

@Tiwalun
Copy link
Member

Tiwalun commented Jul 25, 2024

The programBinary path looks wrong if it's a Rust project, it should point to the actual binary file which is usually in something like target/<architecture>/debug/program(not sure what the architecture for this chip is).

And can you see anything in the Debug Console output in vscode? Something like this:

grafik

@Tiwalun Tiwalun transferred this issue from probe-rs/probe-rs Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants