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

[Feature Request]: Flash via JTAG _without_ serial (VSC-1575) #1411

Closed
karlp opened this issue Jan 23, 2025 · 4 comments · May be fixed by #1413
Closed

[Feature Request]: Flash via JTAG _without_ serial (VSC-1575) #1411

karlp opened this issue Jan 23, 2025 · 4 comments · May be fixed by #1413
Assignees
Labels
Feature / Enhancement Request Request for Feature/ Enhancement

Comments

@karlp
Copy link

karlp commented Jan 23, 2025

Is your feature request related to a problem? Please describe.
I have a board that has only a jtag header. (2x5pin, I'm not talking about Using command line tools, I can flash and debug, using openocd, and "mon program_esp ...."
However, if I try and flash in vscode, it always attempts to open a serial port with esptool. This is despite having "flash method JTAG" set ("idf.flashType": "JTAG")

It seems that #183 really only applies to flashing via the built in usb-jtag? at least, it certainly doesn't seem to help

It's perhaps demonstrated by this diagram: https://docs.espressif.com/projects/vscode-esp-idf-extension/en/latest/debugproject.html#debugging-process-overview where it shows that flashing is always via the uart.

I very much want to avoid having to use a second cable, just for vscode.

Describe alternatives you've considered
Adding a serial connection jsut for flashing does work, but... seriously?

I've tried using the explist tasks "ESP-IDF:Flash (with jtag)" option as well, both with and without openocd started before hand.

Additional context
maybe I'm just missing how to configure this?

I'm not very good at reading typescript, but it almost appears as if the jtag code got detached somewhere. flashcmd.ts will error if a port isn't set, and in flashtask, https://github.com/espressif/vscode-esp-idf-extension/blob/master/src/flash/flashTask.ts#L111-L119 it seems to just... not handle the jtag case?

My openocd.cfg file

source [find interface/cmsis-dap.cfg]
adapter speed 8000
transport select jtag
bindto 0.0.0.0
set ESP32_FLASH_VOLTAGE 3.3
# Source the ESP32 configuration file
source [find target/esp32.cfg]

My settings.json

{
        "C_Cpp.intelliSenseEngine": "default",
        "idf.espIdfPath": "/home/karlp/src/esp-idf",
        "idf.toolsPath": "/home/karlp/tools/esp-idf",
        "idf.openOcdConfigs": [
                "openocd.cfg",
        ],
        "idf.openOcdDebugLevel": "3",
        "idf.flashType": "JTAG"
}

ESP-IDF plugin version: 1.9.0

@karlp karlp added the Feature / Enhancement Request Request for Feature/ Enhancement label Jan 23, 2025
@github-actions github-actions bot changed the title [Feature Request]: Flash via JTAG _without_ serial [Feature Request]: Flash via JTAG _without_ serial (VSC-1575) Jan 23, 2025
@radurentea radurentea self-assigned this Jan 28, 2025
@radurentea
Copy link
Collaborator

Hi @karlp,

Thanks for bringing this up to our attention. I've made a fix for this. Could you please test it to see if it solves the reported issue?

You can test these changes by installing this VSIX by click menu View -> Command Palette..., type Install from VSIX and then select downloaded esp-idf-extension.vsix file to install the extension.

@karlp
Copy link
Author

karlp commented Jan 28, 2025

Will do! Thanks for looking at this so promptly!

@karlp
Copy link
Author

karlp commented Jan 29, 2025

That's working well to flash now thank you very much. It even makes F5 to launch and debug work now! This is an excellent improvement :)

I did run into an issue where my openocd.cfg file had the following lines

source [find interface/cmsis-dap.cfg]
adapter speed 8000
source [find target/esp32.cfg]

init
esp apptrace start file:///tmp/my-app-trace.log
echo ">KARL:  Remember: /tmp/my-app-trace.log has app trace!"

The init and apptrace lines had to be removed from the openocd.cfg that vscode was using. With those in place, you get a very cryptic error message and an empty dialog like this:

Image

Just an FYI if you happen to see anyone else with that sort of problem, it's the "init" in their openocd.cfg file. Thank you very much for this new/restored functionality!

@karlp karlp closed this as completed Jan 29, 2025
Copy link

Thanks for using our extension! 🚀

Your feedback matters! Could you take a moment to rate it on the marketplace? A positive rating helps other developers discover our tools and motivates us to keep improving.

⭐ Rate ESP-IDF Extension: https://marketplace.visualstudio.com/items?itemName=espressif.esp-idf-extension&ssr=false#review-details

Your support means a lot to our development team!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature / Enhancement Request Request for Feature/ Enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants