Debugging the Arduino Uno or Nano! (No extra hardware needed!)

preview_player
Показать описание
Straight forward, no additional hardware, no BS. Debug your Arduino Uno or Nano (almost) out of the box!
Рекомендации по теме
Комментарии
Автор

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!

jse-shack
Автор

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!

bijavix
Автор

This video deserves a lot more views. Alone his presentation skills are pure gold and very entertaining.

MrDelta
Автор

Not being able to debug an Arduino is a good enough reason to choose a different chip. This is a game changer

cjones
Автор

As much as I hate Youtube 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.

AjnJon
Автор

Stepping through your program and adding breakpoints is a great start. But where do I view register contents, flags, timers etc etc ?

andrewwatts
Автор

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. 🔥

youtubegoogle
Автор

short and to the point, that's the way I like it

phil
Автор

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 slow... I guess they don't think I can hear very fast. You're awesome and thanks for posting!!

caper
Автор

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.

Gengh
Автор

Just got recommended this video, wish you luck in your youtube journey!!

VlasovDev
Автор

I spent 20 years learning C++ so I could debug it in my head, when I could have just done this.

TrevorMakes
Автор

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...

pizzahut
Автор

It's an ant, not an alien. Originating with the author, Ivan Kravets and his work with SmartAntHill.

mchanist
Автор

I am astonished that I did not know this is possible, OK it's not a true debugger but it does the one thing that helps debug code i.e. it stops at breakpoints. I rarely need to know the value of the Program Counter and Registers when debugging and if I do I can turn to an STM32 product plus CubeIDE, the only true debugger I have found to be trouble-free. Great video and yes the presentation is very watchable. A bonus was that after actioning all the steps in the video, it actually worked! I have just subscribed - thank you J. PS Just upgraded to the latest version of Jan Dolinay's software i.e. v1.5 and when hitting a breakpoint I can see the values of all 32 registers and the Program Counter and Stack Pointer, I can also add variables to the Watch list and see them change as the code is stepped and finally view memory after setting a start point e.g. 0x8000 and the number of bytes to display e.g. 10.

Steven_Bennett_YT
Автор

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.

Dizintegrator
Автор

Like your style. Hope this channel becomes big.

MrKYT-gbgs
Автор

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?

yayser
Автор

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.

dimitrioskalfakis
Автор

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?

chrisalexthomas