JTAG and SDCard

permal
Posts: 384
Joined: Sun May 14, 2017 5:36 pm

JTAG and SDCard

Postby permal » Mon Sep 10, 2018 6:24 pm

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?

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: JTAG and SDCard

Postby ESP_igrr » Tue Sep 11, 2018 1:39 am

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.

permal
Posts: 384
Joined: Sun May 14, 2017 5:36 pm

Re: JTAG and SDCard

Postby permal » Tue Sep 11, 2018 6:22 pm

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?

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: JTAG and SDCard

Postby ESP_igrr » Wed Sep 12, 2018 2:11 am

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).

permal
Posts: 384
Joined: Sun May 14, 2017 5:36 pm

Re: JTAG and SDCard

Postby permal » Wed Sep 12, 2018 10:31 pm

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.
Attachments
mcu.PNG
mcu.PNG (9.95 KiB) Viewed 6891 times
sdcard.PNG
sdcard.PNG (43.24 KiB) Viewed 6891 times

Who is online

Users browsing this forum: No registered users and 41 guests