GPIO12-GPIO15 unresponsive, JTAG override?? [SOLVED]
Posted: Sun Oct 11, 2015 11:43 pm
I have a ESP-12E board (ESP12-Q) and wanted to use GPIO12-15 for various stuff.
GPIO15 is pulled to GND through a 1k resistor to allow proper startup. Programming all works fine, as does I/O on GPIO0-GPIO5 and GPIO16.
However, GPIO12 to GPIO15 is not working properly. I've set them all to outputs, toggling at 1 Hz together with GPIO0-GPIO5,GPIO16.
They're not doing anything at all, GPIO12, 13 and 14 are high and GPIO15 is low (most likely due to the extern pulldown).
The odd thing is, that just measuring on GPIO13 or giving it a slight negative pulse, will cause GPIO15 to go (and stay) high.
Now, that these pins also double as JTAG pins, GPIO13 is MTCK and GPIO15 is MTDO, this looks suspiciously like the JTAG interface is enabled and a stray clock caused MTDO to go high.
I've looked high and low, but see no way of how to disable the JTAG pins. I'm using the "regular" pin config to set the pins to GPIO:
But to no avail.
I see many code examples where these GPIO pins are used for both input and output, so what the h*** is wrong here??
Am I missing something?
I've tried my code on a ESP-07 too, same problem, JTAG seems to take over.
I'm running with SDK 1.3.0
Tips and hints much appreciated.
/J
Edit:
Problem solved, it turned out I had an incorrect PIN_FUNC_SELECT macro. Worked when setting GPIO pins that were at function 1, but not at function 3.
GPIO15 is pulled to GND through a 1k resistor to allow proper startup. Programming all works fine, as does I/O on GPIO0-GPIO5 and GPIO16.
However, GPIO12 to GPIO15 is not working properly. I've set them all to outputs, toggling at 1 Hz together with GPIO0-GPIO5,GPIO16.
They're not doing anything at all, GPIO12, 13 and 14 are high and GPIO15 is low (most likely due to the extern pulldown).
The odd thing is, that just measuring on GPIO13 or giving it a slight negative pulse, will cause GPIO15 to go (and stay) high.
Now, that these pins also double as JTAG pins, GPIO13 is MTCK and GPIO15 is MTDO, this looks suspiciously like the JTAG interface is enabled and a stray clock caused MTDO to go high.
I've looked high and low, but see no way of how to disable the JTAG pins. I'm using the "regular" pin config to set the pins to GPIO:
Code: Select all
PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDI_U, FUNC_GPIO12);
PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTCK_U, FUNC_GPIO13);
PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTMS_U, FUNC_GPIO14);
PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDO_U, FUNC_GPIO15);
But to no avail.
I see many code examples where these GPIO pins are used for both input and output, so what the h*** is wrong here??
Am I missing something?
I've tried my code on a ESP-07 too, same problem, JTAG seems to take over.
I'm running with SDK 1.3.0
Tips and hints much appreciated.
/J
Edit:
Problem solved, it turned out I had an incorrect PIN_FUNC_SELECT macro. Worked when setting GPIO pins that were at function 1, but not at function 3.