First of, I hope this is the right group. This is a basic issue but it's definitely boot-loader related.
I think I'm missing something fundamental here. I needed to take some Arduino's to a user group (maker-lab in making) to introduce basic Arduino and other maker electronics. Unfortunately my old UNOs were all used in projects so I decided to add new ones, and found the "new" Leonardo. I've never used that before, and thought it was time for an upgrade. I only needed something basic so it would work perfectly for the talk.
I love how things are labeled better - it was great for demos, and a basic demo with NEOPIXEL and a few other things just worked. Happy presenter - and I had hoped the story ends here. But unfortunately it doesn't.
I also had a TM1638 (https://www.amazon.com/gp/product/B07CJS3184) for the same purpose - to illustrate a few basic principles. I hacked up some VERY ugly code, and the whole thing is easy to control. That is, from my UNO that's the same. Even a NANO, it works great - but when I upload the same code to the Leonardo, the boot-loader fails and to the computer, there's no longer a device attached. Nothing in the sketch works - I have to use a USBTiny to write a new boot-loader to the board (which actually requires a bit of a work-around, but I don't think that's relevant here), and with that done, I can get "blinky" just fine. Uploading basic sketches like Blinky doesn't kill the Leonardo. So far, JUST my little project does.
That same project uploads fine on a UNO. But my little "blinky" isn't running unless I leave out initialization of my code. So there's definitely a bug, but I'm not understanding why the bootloader on the Leonardo works "differently". I'll like to understand the difference - perhaps there's a feature here I can take advantage of?
I'm lost in regards to two things:
- How in the world do I debug what's going on? There's no JTAG etc. so how do you figure out why the USB interface just stops?
- How can an extremely simple sketch that basically just initializes a few digital ports (I've commented everything else out!) die like this?