Playing around with yet another version of ILI9341_t3 library (ILI9341_t3n)

I would start by removing the pinMode and digitalWrite lines. Those are setting up pin 13, however, the tft.begin() is coming along a few microseconds later and switching pin 13 to be the SPI clock signal. Perhaps at certain optimization levels the compiler is getting confused about what to do with the SPI clock line and the tft startup code is getting stuck in the startup routines because SPI transactions never finish.

Thanks for the help.

I only put that led bit in after It was already going wrong to see if it started up. Didn't notice the shared pin!

I just removed it to test, same problem. I don't think we even get to setup().


Things I would probably do, would be to turn on the debug kernel stuff.
Go into teesns4\debug\printf.h
and uncomment the line: //#define PRINT_DEBUG_STUFF

Then debug stuff will be printed out on Serial4, by default I believe at 115200. so hook up something to the Serial4 pins. Could be another teensy running the USBSerial sketch or could be something like an FTDI cable. And see what prints out.

You can also add in your own debug outputs when necessary using the printf_debug(...) calls
I just tested using the Arduino IDE, building with optimise=debug I also have the same thing there so it is not PlatformIO related.
You might also want to put it on it's own thread as probably not related to the ILI9341 display
Yep, I have seen other people having the same issues with other libs like the audio one.

I will get the debug output tomorrow and create a new thread...