I’m trying to use an ESP-Prog to debug a sketch running on an ESP32 with an ILI9341 touchscreen on a pre-built board, which connects ESP32 and the touchscreen.
While debugging a simple blink-demo (without the touchscreen) works fine, the debug session can’t be established when all components (ESP32, Touchscreen and ESP-Prog) are connected. First I was a little bit puzzled, 'til I recognized that the reason is the usage of the GPIOs 14 and 15 which are used by the board designer to control background light of the touchscreen resp. as chip select for the touchscreen. Unfortunately these ports are obviously part of the JTAG interface of the ESP32 (TMS/TDO).
To avoid this clash I see two (theoretical) solutions. Separating PCB-tracks and reconnecting to alternate GPIOs (16 and 17 look fine) or reassigning TMS/CDO to these GPIOs - possibly via something like PIN_FUNC_SELECT. However after reading some docs I am in doubt that the latter will work.
Could somebody please give me an advice how to proceed?
thx for your reply. Unfortunately I do not believe, that the SPI settings are part of my particular problem - as they are yet already assigned to other GPIOs. To make things - hopefully - a little bit clearer I’ll add the schematics for the relevant parts of the pre-build board
My problem is, that I am still hesitating to cut the PCB lines and replace them by some wire to the alternate GPIOs and I would still prefer a less invasive method (reassigning TDO/TCK to other GPIOs), but I am in doubt that this is really possible.
The esp-prog is connected to the default GPIOs for my ESP32, i.e.
TMS → GPIO14
TCK → GPIO13
TDO → GPIO15
TDI → GPIO12
and works absolutely fine - as long as I do not try to access the touchscreen via the pins 14/15 from my sketch, for example when running a simple blink-sketch. Debugging also is working when I alter the pin numbers in my sketch to 16/17, but of course the touchscreen is not working with this setting
This cannot work as GPIO14 (ESP_Prog Module TMS: test mode select) and GPIO15 (ESP_Prog Module TDO: test data out) are part of the esp-prog. They cannot serve the TFT display the same time.
The main question is still remaining - is it possible to reassign TMS/CDO to other ports to avoid the conflict. I am in doubt that is possible, because - as far as I understood - reassigning JTAG lines, which are connected internally via IO_MUX, is not as free as it would be if they were connected to the GPIO matrix. It would be fine if somebody could please confirm that or otherwise explain how to proceed.