ChrispyChris
New member
So I've ordered a couple Teensy 4.1 boards after playing with Arduino as I've realized how awesome these little things are! First issue was the arduino ide software since it's built with Java, that caused issues with my window manager. After MANY hours of working on that, I've decided to go a little more manual, and now after many hours, I'm asking for help haha. I'm about to lose my mind.
I've installed the Teensyduino software over top my Arduino install. I just want to start writing my own programs in C++, compile them, and then since I'm having trouble using Arduino IDE with TeensyLoader because TeensyLoader requires GTK and with my workaround to fix the Arduino IDE for DWM I had to do a Java hack which when installing the gtk library it breaks my entire IDE so then I'm back to square one. Hopefully this kind of outlines a bit of my frustrations too haha. Anyways, I looked inside teensy4 and saw the Makefile, GLORIOUS DAY! Well I copied that and also copied the entire /tools folder from Arduino, the /libraries folder, and the /arm/bin folder. Then I saw in my arduino/teensy/avr/cores/teensy4/ there were Arduino.h and all those libraries. I threw those in my libraries folder as well and got the naming right in my Makefile, tried running Make and got an error. The first time I realized I just grabbed the Arduino.h from teensy4 but it was asking for some other headers, so that's when I pulled in all the teensy4 library files. Now I tried make again and now I'm seeing avr/pgmspace.h is missing haha. It's one thing after another.
Is there something that I'm looking past to make this all somewhat simple for the command line? I'm in the terminal most of my day, so I'm not new to that, or Linux really. I'm no pro either, and I'm new to embedded, but I figured it wouldn't be super difficult to get avr-gcc set up so I could write a C++ program, maybe use a library I find online or whatever, throw a little Makefile together, make, and then take the hex file and I was going to use tytools to upload because it's built in QT so I don't deal with the Java issues from Arduino IDE, but even flashing with avr-dude if possible would be cool.
TL;DR After many issues at this point I want to get an environment going with avr-gcc and makefiles so I can write C++ for Teensy 4.1, using additional libraries I find online or whatever as I go, obviously. I would really appreciate any help and honestly at this point, I would even pay someone to one on one just help me get the environment going. I'm pulling my hair out now haha. I am running Arch Linux again, just so you're aware.
I am still very interested in getting this setup without the Arduino IDE, but in the meantime I have figured out another hack if ANYONE on the internet ever comes across the same issue with DWM, the Arduino IDE, and TeensyLoader not loading because of gtk and the conflict with gtk, Java, DWM, and Arduino IDE (the perfect storm). What I did was actually install gtk2 and ran "ldd" on the teensyloader to see which specific libgtk-x11 libraries it wanted. After that I copied those to my home folder and removed gtk2 completely. After that I just threw those two libraries (libgtk-x11-2.0.so.0 and libgdk-x11-2.0.so.0) in my /usr/lib and now when I run through the Arduino IDE and compile and stuff, the actual TeensyLoader pops up after like ten hours of messing with this. Hopefully this saves someone some time in the future.
I've installed the Teensyduino software over top my Arduino install. I just want to start writing my own programs in C++, compile them, and then since I'm having trouble using Arduino IDE with TeensyLoader because TeensyLoader requires GTK and with my workaround to fix the Arduino IDE for DWM I had to do a Java hack which when installing the gtk library it breaks my entire IDE so then I'm back to square one. Hopefully this kind of outlines a bit of my frustrations too haha. Anyways, I looked inside teensy4 and saw the Makefile, GLORIOUS DAY! Well I copied that and also copied the entire /tools folder from Arduino, the /libraries folder, and the /arm/bin folder. Then I saw in my arduino/teensy/avr/cores/teensy4/ there were Arduino.h and all those libraries. I threw those in my libraries folder as well and got the naming right in my Makefile, tried running Make and got an error. The first time I realized I just grabbed the Arduino.h from teensy4 but it was asking for some other headers, so that's when I pulled in all the teensy4 library files. Now I tried make again and now I'm seeing avr/pgmspace.h is missing haha. It's one thing after another.
Is there something that I'm looking past to make this all somewhat simple for the command line? I'm in the terminal most of my day, so I'm not new to that, or Linux really. I'm no pro either, and I'm new to embedded, but I figured it wouldn't be super difficult to get avr-gcc set up so I could write a C++ program, maybe use a library I find online or whatever, throw a little Makefile together, make, and then take the hex file and I was going to use tytools to upload because it's built in QT so I don't deal with the Java issues from Arduino IDE, but even flashing with avr-dude if possible would be cool.
TL;DR After many issues at this point I want to get an environment going with avr-gcc and makefiles so I can write C++ for Teensy 4.1, using additional libraries I find online or whatever as I go, obviously. I would really appreciate any help and honestly at this point, I would even pay someone to one on one just help me get the environment going. I'm pulling my hair out now haha. I am running Arch Linux again, just so you're aware.
I am still very interested in getting this setup without the Arduino IDE, but in the meantime I have figured out another hack if ANYONE on the internet ever comes across the same issue with DWM, the Arduino IDE, and TeensyLoader not loading because of gtk and the conflict with gtk, Java, DWM, and Arduino IDE (the perfect storm). What I did was actually install gtk2 and ran "ldd" on the teensyloader to see which specific libgtk-x11 libraries it wanted. After that I copied those to my home folder and removed gtk2 completely. After that I just threw those two libraries (libgtk-x11-2.0.so.0 and libgdk-x11-2.0.so.0) in my /usr/lib and now when I run through the Arduino IDE and compile and stuff, the actual TeensyLoader pops up after like ten hours of messing with this. Hopefully this saves someone some time in the future.
Last edited: