Hi,
We are in the process of testing JTAG on a custom board based on the ESP32-WROOM-32D, using a J-Link Debug Probe by SEGGER.
Based on the peripheral schematics found in chapter 7, page 14 of the esp32-wroom-32_datasheet_en.pdf and the ESP-WROVER-KIT_V4_1.pdf schematic, I would like to know how exactly I should proceed connecting MTMS/MTDI/MTCK/MTDO/EN.
I have attached screenshots from the datasheets for your convenience.
In the ESP32-WROOM-32 Datasheet V2.6 ESP32 IO14/IO12/IO13/IO15 are routed to JTAG MTMS/MTDI/MTCK/MTDO with a 100R series resistor.
In the ESP-WROVER-KIT_V4_1 schematic ESP32 IO13 is routed to MTCK via a 10K pull down resistor, IO12/IO15/IO14 are routed to MTDI/MTDO/MTMS via a 10K pull up resistor. EN is also connected to a 10K pull up.
We are using the ESP32-WROOM-32D on a custom board.
How should we connect IO14/IO12/IO13/IO15/EN to the JTAG connector? Using the 10K pull up/down resistors? Using the 100R in series? Both (10K pull up/down and 100R series)? Why are there no pull up/down resistors in the Peripheral Schematics of ESP32-WROOM-32 Datasheet V2.6?
Will the 10K pull up on EN impact serial flashing (we are also using UART DOWNLOAD and automatic bootloader)?
Looking forward to your reply.
Kind regards,
Arjan
JTAG schematic for custom board based on ESP32-WROOM-32D
-
- Posts: 4
- Joined: Fri Nov 09, 2018 9:55 am
JTAG schematic for custom board based on ESP32-WROOM-32D
- Attachments
-
- ESP-WROVER-KIT_V4_1.png (98.03 KiB) Viewed 13076 times
-
- esp32-wroom-32_datasheet_en.png (67.61 KiB) Viewed 13076 times
-
- Posts: 4
- Joined: Fri Nov 09, 2018 9:55 am
Re: JTAG schematic for custom board based on ESP32-WROOM-32D
For your information, I have tried both variants (100R in series and 10K pullup/down). However the result remains the same. You can see the openocd output in the attachment.
The ESP32 is not actually resetting, as I can see normal debug output printed via the UART.
I am testing with the (older) ESP-WROOM-32, not the ESP32-WROOM-32D.
Code: Select all
Info : esp32: Debug controller was reset (pwrstat=0xE5, after clear 0x0F).
I am testing with the (older) ESP-WROOM-32, not the ESP32-WROOM-32D.
- Attachments
-
- openocd-debug-controller-was-reset.png (87.15 KiB) Viewed 13050 times
-
- Posts: 4
- Joined: Fri Nov 09, 2018 9:55 am
Re: JTAG schematic for custom board based on ESP32-WROOM-32D
Hi,
In order to further debug this problem and make sure it was not caused by faulty wiring, I decided to flash the DevKitC with hello_world and connect the DevKitC to the SEGGER J-Link directly.
In other words: No 100R series resistor (like in the ESP32-WROOM-32 datasheet), no 10K pullup/down resistors (like in the ESP-WROVER-KIT schematic), just straight wires going from the DevKitC 3V3/EN/GPIO15/GPIO12/GPIO13/GPIO14/GND pins to the JTAG (J-Link interface) VTref(1)/RESET(15)/TDO(13)/TDI(5)/TCK(9)/TMS(7)/GND(4) pins.
However, the same problem occurred (Debug controller was reset, continuously). See the console log attachment from my previous post.
In the openocd console log I noticed the following:
I then decided to change adapter_khz from 20000 to 15000 in esp-wroom-32.cfg (openocd\scripts\board). No effect.
Then I tried using 14000 kHz, and this seemed to do the trick. Not only for DevKitC, but also for our custom board.
I have attached a screenshot of the console log.
Two questions remain:
1.) Why did adapter_khz have to be lowered to 14000?
2.) Which schematic to use for a custom board? 100R series and/or 10K pullup/down? (my original question from this topic start)
I have included as much information as possible, so others in the community that face this issue will hopefully get a headstart when troubleshooting.
Kind regards,
Arjan
In order to further debug this problem and make sure it was not caused by faulty wiring, I decided to flash the DevKitC with hello_world and connect the DevKitC to the SEGGER J-Link directly.
In other words: No 100R series resistor (like in the ESP32-WROOM-32 datasheet), no 10K pullup/down resistors (like in the ESP-WROVER-KIT schematic), just straight wires going from the DevKitC 3V3/EN/GPIO15/GPIO12/GPIO13/GPIO14/GND pins to the JTAG (J-Link interface) VTref(1)/RESET(15)/TDO(13)/TDI(5)/TCK(9)/TMS(7)/GND(4) pins.
However, the same problem occurred (Debug controller was reset, continuously). See the console log attachment from my previous post.
In the openocd console log I noticed the following:
Code: Select all
Info : Reduced speed from 20000 kHz to 15000 kHz (maximum).
Info : Reduced speed from 20000 kHz to 15000 kHz (maximum).
Info : clock speed 20000 kHz
Then I tried using 14000 kHz, and this seemed to do the trick. Not only for DevKitC, but also for our custom board.
I have attached a screenshot of the console log.
Two questions remain:
1.) Why did adapter_khz have to be lowered to 14000?
2.) Which schematic to use for a custom board? 100R series and/or 10K pullup/down? (my original question from this topic start)
I have included as much information as possible, so others in the community that face this issue will hopefully get a headstart when troubleshooting.
Kind regards,
Arjan
- Attachments
-
- openocd-success.png (15.49 KiB) Viewed 13050 times
-
- Posts: 9757
- Joined: Thu Nov 26, 2015 4:08 am
Re: JTAG schematic for custom board based on ESP32-WROOM-32D
Hoi Arjan,
There's probably nothing specific about 14000KHz, but do keep in mind that it does mean that you're trying to push 15/14MHz over a simple set of single-ended cables: it's a setup that's somewhat prone to deterioration because of inductance/capacitance effects. I wouldn't be surprised if the clock signal would look everything but a square wave if you'd put a 'scope on it.
In general, if someone runs into weirdness with JTAG (OpenOCD doesn't give you the 'all ones' or 'all zeroes' message and detects the Tensilica, but later stuff breaks), it's advisable to use a slower JTAG clock frequency first.
Also, wrt the resistors: The 10K ones are there to set the JTAG port to defined levels. You could leave them off, and have an (extremely small) chance that the open pins pick up EMC that just happens to resemble a JTAG command. They're not necessary if you disable JTAG or reconfigure those GPIOs to do something else. I'm not 100% sure about the 100 ohm ones, but it may be general good practice on our designers side, to dampen reflected transients in the line and to stop ringing.
There's probably nothing specific about 14000KHz, but do keep in mind that it does mean that you're trying to push 15/14MHz over a simple set of single-ended cables: it's a setup that's somewhat prone to deterioration because of inductance/capacitance effects. I wouldn't be surprised if the clock signal would look everything but a square wave if you'd put a 'scope on it.
In general, if someone runs into weirdness with JTAG (OpenOCD doesn't give you the 'all ones' or 'all zeroes' message and detects the Tensilica, but later stuff breaks), it's advisable to use a slower JTAG clock frequency first.
Also, wrt the resistors: The 10K ones are there to set the JTAG port to defined levels. You could leave them off, and have an (extremely small) chance that the open pins pick up EMC that just happens to resemble a JTAG command. They're not necessary if you disable JTAG or reconfigure those GPIOs to do something else. I'm not 100% sure about the 100 ohm ones, but it may be general good practice on our designers side, to dampen reflected transients in the line and to stop ringing.
-
- Posts: 4
- Joined: Fri Nov 09, 2018 9:55 am
Re: JTAG schematic for custom board based on ESP32-WROOM-32D
Hi ESP_Sprite,
Thank you so much for your reply.
For a custom board design based on the ESP32-WROOM-32D, would you advise to keep the in-line 100 ohm resistors for MTMS/MTDI/MTCK/MTDO (like in the esp32-wroom-32 datasheet) and leave off the 10K resistors? For debug we will simply place the 4 100 ohm (0603) resistors, for production we will simply leave them off as JTAG is debug only.
Thanks!
Arjan
Thank you so much for your reply.
For a custom board design based on the ESP32-WROOM-32D, would you advise to keep the in-line 100 ohm resistors for MTMS/MTDI/MTCK/MTDO (like in the esp32-wroom-32 datasheet) and leave off the 10K resistors? For debug we will simply place the 4 100 ohm (0603) resistors, for production we will simply leave them off as JTAG is debug only.
Thanks!
Arjan
-
- Posts: 9757
- Joined: Thu Nov 26, 2015 4:08 am
Re: JTAG schematic for custom board based on ESP32-WROOM-32D
I think that should be fine. GPIO12/MTDI actually is a bootstrap pin that has a weak (iirc) pullup resistor, so even without pullups/pulldowns the JTAG port by itself shouldn't do much.
(Also note that the schematic indicating the resistors only spec a pulldown on mtck and mtms... the rest are all no-stuff parts.)
(Also note that the schematic indicating the resistors only spec a pulldown on mtck and mtms... the rest are all no-stuff parts.)
Who is online
Users browsing this forum: Bing [Bot], joglz8 and 114 guests