Looking for advice on choosing an IDE and how to debug.

warpigs330

Active member
I thought I would ask everyone here what their setup is for programming and debugging the teensy 4.0. I have had some difficulty getting debuggers to work reliably, but this probably has more to do with my lack of experience than anything else. I have used Visual Studio Code with platformio and Visual Studio with visual micro and they both are a bit janky. So I thought I would ask everyone what their setup is, and what they like/dislike about it.
 
for teensy 3.6 and 4.1, using Visual Studio code as an editor, cmake+ninja for build, printf to usb console, LEDs for debugging.. I know in many cases its faster to make something more clever then this

Best regards
 
So I thought I would ask everyone what their setup is, and what they like/dislike about it.

Hi Warpigs, once we get past the simple stuff I think all of us confront this question. I tried Platformio and Visual Studio Code and hated them. Other people love them but I could not. I have used Geany for other programming tasks and love it for what I thought was just the right combination of features, simplicity and power. The problem was getting it to work for programming the Teensy. At first I wrote my own make routines which I could call from within Geany. This worked well but was not flexible. And it did not allow me to maintain the libraries, which is a great strength of the Arduino IDE.

I then adopted PJ's suggestion. He uses his favourite editor for the code(he didn't say what it was) but compiles/uploads from the Arduino IDE. In the Arduino IDE choose File|Preferences and tick the box 'Use external editor'. Now you can write your code in your favourite editor(Geany in my case) and then activate the Arduino IDE window to compile/upload. The Arduino IDE tracks the changes you made to the code in your editor. The merit of this approach is that you can maintain your library through the Arduino IDE and the compiled code is always perfectly compatible, since the Arduino IDE is the gold standard.

The drawback is that you need two windows open, your editor and the Arduino IDE and you need to switch between the two for editing/compiling/uploading. It is a minor irritation that I can easily live with. I might create keyboard macros to make this easier and faster.

So why do I like Geany? Because it is small, very fast and simple. But at the same time it allows me to search for and navigate through my variables and functions in a way that seems to be better and easier then Platformio and Visual Studio Code. I work on some large programs so this is a killer advantage for me. Kdevelop(in the Linux world) is also good for this.
 
I use the same approach as PDOS, but with Notepad++ instead of Geany, which I haven't tried. One thing I particularly like about Notepad++ is the ability to open an entire folder as a workspace, so I can easily navigate any or all of my own sketches and libraries, or the Teensy cores/libraries.
 
ig-or, could you elaborate a bit regarding your comment about "printf to USB console" for debugging. I couldn't find anything in the forum about doing that.
 
ig-or, could you elaborate a bit regarding your comment about "printf to USB console" for debugging. I couldn't find anything in the forum about doing that.

He just means sprinkling Serial.printf() statements in your code so that you can check values or whatever you want to check. "Serial" is the USB serial port, and the text printed goes to the Arduino Serial Monitor. When he says "USB console", he means the Arduino Serial Monitor.
 
Oh, I see. I was hoping it was referring to a way of getting debugging information via the Teensy 4.1 USB host connector.
Thanks for the explanation.
 
Oh, I see. I was hoping it was referring to a way of getting debugging information via the Teensy 4.1 USB host connector.
Thanks for the explanation.

You can get that by using VisualMicro with Visual Studio.
 
Back
Top