Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By sigrokBlack
#21088 Hi,
*is your sd card formatted with Fat32/Fat16 ?
*is the chipselect pin of your sd connected right, cause when it isn't connected right, the sd won't work.

Which sd card are you using/which sketch are you using?
Last edited by sigrokBlack on Sat May 30, 2020 5:16 pm, edited 1 time in total.
User avatar
By martinayotte
#21099 Hi Joshua,

My SDCard is formatted in FAT16.
Also, since I have a identical adapter attached on an STM32 MiniMaple, I've done some tests there too, it is actually working, I'm able to do a listDir() and fileRead().
Since there is only this SDCard adaptor on the SPI bus, I've tied the CS pin of the adaptor directly to GND.
On ESP, what look strange is the timing of the MISO, which seem to be shorter than the CLK, at least for the first transaction (see attached image).
Also, once in a while, I'm also getting the watchdog triggered, which is a bit scary.
The sketch is CardInfo/listfFiles/readwrite example merge together, but it doesn't even get thru the card.init()

EDIT : I've started adding debug traces in the library, and it failed with the timeout in the following loop :
Code: Select allwhile ((status_ = cardAcmd(ACMD41, arg)) != R1_READY_STATE) {
You do not have the required permissions to view the files attached to this post.
User avatar
By sigrokBlack
#21104 Hi,
thats strange. So first of all, which module are you using? How did you connect the sd card to the esp? Pic?

So on your picture:
Channel 0 is clock? Looks good
Channel 2 is MOSI? Looks good
Channel 1 is MISO? There is the problem, I'm not a mastermind in this, but it looks like, if the sd card is missunderstanding the signals coming from MOSI and/or the card has other problems.

Try to format the card with FAT32

Which veraion of the IDE are you using ?
Which module? And which settings in the IDE?
Maybe try to use an other SPI device with the esp8266.
Connecting CS directly to ground is not the best Idea.
Is the CS pin correctly defined in your sketch?

Regards
Last edited by sigrokBlack on Sat May 30, 2020 5:17 pm, edited 1 time in total.
User avatar
By martinayotte
#21108 Hi again Joshua,

My module is ESP-07, I'm using Arduino IDE 1.6.1 with ESP when it cames out, but I've done updates from github several time. Last update was done few days ago, on June 18th. I've done the merge using "meld" to see the changes one by one.

Digging more with Pulseview, I was able to see that "SD Version check" was running properly, seeing the answer of the SDCard, so that means the SPI transactions are Ok. Here is the capture of the "SD Version check" as first attachment.
sd-spi.jpg

Then I see that when the ACMD41 is sent, SDCard doesn't respond any thing, so it is looping send again ACMD41 until it is timing out. (see other attchments). BTW, I've even tried to change the argument send from write32() to the old 4x write8(), but it wasn't better. The order of the sends are MSB first, so I presume it is normal, right ?
sd-spi2.jpg

sd-spi3.jpg

Maybe try to use an other SPI device with the esp8266.

The only other SPI device I have handy is a ENC28J60, so I don't want to get into long testsing.
I'm better to narrow the issue with SDCard. :?
You do not have the required permissions to view the files attached to this post.