The code is the example code from Adafruit ILI9341 library called graphics test
Debugging the code, it appears that the line within setup procedure that calls tft.begin() is the culprit and the code does not get past that line. I have made a post on adafruit forum advising of this issue, however I was wondering if my pin definitions were out.
Looking at the pdf schematics and the mux table in variants.cpp I am not able to see where pins 22,23 and 24 are wired on the actual SAMD21 chip.
You did the right thing by connecting the LCD to the SPI port... The problem lies in the Adafruit library. In my experience, Adafruit does a very poor job supporting non-AVR Arduinos. This particular library does contain hardware SPI support but it is written specifically for AVRs and will not work on the Zero. I had to rewrite the entire Adafruit library for the Sharp Memory LCD so it would work on the Zero.
If you want to fix the library yourself let me know as I can share some lessons learned from fixing the Sharp LCD library.
Yes, you are right, this is the library I am using and you are of course correct pointing out that I should have put information about the library and the code. However, I did say that I am using ILI_9341 library and that I am trying to get graphics test example to work. But for the future I shall make sure I post the code.
The constructor that you pointed out is indeed the correct one, however in the example the constructor used only has two parameters for TS and DC values. That is the problem, in their library inside that .cpp file the value for _rst isn't set and is just random. So when it comes to begin() function inside the cpp file pinMode(_rst, OUTPUT) just brakes because pin number simply doesn't exist.
_rst is not random, it is preset to -1 if you don't pass it a value. And if it is equal to -1 it is never used I think. Try to pass it an unused pin number to see if it changes something maybe.