Page 1 of 1

JTAG and SDCard

Posted: Mon Sep 10, 2018 6:24 pm
by permal
Hi,

One of the early selling points for the ESP32 was that pins could be remapped. However, when looking closer at this, it appears that it is not possible to remap pins such that JTAG and the SDMMC Host can function at the same time.

So, how do others debug applications that uses an SDCard?

Edit: Also, what's the reason for R157 not being populated in the Wrover-kit?

Re: JTAG and SDCard

Posted: Tue Sep 11, 2018 1:39 am
by ESP_igrr
One option is to connect an SD card to HS1 interface, and move SPI flash to other set of pins (e.g. VSPI). This makes JTAG pins available for use.

Another option is to connect SD card to another set of pins in SPI mode, for the duration of debugging (assuming you are not debugging sdmmc related code). Then once debugging is done, connect it back to HS2 pins using sdmmc interface.

Regarding R157, this is because Wrover-kit typically comes with a 1.8V flash module, hence GPIO12 must not be pulled up on reset.

Re: JTAG and SDCard

Posted: Tue Sep 11, 2018 6:22 pm
by permal
ESP_igrr wrote:One option is to connect an SD card to HS1 interface, and move SPI flash to other set of pins (e.g. VSPI). This makes JTAG pins available for use.
I'll be using a Wrover modules so I can't do that.
ESP_igrr wrote: Another option is to connect SD card to another set of pins in SPI mode, for the duration of debugging (assuming you are not debugging sdmmc related code). Then once debugging is done, connect it back to HS2 pins using sdmmc interface.
Naturally, its even documented. (Note to self: RTFM ;) ) I'll try this route.
ESP_igrr wrote: Regarding R157, this is because Wrover-kit typically comes with a 1.8V flash module, hence GPIO12 must not be pulled up on reset.
Ah, yes ofc. A bit wierd though, since every text I've read on SDCard IFC says that they should be pulled up. Also, the Wrover kit uses 10KOhm, but the docs say 50kOhm?

Re: JTAG and SDCard

Posted: Wed Sep 12, 2018 2:11 am
by ESP_igrr
In practice, internal pull-up on GPIO12 is sufficient to work with most SD cards. W.r.t. the document mentioning 50kOhm, I think it should be "50kOhm or stronger" (lower resistance value).

Re: JTAG and SDCard

Posted: Wed Sep 12, 2018 10:31 pm
by permal
Ok, so I ended up sacrificing two outputs in favor of the ability to debug with SDCard support via (V)SPI. That freed enough GPIOs to allow for both SPI and MMC mode, with H/W selection via DIPs. I'm wondering if this will introduce too much interference for it to work, even if placed near the Wrover module?

I 'm thinking two MAX4948 and just a single DIP would be a much better choice, but it has on on-resistance of 4 Ohms, would that be too much? Doing this would also add H/W support to allow software detection of the current mode wich would be a really nice thing.