How to use the PlatformIO debugger on the ESP32 using an ESP-prog

  Рет қаралды 70,940

Brian Lough

Brian Lough

Күн бұрын

Пікірлер: 62
@ivankravets
@ivankravets 4 жыл бұрын
Dear Brian, thank you so much for the amazing and useful video tutorial! We added it to our video collection and our documentation. We hope to see more videos about PlatformIO. They are very important for our Community!
@MrNams
@MrNams 3 жыл бұрын
Is it limited only to ESP32? Can we use it for debugging Arduino, ESP8266?
@kmomberg
@kmomberg 2 жыл бұрын
@@MrNams I do know you can also use it to debug ESP8266. You need to check if the especific Arduino MCU you're using has JTAG support.
@bertieblob3387
@bertieblob3387 4 жыл бұрын
Finally got an ESP-PROG. Searched KZbin. Found your Video. Now I’m all set to go. 🙂 PlatformIO should be grateful. You provide a clear and concise guide that they probably don’t have the time to produce, or that Espressif can even be bothered to provide. Better even than that guy with the the Swiss accent - who I also subscribe to. 👍🏼 Many thanks.
@UnexpectedMaker
@UnexpectedMaker 4 жыл бұрын
That's awesome! I really need to give PlatformIO a go.
@user-si2vn2si5c
@user-si2vn2si5c 10 ай бұрын
epic tutorial... really sped up the process
@TheTinkerDad
@TheTinkerDad 4 жыл бұрын
Not sure how, but I've missed this video and just watching it now. PlatformIO is something that I've been eyeing with for a long time, but I haven't yet tried, so this vid is pretty cool to see.
@jon_raymond
@jon_raymond 4 жыл бұрын
Very helpful! Thanks for the detailed walk through.
@chriscollins508
@chriscollins508 Жыл бұрын
Nice and clear and to the point. Very helpful. Thank you.
@exploringgodscountry
@exploringgodscountry Ай бұрын
Thanks man! Got it working :)
@BoazFeldbaum
@BoazFeldbaum 3 жыл бұрын
Very helpful tutorial, thank you! I confused VCC with 5V and mistakenly connected VCC from esp-prog to 5V on the ESP32 dev board. It took me a while to realize that VCC is 3.3V. Luckily none of the boards burn. Actually the VCC line should not ne connected at all. I connected both esp-prog and esp32 dev board to the micro USB connectors, so they both get power from USB and then only connected the ground of both boards. Not sure that connecting the grounds is necessary because it is connected through the USB, but I connected them anyhow. Then eventually I was able to debug. I find the debugger very useful but I got various problems that I don't know yet how to overcome. The most annoying problem is that at some point the debugger stops going in "step over" mode and always doing "step into" even if I hit "step over". I still have a long way to go to master this tool, but it seems worth making the effort. Thanks again!
@kissingfrogs
@kissingfrogs 4 жыл бұрын
one of my most favorite uploads yet, some great info. 332
@insanismantelli
@insanismantelli 3 жыл бұрын
Nice tutorial. Well done. I had some trouble with missing libraries and could not start debug. I checked them at the debug console after hitting f5. After I installed them in the terminal, everything went fine.
@spencerbentley8852
@spencerbentley8852 2 жыл бұрын
Great instructional vid, I've linked to it in my ebay store 👍
@ianhewitt1858
@ianhewitt1858 2 жыл бұрын
Brian, nice clear video and I will have debugging working in a fraction of the time it would have taken me to get this inofrmation on my own. You mention that when the board is connected that sometimes it dosn't load. I have this promblem on one of my boards without anything attached. If I place a 2.2 / 3.3 microfarad capacitor from GND to EN port the problem goes away. It may be that the capacitence of the enable pin is changing when it mounted, or it could be something completley different. It may be worth a try though and if it sorts out the issue, all good. Thanks for the effort you put in.
@jackmanjls
@jackmanjls 3 жыл бұрын
BEWARE...If you refer to Zadig::USB ID..The hexadecimal numbers 0403 and 6010 are the USB vendor and product ID of the FT2232HL chip and OpenOCD looks for them. Unfortunately, the FT232H chip has the vendor/product ID 0403/6014.
@rakithadealwis8468
@rakithadealwis8468 3 жыл бұрын
thank you for the video Brian. I can confirm that upload via JTAG works. However I found putting "build_type = debug" and "debug_init_break = tbreak setup" ini file caused me issues. So I recommend not putting them in at the start. Then work your way from there.
@yahmk3978
@yahmk3978 2 жыл бұрын
Thank you!
@MikesTropicalTech
@MikesTropicalTech 3 жыл бұрын
Would be great to show the exact wiring setup during upload and debug. It's not clear from your video but I figured it out from reading comments below. Thanks!
@cthoadmin7458
@cthoadmin7458 4 жыл бұрын
Immediate subscribe! Just getting into esp-idf now, and am working with Eclipse. Believe there an Eclipse plugin for ESP-Prog.
@yancymuu4977
@yancymuu4977 3 жыл бұрын
Brian, thank you for the great tutorial. I am having problems getting the debugger running. When I connect TDI to GPIO 12, the code won't upload. Do you know how I could fix this. I already did the update that you recommended in video.
@xmine08
@xmine08 Жыл бұрын
Man is that complicated on Windows. Mind boggling how people are actually productive on this platform as developrs.
@MatSmithLondon
@MatSmithLondon 3 жыл бұрын
Tanks for this guide. Do you think JTAG debugging will be useful for figuring out problems with a sketch half crashing after 6-24 hours of running? (By half crashing I mean, serial monitor and MQTT messages stop sending, but web interface continues to work.)
@JorgeSilva-em8pf
@JorgeSilva-em8pf 4 жыл бұрын
Dear Brian. If the Debugger is running, is it possible to see some variable running too at the left tab "watch"? Or ALWAYS, in this condition, the variable content would be "not availabre as has showed in your video? Regards.
@shaivalnagarsheth3257
@shaivalnagarsheth3257 3 жыл бұрын
PLease reply to this comment? It is very important to see the Run Time status as well, rather than pausing every time we want to watch a variable.
@bennguyen1313
@bennguyen1313 2 жыл бұрын
The ESP32-C3 (Single Risc-V Core) shows it has JTAG/USB support, but can it also be debugged using PlatformIO and even VSCode? Or would the C3 need to be flashed with something that enables SWD debugging? BTW, in terms of debugging, any thoughts between VSCode and Visual Studio + VisualGDB ?
@keen2461
@keen2461 4 ай бұрын
Replacing the driver for WinUSB no longer works on Win11. Anyone knows a workaround.?
@michaelcaoun6919
@michaelcaoun6919 2 жыл бұрын
It looks like you don't sell a ESP32 DevKit V1 debug shield? I just made one with a protoboard but I'd rather have a more permanent smaller form factor version.
@baxter6504
@baxter6504 2 жыл бұрын
Hi, Brian. I am running by VSCode/PlatformIO on Ubuntu (version 20.04 LTS). Are there any difference in instructions for Linux (except for serial port names)?
@kiromaisus
@kiromaisus 3 жыл бұрын
You should have explained when to plug each board, and also that it needs both plugged to make it work!
@peterdirnhofer6777
@peterdirnhofer6777 Жыл бұрын
Thank you Brian, verry helpfull. My experience is, that the hardware setup, especially the connection is very critical. Starting the debugger only worked reliable, when i used very short cables betwenn ESP32 and the debugger. That means: Only direct and short connection with single Dupont cables (10 cm) worked for me. On the other hand, a self-made adapter cable (15 cm) with an IDC connector on the debugger-side and Dupont connectors on the ESP32-side did not work reliable. I have not looked at the specification of the JTAG interface. But I can imagine that there is a timing problem with too long cables. Do you know, if there is a possibility to reduce the JTAG speed to make the communication more robust? I also suspect that the problems during downloading the program via the USB interface are related to the cable length at the JTAG port of the ESP. Maybe the port catches interference via long cables.
@ahmedwahdan672
@ahmedwahdan672 3 жыл бұрын
Why ESP has only two breakpoints? How to debug internal peripherals? Using native IDF SDK not Arduino like SDK.
@shaivalnagarsheth3257
@shaivalnagarsheth3257 3 жыл бұрын
How to use the serial port via esp-prog? what settings are needed in platformIO.ini?
@kieran.stafford
@kieran.stafford 4 жыл бұрын
Brian, many thanks for the video. It's unclear how things are connected. Do you plug both devices into your computer via two separate USB cables? or are you just connecting via a single USB connection through the esp-prog ?
@BrianLough
@BrianLough 4 жыл бұрын
Hey Kieran I've been using two cables, but I think 1 should be ok. Once the code is uploaded, you could plug out the esp32 and plug in the esp-prog. The esp-prog even supplies 3.3v Another commenter mentioned that you can upload via the esp-prog too, but I've never tried it
@aspenmallery
@aspenmallery 3 жыл бұрын
Disclosure: The pinout for the ESP32-S2 board is different. In my testing, you MUST have both boards connected for debugging to work (shame, thought you could upload over jtag). TDO: GPIO40 TDI: GPIO41 TCK: GPIO39 TMS: GPIO42
@bitluni
@bitluni 4 жыл бұрын
First
@aspuzling
@aspuzling 4 жыл бұрын
Is it possible to upload your program to the ESP-32 using the ESP-Prog? It would be nice to only need one USB cable connected to my computer.
@pankajcooldudeful
@pankajcooldudeful 3 жыл бұрын
You can. Set upload_protocol = esp-prog
@MikesTropicalTech
@MikesTropicalTech 3 жыл бұрын
@@pankajcooldudeful Sir, you won the Internet today. I've been trying to get my new ESP-PROG to upload the code and this is the first time anyone has ever mentioned this. My eternal gratitude.
@shaivalnagarsheth7229
@shaivalnagarsheth7229 3 жыл бұрын
@@pankajcooldudeful Then do we need to set the COM port again to the ESP-Prog one?
@jenskaa4044
@jenskaa4044 4 жыл бұрын
You can also upload thru the jtag. Its Just a shame that its so slow to compile the debug version
@ivankravets
@ivankravets 4 жыл бұрын
You need to switch the project to `debug` profile ( docs.platformio.org/en/latest/projectconf/build_configurations.html ) . Otherwise, PlatformIO will automatically rebuild your project from "release" into "debug" with each debugging session.
@MikesTropicalTech
@MikesTropicalTech 3 жыл бұрын
@@ivankravets Thanks, you saved me a ton of time!
@FreedumbHS
@FreedumbHS 4 жыл бұрын
I may be missing something obvious, but can't the ESP-PROG power the board to be debugged via the pin you colored red (VCC), meaning you wouldn't have to connect the board itself via USB at all?
@BrianLough
@BrianLough 4 жыл бұрын
Power wise yes, I was connecting both so I could program the board via USB. People have mentioned since it can be done via esp-prog using JTAG but I have never tried it
@FreedumbHS
@FreedumbHS 4 жыл бұрын
@@BrianLough Wow, I didn't expect to get a reply to this within the hour! Cheers, thanks a lot for this video and your quick reply. Did you notice any issues with your ESP-PROG clone? Amazon.de does list one genuinely manifactured by espressif, but not sure if it's worth the extra cost
@andressantiagoduqueescobar5187
@andressantiagoduqueescobar5187 2 жыл бұрын
Brian, thanks a lot for this tutorial. Now, I want to share with all of you a little experience that I had when I tried to start the debugging process: This process just didn't start and the debugger console said me that the problem was an error in GDB and OpenOCD settings... After searching for a long time, finally I could found someone who gave me the answer ( kzbin.info/www/bejne/nKeyq6OBf75lna8 ) and this answer is unexpectedly simple: REMOVE THE JUMPER FROM THE IO0_ON/OFF PINS when you want to use the JTAG port of the ESP-Prog. I hope this information can save time for someone with the same problem
@jonathan-._.-
@jonathan-._.- Жыл бұрын
shouldnt it be possible to just turn another esp32 into a probe 🤔
@bhseshu
@bhseshu 4 жыл бұрын
that's very helpful can you do same with jlink
@Leoninmiami
@Leoninmiami 4 жыл бұрын
it would be great if your debug boards were also expansion boards ... even if a basic one.
@Chupacabras222
@Chupacabras222 4 жыл бұрын
Those 2 links for ESP-Prog are the same.
@BrianLough
@BrianLough 4 жыл бұрын
Whoops! Thank you for letting me know! The link to the one I bought is wrong, I'll fix it in a few minutes, but here it is #Aliexpress US $18.00 | ESP-Prog (JTAG Debug & Program Downloader) a.aliexpress.com/_dUyYZGo
@douglaskennedy7707
@douglaskennedy7707 7 ай бұрын
I would do a back before doing anything. There is a reasonable chance this will corrupt a Windows system. I lost all keyboard use and had to restore from a restore point and after recovering the system VS studio code would not launch and it required a reinstall of VS. I suspect the drivers that are suggested for download are defective and the lists of drivers don't match those in the video. 2/9/2024 Just be very careful!
@cbgaming3174
@cbgaming3174 4 жыл бұрын
I spammed my keyboard an this video came up.
@Popart-xh2fd
@Popart-xh2fd 2 жыл бұрын
*Doesn't work with Arduino Nano!*
@foxabilo
@foxabilo 2 жыл бұрын
Well, as it's not made for the Nano but a different chip entirely, that's not surprising.
@dieboodskapper
@dieboodskapper 2 жыл бұрын
Your vid is a bit deceiving. You start of by creating the impression that you only need the JTAG interface but then casually plug in the USB bridge programmer like its no small matter at all. What you should have said is that you need RX0/TX0/EN/BOOT plus JTAG signals on top of that to accomplish this task. I found this to be extremely annoying since if you design a project with RX0/TX0 used for a product interface you are pretty much plucked since you will then have to hack RX0/TX0 lines in order to download code and not cause a meltdown
@foxabilo
@foxabilo 2 жыл бұрын
Not so, you can upload code via the JTAG.
@dieboodskapper
@dieboodskapper 2 жыл бұрын
@@foxabilo wow....I will have to investigate that - thx!!!
#363 Which ESP32 pins are safe to use?
11:53
Andreas Spiess
Рет қаралды 129 М.
#261 ESP32 Line-by-line Debugging - works with many ESP32 modules
21:21
Just Give me my Money!
00:18
GL Show Russian
Рет қаралды 1,1 МЛН
Or is Harriet Quinn good? #cosplay#joker #Harriet Quinn
00:20
佐助与鸣人
Рет қаралды 49 МЛН
У ГОРДЕЯ ПОЖАР в ОФИСЕ!
01:01
Дима Гордей
Рет қаралды 7 МЛН
A very comprehensive ESP32 Debugging Guide.
12:21
J's e-shack
Рет қаралды 12 М.
REAL Debugging Arduino + ESP32 | JTAG Programmer
9:05
Electronoobs
Рет қаралды 19 М.
Debugging the Arduino Uno or Nano! (No extra hardware needed!)
6:59
Cheap and Easy to Use ESP32 Screen!
8:21
Brian Lough
Рет қаралды 138 М.
Get started with PlatformIO and the ESP 32
9:17
John Green Dev
Рет қаралды 3,9 М.
C++ Debugging for the ESP32 in Visual Studio
13:46
Dave's Garage
Рет қаралды 70 М.
ESP32 CAM - 10 Dollar Camera for IoT Projects
29:39
DroneBot Workshop
Рет қаралды 771 М.
The Essential Details of ESP32 Hardware Debugging
37:30
Mike's Tropical Tech
Рет қаралды 10 М.
Bare metal GPIO driver for ESP32 | Toggling an LED
12:43
The EV Engineer
Рет қаралды 8 М.
Just Give me my Money!
00:18
GL Show Russian
Рет қаралды 1,1 МЛН