1

I have already posted this question on the raspberry forum but I only got a few answers that didn't solve my problem... I have been waiting for a month so I turn to this forum hoping to be able to find a solution there...

PS : do not hesitate to check my post on RPI forum to see my progress and my research/tests carried out (https://forums.raspberrypi.com/viewtopic.php?t=335338)

So here is my problem :

I have been looking for a while how to write to an external microSD card in SPI mode... My goal is to write data collected by a sensor an store them on various microSD cards (6) by using CS. But at this point, I'm tring to write data on one card. I'm using a RPI Zero 2W, a simple microSD card module and an 512GB microSD card (with exFAT filesystem).

I saw that there was a "mmc_spi" driver included in a linux kernel which allows to detect an SD card connected by SPI as if it were a USB key to which we could simply access/read/write (https://ralimtek.com/posts/2016/2016-12-10-raspberry_pi_secondary_sd_card/)

the problem is that this tutorial is not working anymore... In fact, the linux Kernel used in the tuto is an old one compare to the current version and and I had confirmation that the "mmc_spi" driver used to detect the SD card had evolved but the use of this new version is not documented and obviously does not work like the old one...

So my question is : does the mmc_spi driver still allows to detect SD cards and access them and if yes, does it works with the PI zero 2W ?

Thomas
  • 11
  • 2
  • On stackoverflow you can ask for help with specific detailed problems that you have tried to solve yourself and got stuck with. You cannot ask for general advice, ask for a tutorial, or ask people to write your code for you. Sorry, that does not fit in the question/answer format. – Tom V Jul 20 '22 at 15:30
  • SD protocol includes two types of card detections: 1) external GPIO line; 2) special SD host controller register that will tell you that by reading it. In some cases SD host controllers may generate native interrupt (don’t mix with GPIO based one). Now, since SPI protocol is actually being abused by SD standards (obviously due to the different requirements for signal logical levels, etc), the only possible way is to use GPIO based scheme. – 0andriy Jul 21 '22 at 18:17
  • But next interesting part is what your SPI controller is doing when transferring data. If the driver is using DMA, `mmc_spi` can’t work. – 0andriy Jul 21 '22 at 18:19

0 Answers0