Straight forward, no additional hardware, no BS. Debug your Arduino Uno or Nano (almost) out of the box!
КОМЕНТАРІ: 138
@jse-shack8253 місяці тому
A little correction/notice: The debugger shown here is not a "true" hardware debugger, but an instance of GDB in combination with a little mediation program on your Arduino called a "stub". This means that a small portion of your uploaded firmware is only there to establish a connection between your internal program states and the serial terminal. This explains why starting the debugger is part of your code (see debug_init()) whereas a "true" debugger would manage all attachments to your chip from its own peripherals. You could say, the firmware is "aware" of the debugging when using a stub. This also means that a bit of memory will be inaccessible to you, because the stub needs it. If you were to upload a program that uses every byte of memory, you wouldn't be able to debug your program anymore, so keep that in mind. And even more so, since the stub uses serial, any printing won't be available. Happy debugging!
@bijavixРік тому
I've been programing microcontrollers with arduino and platformIO for YEARS, but I wasn't even aware this could be posible to do. Also, great video, keep up!
@MrDelta22Рік тому
This video deserves a lot more views. Alone his presentation skills are pure gold and very entertaining.
@Aj0nJonРік тому
As much as I hate UKposts algorithms as well as this platform, this time I was absolutely blessed with coming across this video. Thank you my dude! For quite some time I was thinking about using some normal IDE for Arduino projects, but was too lazy to actually look it up.
@youtubegoogle4163Рік тому
Such a great channel providing simple and useful knowledge... Feeling good to be your 23rd subscriber. You have my support ❤️, Please keep making videos like this. 🔥
@caper585 місяців тому
A minute into your first video and I hit the subscribe button. Love your comunication skills, just the right amount of humor and explaination speed. Some of these you-who-tube creators talk sooooo slow... I guess they don't think I can hear very fast. You're awesome and thanks for posting!!
@VlasovDevРік тому
Just got recommended this video, wish you luck in your youtube journey!!
@danwisslerРік тому
You made my day!!! Was just about to spend some more money for a EDBG device. Now I can afford to buy more tea... GREAT
@edsonlunyiliko6648 місяців тому
I like your presentations a lot!
@MrKYT-gb8gsРік тому
Like your style. Hope this channel becomes big.
@RafaelKarosuoРік тому
Excellent!, thanks for asking the hard questions, why isn't anybody talking more about this?
@bdureau1Рік тому
Excellent mate. You have talent please make it your daily job !!!!
@4000philРік тому
short and to the point, that's the way I like it
@fberron4 місяці тому
Bless Jdolinay, and Bless you. It's amazing!!! I need it that! Thank you
@andrewwatts1997Рік тому
Stepping through your program and adding breakpoints is a great start. But where do I view register contents, flags, timers etc etc ?
@nobytes26 місяців тому
You need a hardware debugger, this video shows a software stub debugger.
@sviatoslavzapolskyi79866 місяців тому
on left hand side in middle you can see WATCH section, you can add PORTB PORTC or some other variable you want to see
@sviatoslavzapolskyi79866 місяців тому
As mentioned this is not real debug but software emulation of debug. Arduino cpu doesn't stop on breakpoints, and timers continue to count and no sence to try to watch timers. You can not debug your code that depends on timers count in this way. The solution could be, e.g you can mock millis() function in a way that it returns variable that is incremented each time when loop() function returns. So you can debug your code that call millis() function
@fjdarling8 місяців тому
Personality plus Mr. J's. Interesting programming direction using Visual Studio Code and Platform IO. You have my attention J. I might just try it. Thanks.
@athotuan17587 місяців тому
Thanks for sharing this
@zacharyrowden76927 місяців тому
damn who would have thought I'd be genuinely laughing while watching an arduino debug tutorial 🤣subscribed
@jmendowski6 місяців тому
Best arduino tutorial ever 😂😂😂😂😂😂😂 You nailed it mate. 🎉
@Gengh13Рік тому
I wasn't aware of this, I'm not using the nano much lately because for a similar price there are far more capable alternatives but it is definitely a nice tool to have.
@ArtOfTheProblemРік тому
what do you recommend? I just got started and I think I burnt my first nano on day 1
@Gengh13Рік тому
@@ArtOfTheProblem the "blue pill", ESP8266 or Esp32. All of them are cheap, available and far more capable than the nano.
@wojciechbajonРік тому
@@ArtOfTheProblem don't touch ESP8266. Of course you can use it if you know his big disadvantages... If you wan cheper option try Esp32-s2 in D1 style or esp32-c3 Mh-tiny. But for very beginig Esp32 NodeMcu compatibile board is best. BTW: WROWER version (with PSRAM) allows you use different programming languages (python, PHP, ...)
@wojciechbajonРік тому
For costless debugging I am ready to pay more.
@ArtOfTheProblemРік тому
@@wojciechbajon thanks i'll give it a try, any other advice on IDE etc? (i'm doing with kids)
@yhungpРік тому
The most useful video I've ever seen, thanks 🤩🤩🤩🤩🤩🤩
@pizzahut3001Рік тому
I'm glad it wasn't just me. I recreated exactly the start of this video just scrolling through google results trying to find some sane guide on how to debug and getting nowhere...
@todomecatronicaРік тому
Gracias !!! Realmente lo adoré !!! Gran Vídeo !!!
@IamTheHolypumpkinРік тому
While I do own an hardware debugger aka the atmel-ice with J-Link on backorder for a year now. This an easy way to debug for smaller projects. For a very complicated I wouldn't chose avr stub.
@bruno_ricciРік тому
Great! I've developed a whole project without knowing this was possible. As I got my UART port busy -which was my board main communication channel with other HW modules- I had to use a separate arduino as SPI-UART gateway, and sending those kind of "enter function 1!!!" "enter if" "enter else" texts over the console. Having known this, probably i'd have chosen another way of communication, freeing the UART for debugging. I also wonder why this is not ~basic primitive~ stuff along Arduino community! How can a novice learn without debugging? Thanks again for sharing this information.
@robertjohnson4089Рік тому
i hve tried using platform iio before ill try it again thanks for video
@Xavus-137Рік тому
Just getting started , I don't know what he was doing but sounds cool
@willibaldkothgassner4383Рік тому
Thank you, is a big help to me!
@priyamgangulyРік тому
Great thing. The debugger is especially important for beginners who are struggling with trying to understand the internal intricacies of how Aduino works.
@dimitrioskalfakisРік тому
good presentation. sure, it works great with simple projects, standard libraries and standard cores but using it with complex projects fails more often than not and the configuration settings are a mesh.
@jse-shack825Рік тому
That is true. As far as i understand this debugger is a bunch of bitbanging over the serial connection, which is very error prone, especially if the clock speed is high and the usb cable is long. Nevertheless, if you are planning on building a large project, you should consider moving away from Arduino anyways. STM for example has a great debugger. Works with the Arduino Framework as well.
@dimitrioskalfakisРік тому
@@jse-shack825 10Q for the response. I have used STM products; their documentation is cryptic and their tools non intuitive. I have resulted in 'adopting' raspberry pi pico for my needs (i develop rpn programmable calculators) 'cause it is cheap and well documented. i love it. keep it up :-)
@techmakerandhacker7867Рік тому
amazing thanks for the help
@TrevorMakesРік тому
I spent 20 years learning C++ so I could debug it in my head, when I could have just done this.
@alanhermosillo8176Рік тому
36 subscriber, what a wonderful video :D
@felipevellasco652610 місяців тому
I think you just saved my life.
@DizintegratorРік тому
There's one hidden problem with this approach: is that it uses serial. Yes, the same serial many use to print out stuff or for communication with PC. So in case you need to debug and print to serial you will need a second arduino in passthrough mode (reset shorted to ground) and a bit of config definitions in platformiotxt.
@cbs1710Рік тому
Whoa, there! Could we get some more info on how to accomplish all that?
@DizintegratorРік тому
@@cbs1710 Its relatively easy - you get the board you want to debug connected normally to PC via usb, then you take a regular uno and short reset pin to ground (effectively bypassing any sketch and processor it has), then connect it to the first board by pins 0 -> 0 and 1->1 (mine has them labeled rx to rx and tx to tx) and connect it to PC too via its respective USB port. In the end both boards should be connected to pc. After that you tell PIO to use first USB port to upload and second to debug. I think there are step-by-step guides you can google for it.
@JohnDoe-el5ir8 місяців тому
you don't have to. You can use second serial port and use serial port dongle on PC. I did it first time I discovered these limitations
@georgeboydratcliff1036Рік тому
What a great video ..... but never once have I managed to make this work! I'm on a Mac, I might try on a PC in case that's the problem!
@emaayanРік тому
trying it now on a pc , getting .pioinit:13: Error in sourced command file: COM17: No such file or directory.
@jaydonovan4723Рік тому
@@emaayan on silicon mini and don't get any errors, but nothing happening (blink merrily continues blinking despite having a red dot next to "delay(1000);" . I'm new to VS Code and PlatmorIO but good with embedded systems in general. Is there anyone willing to work with me on replicating on MacOS?"
@GaryMarkowskiРік тому
@@emaayan There are two reasons (maybe more) for this error message. 1) Ensure the COM port you specified in platformio.ini specifies the correct COM port that your Arduino is connected to. 2) If you happen to be using the ELEGOO version of the Arduino NANO, then this debugger won't work on this device. The ELEGOO version of the NANO uses a CH340 serial communication chip instead of the official Arduino FT232 chip. It does work on the ELEGOO version of the Arduino UNO.
@fjalarsigurdarson4862Рік тому
Macs often have trouble connecting to nano clones
@AJ-pg6pt8 місяців тому
Very nice but a couple HUGE catches - serial port conflict mentioned previously AND breaks in SETUP are INGNORED. Inching closer to Atmel Studio every day
@iam50852 місяці тому
Amazing. Can I do c# too, or is that too much to ask?
@m3chanistРік тому
It's an ant, not an alien. Originating with the author, Ivan Kravets and his work with SmartAntHill.
@TFlorianРік тому
hwy ? May be due to the footprint in the memory for debuginf stack .. But it's is very interesting tool set
@chrisalexthomasРік тому
That is remarkably simple. I thought you'd need to get one of those extra serial debugger modules to do this. I had no idea it would work out of the box. I wonder how many other devices you can do something similar with?
@nobytes26 місяців тому
avr-stub is a software debugger, in most serious situations you would need a debugger like j-link. This is shown in the video in the arduino ide 2.0 features.
@josephchamness9915Рік тому
How many resources (flash & ram) does it use & can you look at vars, registers and the ASM?
@Farcraft2Рік тому
pretty cool bruv 👌
@raffyturc10 місяців тому
thank you! I need to use this debugging naw 😊
@nWestieРік тому
The 'So install this super useful library by *struggle to pronounce name*, anyways bless him' pretty much describes the entire open-source communinty
@pinnaclesystemsgroup6472Рік тому
Very cool ... thank you
@drulli12 місяці тому
Hi, a breakpoint is usually used to read out the content of some variables, to understand where a mismatch in our coding is coming from. Can we monitor the value of variables with this "debugger-like" tool? I guess not..
@MhLiMzРік тому
Toller Tipp, klasse Video. Vom Erzählstil her ein wenig wie Marti Fischer. Gefällt mir :-)
@jse-shack825Рік тому
Der war definitiv der Held meiner Jugend😄
@jimsnodgrass845411 місяців тому
Will this debug work with ESP32 based chips & dev modules? I'd like to hear more about using it with these ESP devices ( if it's even possible) .
@alexfish7792Рік тому
You're actually really funny. Love it. 3:59 😂
@jetamgamerРік тому
Hi! So.. i have a question. In the first step you said to take arduino ide and throw it out of the window. How can i do that? i mean, i guess i can take apart my ssd and find where arduino files are, but i dont think that is the best idea.
@jawadtahmeed9854Рік тому
How to setup the DUE for debugging?
@bhupendersingh26044 місяці тому
how can we debug stm32 microcontrollers
@user-zn9op3ti6g18 днів тому
you remind me of one of the hackers from the film skyscraper on netflix
@tgirard123Рік тому
Just boards with the 328 chip? Is there a way to use platform IO with other boards and get debugging? That's pretty freaking limiting...
@miguelangelquerocorrales4214Рік тому
Thanks for the amazingly simple tutorial and the bits of comedy =P. If anyone is looking at this tutorial trying to use the same process to debug a Seeduino Nano device, you have to change the "env:" and "board =" fields to "nanoatmega328new" Also, if you are getting some issues with entering debug mode concerning "libncurses.so.5", just run this on your terminal: "sudo apt-get install libncurses5"
@gamingSlasher5 місяців тому
Have started with esp32 and do not know much about arduino but how common is that ATmega328?
@MS-fp5jqМісяць тому
would this work with expressif nano esp32?
@davidhergueta200010 місяців тому
Do you know if there's a tool to debug Arduino Nano 33 BLE? Cuz the microcontrolller it uses is not an AVR so I can't use this tutorial :(
@tematoscybersage56264 місяці тому
thx, looks like cool. But does default debugger so bad? *find answer* it is strange, but it is not default feature of MC, you need or external debugger device, or MC with built in. Really strange, because there are all capabilities for communication. Anyway, that arduinos that has ESP32 has this ability in WIP, so I hope it will be able soon.
@JohnDoe-el5ir8 місяців тому
Quite cool, but it is still some kind of BS but not that big as Arduino IDE. Solution to this is to buy Pickit4 or Snap or ICD4 and import arduino project to MPLABX. Works very well on ANY atmega. Of course compiled program doesn't have bootloader anymore, unless you specify proper memory offset for compiled binary, to preserve that bootloader area and load bootloader binary during flashing as well. That way you can go back to Arduino IDE if needed. Or you can wipe bootloader and then restore it with programmer.
@maximus6884Рік тому
How do we install libraries?
@denzee1Рік тому
There's a new arduino ide that comes with a debugger. I was hoping that the video was about that. Good video btw i leave at thmubs up
@kristoffersunnhordvik759020 днів тому
"Don´t be scared if you see this. Run.." (6:12)
@user-rk9py5cp2q14 днів тому
anyway, this is f** amazing, thx bro👍
@pascalcuzon94113 місяці тому
Hello , very interresting and simple. But it's Ok for your UNO or NANO. Do you have an example idem For ESP32-S3 witch include Board JTAG ? Thank You Very Much
@jse-shack8253 місяці тому
Not sure if it applies to the S3, but I uploaded a video yesterday which deals with exactly that: ESP32 debugging
@briannielsbergh9 місяців тому
Can you inspect variable values, if not, it's kind of useless?
@arlievsky10 годин тому
could it be made to work with uno_r4_minima ? or do you know any software-only alternatives for this board?
@kebabsharif9627Рік тому
Hello , i'm getting the following error: vs code could not find the specified task please help.
@yayserРік тому
Wow thats amazing. I actually came across people saying there is no debugging available for arduino uno or nano. How come is this thing even possible?
@marcelobenitezabcРік тому
Is there a miracle chance that it works with esp32?
@microlatinamicrocontrol124011 місяців тому
Such an excellent explanation. Maybe you could guide me on this problem: Error: Could not find the package with 'jdolinay/avr-debbuger @ ~1.4' requirements for your system 'windows_amd64' .... and so #include's #include #include fail . Thanks anyway ! Greetings from Buenos Aires.
@catto8816 днів тому
you made an error - debugger, not debbuger, that's why.
@antoniodomit2782Місяць тому
This looks great. but I haven't been able to make it work. It compiles well. Uloads well and the it says .pioinit:13: Error in sourced command file: COM9: No such file or directory. Can you help me? Thank you
@catto8816 днів тому
change COM9 to your own port...
@inktonРік тому
Excellent presentation! How can you NOT subscribe?
@grapes0084 місяці тому
The only time that i have needed debugging like this was on an arduino mega (about 3 years ago). I have adopted putting serial prints into #ifdef debug with a #define debug to make it easy to disbale and enable anything used for development by commenting out the #define. the other nice thing about this, is it allows you to have multiple types of things sent if you have mulitple #define for various things. So you need data for calibration #define calibrate - then put the serial prints inside of an #ifdef...#endif. Need debuging type stuff, uncomment #define debug. Neeed calibration, uncoment that. need both - you know what to do.
@brendon5553Рік тому
Nice
@herrusulis93603 місяці тому
Can use the same debugging tools for ESP32 (Arduino framework)?
@jse-shack8253 місяці тому
Definitely NOT, but the ESP-debugging video will drop in a few days, stay tuned!
@haithamsungkar26832 місяці тому
Can't wait to see how to debug ESP without hardware 😃 Please let us know if the Video is uploaded
@JeanDAVID4 місяці тому
What about ESP32 or ESP8266 ?
@Karl_LevineРік тому
Haha nice video.
@hurbawoo9 місяців тому
An error occurred like "COM11, No such file or directory" I solved the problem by changing "COM11" to "\\.\COM11". Thanks for helpful video.
@z3my4l2 місяці тому
What about variable values?
@user-ms3id7jv7v2 місяці тому
Visual micro is better
@yabincheng4171Рік тому
Crazy
@eglintonflatsРік тому
...."Nobody is talking about it"... Because adults in the room use J-link (J-tag) instead which affords a boundary scanner as well. Once you use it you will never want to go back.
@jse-shack825Рік тому
"Adults in the room" probably won't even use Arduino, let alone watch this video. The brackets in the title are there for a reason. Many novices get a classic Arduino model and find out about debugging sooner or later and then get let down by the fact that their device is not debug-ready out of the box without additional hardware. This video tells people about a free and easy to use debugger for exactly these 2 beginner models. As flawed and slow as this debugger is, it is far more approachable for novices than a +500$ J-link probe they a) know nothing about yet and b) most likely can't afford.
@BinderTronicsРік тому
@@jse-shack825 This "adult" is very amused by your videos. You can get a J-Link EDU for around $60 (current pricing). For ARM based chips there is also DAPLink debuggers available, even cheaper. This method is much better in terms of upfront cost. @eglintonflats Wat on this earth will a entry level want with a boundary scan.
@laforetsolaire69784 місяці тому
Waaa Thanks
@baxter6504Рік тому
This is simpler than debugging the ESP32 with the ESP-Prog. Why doesn't Arduino advertise this?!?!
@MagicJFРік тому
Using micropython seems debbugable as well
@TheJavaSyncРік тому
How about in micropython, pls 🙏 I used to print("blah blah blah... ") to find out - how far the code worked .. hhahaha
@joeking5211Рік тому
Such a shame, this does not work, gives error "Could not find the specified task." Are you really doing nothing else behind the scenes as have checked your vid slowly through to make sure all the syntax I have taken from your info is correct and still the same error, and yet your demo works, how can this be ????????.
@redcrafterlppa303Рік тому
You complain that other solutions hide the debugging behind another tools. But then continue to represent a tool that does the same.
@EVJ-WorldРік тому
Sorry, but not working :( Could you help me please in private?
@binh6623Рік тому
muhahaha,great
@suki44106 місяців тому
Oh, my god! I think he said "microsoft" . I think, i will delete the internet.
@stingerutube3 місяці тому
this is not debugging !!!!
@jse-shack8253 місяці тому
It is software stub debugging, which is technically not debugging, but a) still more debugging than having to use Serial.print() and b) it might as well be debugging for somebody who only uses it for simple programs like many beginners do. And if you're not a beginner, then you probably know how to debug Arduinos with other methods. This video is aimed at somebody who has been fiddling around with Arduino for some time and still might be overwhelmed by the complexity of external debugging devices. Having less potent debugging but omitting extra hardware is a good trade-off for beginners.
@rickylarsen458Місяць тому
First of all, never code in arduino terms, only use anscci C, because in time critical applications you will have a large issue, Second, you will never have accesses to registers view, whitch is fundemental for debugging professional, so dont use this method, bye an Atmel Ice, get rid of the arduione bootloader, and code in Ansci C, the only way to do this right
@dineshvyasРік тому
Don't over act and you may grow.
@lars-gunnartengerstrom8276Рік тому
OK!! Tru To program a Hybrid..And Understand Librarys...??!
@feelthewyrd5 місяців тому
i really wanted this to work. debug not available for the arduino uno on the arduino ide. followed your instructions:- Configuring upload protocol... AVAILABLE: arduino CURRENT: upload_protocol = arduino Looking for upload port... Auto-detected: COM5 Uploading .pio\build\uno\firmware.hex avrdude: ser_open(): can't open device "\\.\COM5": Access is denied. it works fine from the arduino ide.
@feelthewyrd5 місяців тому
SOLVED .... DO NOT HAVE THE ARDUINO IDE OPEN TOO. arduino ide will work if vscode open but not the otherway around. CHEERS DUDE!
@jse-shack8255 місяців тому
@@feelthewyrd Nice that you got it working. Any OS only allows one open connection to a serial port. This goes for any terminal program as well.