0

I followed this guide: https://ralimtek.com/raspberry%20pi/electronics/software/raspberry_pi_secondary_sd_card/

Only thing I changed is the core bug repair procedure, which one I made this more up to date way: https://www.raspberrypi.org/documentation/linux/kernel/building.md

The SD card is not recognized and it says all the time "Drive was removed without ejecting"

I did some research and loop back check and got these results:

pi@raspberrypi:~ $ lsmod | grep -i spi
mmc_spi                24576  0
crc7                   16384  1 mmc_spi
of_mmc_spi             16384  1 mmc_spi
spidev                 20480  0
spi_bcm2835            24576  0
pi@raspberrypi:~ $ ls -l /dev/spi*
crw-rw---- 1 root spi 153, 0 nov  4 12:32 /dev/spidev0.1
pi@raspberrypi:~ $ ./spidev_test -l
can't open device: No such file or directory
Abortado
pi@raspberrypi:~ $ ./spidev_test -?
./spidev_test: invalid option -- '?'
Usage: ./spidev_test [-DsbdlHOLC3]
  -D --device   device to use (default /dev/spidev1.1)
  -s --speed    max speed (Hz)
  -d --delay    delay (usec)
  -b --bpw      bits per word 
  -l --loop     loopback
  -H --cpha     clock phase
  -O --cpol     clock polarity
  -L --lsb      least significant bit first
  -C --cs-high  chip select active high
  -3 --3wire    SI/SO signals shared
pi@raspberrypi:~ $ ./spidev_test -D /dev/spidev0.0
can't open device: No such file or directory
pi@raspberrypi:~ $ ./spidev_test -D /dev/spidev0.1
spi mode: 4
bits per word: 8
max speed: 500000 Hz (500 KHz)

FF FF FF FF FF FF 
40 00 00 00 00 95 
FF FF FF FF FF FF 
FF FF FF FF FF FF 
FF FF FF FF FF FF 
DE AD BE EF BA AD 
F0 0D 

¿What do you think what could fail? Normally I should have spidev0.0 and 0.1, but I have only 0.1, ¿right? ¿What am I doing wrong?

EDIT:

I used this command and got this results:

pi@raspberrypi:~ $ dmesg | grep -i 'spi'
[ 1598.283670] mmc2: new SDHC card on SPI
[ 1598.314122] mmc2: SPI card removed
[ 1694.105883] mmc2: new SDHC card on SPI
[ 1694.142903] mmc2: SPI card removed
[ 1725.612179] mmc2: new SDHC card on SPI
[ 1725.643460] mmc2: SPI card removed
[ 1748.267586] mmc2: new SDHC card on SPI
[ 1748.297874] mmc2: SPI card removed
[ 1748.401178] mmc2: new SDHC card on SPI
[ 1748.422105] mmc2: SPI card removed
[ 1748.538399] mmc2: new SDHC card on SPI
[ 1748.556895] mmc2: SPI card removed
[ 1752.984525] mmc2: new SDHC card on SPI
[ 1753.023553] mmc2: SPI card removed
[ 1769.959529] mmc2: new SDHC card on SPI
[ 1769.996586] mmc2: SPI card removed
[ 7121.914167] mmc2: new SDHC card on SPI
[ 7121.945053] mmc2: SPI card removed
[ 7281.193731] mmc2: new SDHC card on SPI
[ 7281.222658] mmc2: SPI card removed
[ 7425.847847] mmc2: new SDHC card on SPI
[ 7425.881740] mmc2: SPI card removed
[ 7575.607760] mmc2: new SDHC card on SPI
[ 7575.636548] mmc2: SPI card removed
[ 8024.335180] mmc2: new SDHC card on SPI
[ 8024.380284] mmc2: SPI card removed
[ 8053.929496] mmc2: new SDHC card on SPI
[ 8053.968826] mmc2: SPI card removed
[ 8068.587009] mmc2: new SDHC card on SPI
[ 8068.631493] mmc2: SPI card removed
[ 8083.759020] Modules linked in: fuse rfcomm bnep hci_uart btbcm bluetooth ecdh_generic ecc libaes 8021q garp stp llc mmc_spi crc7 of_mmc_spi spidev joydev hid_multitouch brcmfmac brcmutil sha256_generic libsha256 cfg80211 rfkill raspberrypi_hwmon snd_soc_bcm2835_i2s regmap_mmio snd_soc_core spi_bcm2835 snd_compress snd_pcm_dmaengine snd_bcm2835(C) bcm2835_codec(C) v4l2_mem2mem bcm2835_v4l2(C) snd_pcm bcm2835_isp(C) bcm2835_mmal_vchiq(C) vc_sm_cma(C) snd_timer videobuf2_dma_contig videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_common snd videodev mc i2c_gpio uio_pdrv_genirq i2c_algo_bit uio fixed i2c_dev ip_tables x_tables ipv6
[ 8083.762916] mmc2: new SDHC card on SPI
[ 8083.799483] Modules linked in: fuse rfcomm bnep hci_uart btbcm bluetooth ecdh_generic ecc libaes 8021q garp stp llc mmc_spi crc7 of_mmc_spi spidev joydev hid_multitouch brcmfmac brcmutil sha256_generic libsha256 cfg80211 rfkill raspberrypi_hwmon snd_soc_bcm2835_i2s regmap_mmio snd_soc_core spi_bcm2835 snd_compress snd_pcm_dmaengine snd_bcm2835(C) bcm2835_codec(C) v4l2_mem2mem bcm2835_v4l2(C) snd_pcm bcm2835_isp(C) bcm2835_mmal_vchiq(C) vc_sm_cma(C) snd_timer videobuf2_dma_contig videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_common snd videodev mc i2c_gpio uio_pdrv_genirq i2c_algo_bit uio fixed i2c_dev ip_tables x_tables ipv6
[ 8083.806191] mmc2: SPI card removed
[ 8083.916871] mmc2: new SDHC card on SPI
[ 8084.030051] mmc2: SPI card removed
[ 8206.252698] mmc2: new SDHC card on SPI
[ 8206.295132] mmc2: SPI card removed
pi@raspberrypi:~ $ 

¿Can I suppose the SPI is working fine? I promise I only removed the SD card a few times, three or four!!

How can I continue?

3
  • 1
    I doubt anyone will read through the guides to work out what you have done. You need to add relevant information to your question. What is in your /boot/config.txt ? – joan Nov 4 '20 at 12:35
  • Yup I guess you are right! But it´s really long to explain every detail. Basically I did a core update to solve the SPI bug in the bmc2835 core. And after a few things more, mentioned in the linked post, but I can´t mention here because I don´have enough characters here I tried if I can read the SD with no success. My /boot/config.txt is: – RTDesigns Nov 4 '20 at 14:26
  • In /boot/config.txt I have this for SPI: dtparam=spi=on and at the end dtoverlay=mmc_spi – RTDesigns Nov 4 '20 at 14:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.