using the usb serial / jtag interface with esp-idf

bram128
Posts: 19
Joined: Fri Dec 20, 2024 3:41 am

using the usb serial / jtag interface with esp-idf

Postby bram128 » Fri Mar 21, 2025 4:40 pm

I have an esp32s3 based board that I have designed to use the serial port build into the usb serial jtag module. IE, there is no separate usb to uart chip like most development boards have. My issue is that none of the standard idf commands, like idf.py flash, work, because the toolchain does not issue the correct reset signals to put the bootloader into download mode. If I look at the esptool.py command lines that are created, they all contain "--before default_reset". However, to correctly reset the board using the usb serial jtag interface, this needs to be "--before usb_reset"

I have tried modifying the sdkconfig to use usb_reset, but somewhere in the build process this always gets switched back to default reset. This makes development work a lot more difficult because I have to run all of the programming steps using custom esptool commands. And some of the higher level scripts dont seem to support passing the "--before usb_reset" argument down to the esptool command that is ultimately generated.

Does anyone know how to configure the toolchain to use usb_reset instead of default_reset?

bram128
Posts: 19
Joined: Fri Dec 20, 2024 3:41 am

Re: using the usb serial / jtag interface with esp-idf

Postby bram128 » Sun Mar 23, 2025 12:27 am

does anyone from espressif actually monitor this forum??

Sprite
Espressif staff
Espressif staff
Posts: 10593
Joined: Thu Nov 26, 2015 4:08 am

Re: using the usb serial / jtag interface with esp-idf

Postby Sprite » Sun Mar 23, 2025 1:00 am

We do, but 1. it's the weekend and we don't run a 24/7 helpdesk here and 2. we actually don't run a helpdesk at all, this is a community support forum where engineers tend to hang out if they have bandwidth but you're not guaranteed a response from Espressif people.

bram128
Posts: 19
Joined: Fri Dec 20, 2024 3:41 am

Re: using the usb serial / jtag interface with esp-idf

Postby bram128 » Sun Mar 23, 2025 3:04 am

well, since you are here, would you mind answering the original question?

Sprite
Espressif staff
Espressif staff
Posts: 10593
Joined: Thu Nov 26, 2015 4:08 am

Re: using the usb serial / jtag interface with esp-idf

Postby Sprite » Sun Mar 23, 2025 12:35 pm

So, I just told you that the engineers here have the freedom to answer questions on their accord, both when and if. You respond by still asking me to do actual work on my free Sunday. That is a bold choice.

Anyway, I can assure you that 'doing the work to be able to answer your question' has found a place on my list of priorities.

bram128
Posts: 19
Joined: Fri Dec 20, 2024 3:41 am

Re: using the usb serial / jtag interface with esp-idf

Postby bram128 » Mon Mar 24, 2025 2:14 am

This seems like an unreasonable amount of aggression. I didnt ask you to work on a Sunday. I didnt insult you. I have posted a handful of questions over the course of months and never had a response response that was helpful and I have read tons of posts that go unanswered. That being the case, its pretty reasonable to ask the community if espressif engineers monitor the forum. I legitimately need to know if I can expect to get help here or if I am wasting my time. Apparently its the latter. Thanks for clarifying that.

MicroController
Posts: 2661
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: using the usb serial / jtag interface with esp-idf

Postby MicroController » Mon Mar 24, 2025 6:13 am

Yeah, that's the internet for you. Lots of room for misunderstandings when all you have is a few lines of text to communicate.
Your question doesn't seem too easy to answer. I tried figuring out where that "default_reset" comes from in the IDF; couldn't find it. And it's not in the docs, so I guess even some Espressif devs will have to do some digging and phone calls to find if&how this is supposed to be controlled.

In the meantime, you could do what I do, which is just creating a flash.bat in the project which runs esptool.py with all the arguments you need (no need to flash the same bootloader and partition table each time...). After a build, I switch over to the terminal and run flash.bat & monitor.bat. Works nicely, and for me even more quickly than managing the different terminals in VS code.

bram128
Posts: 19
Joined: Fri Dec 20, 2024 3:41 am

Re: using the usb serial / jtag interface with esp-idf

Postby bram128 » Mon Mar 24, 2025 6:40 am

I have done that for simple operations. However, its not really practical for experimenting when you dont exactly have a process nailed down. Also, some commands like parttool and some others ( i dont remember atm) dont handle the --before argument correctly.

The weird thing is it does work in vscode because you can select the type of serial connection there. Despite this, I cannot figure out how vscode feeds this info the tooling. I have a need to be able to do this from the command line so just using vscode is not practical for me either.

MicroController
Posts: 2661
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: using the usb serial / jtag interface with esp-idf

Postby MicroController » Mon Mar 24, 2025 8:22 am

I have an esp32s3 based board that I have designed to use the serial port build into the usb serial jtag module. IE, there is no separate usb to uart chip like most development boards have.
Btw: Not sure what the problem actually is, because for me all tools (both in VS code and on the CLI) work just fine out-of-the-box via the USB-JTAG connection. - Do you use the USB(-serial) inside your application?

bram128
Posts: 19
Joined: Fri Dec 20, 2024 3:41 am

Re: using the usb serial / jtag interface with esp-idf

Postby bram128 » Wed Mar 26, 2025 4:01 am

no, i dont touch the usb device in the application.

I know exactly what the problem is. Dev boards include a little usb to uart chip that drives the boot and EN pins using its RTS and CTS outputs. This configuration is known as "default_reset" in the toolchain, and as the name suggests, all the command lines generated by the toolchain include "--before default_resest" to reset the board and kick it into the bootloader. The USB / JTAG peripheral is also capable of generating the correct reset behavior but only when "--before usb_reset" is used on the CLI. I cant figure out how the toolchain configures this and I have spent hours trying. I am guessing its just hardcoded someplace.

Who is online

Users browsing this forum: Amazon [Bot], Qwantbot, Semrush [Bot] and 19 guests