RetroBSD
http://retrobsd.org/

sd0: no SD/MMC card detected
http://retrobsd.org/viewtopic.php?f=5&t=37569
Page 1 of 1

Author:  briefkopf [ Sun Jul 03, 2016 11:24 am ]
Post subject:  sd0: no SD/MMC card detected

Hello

i'm new , if this is not the right place, please move this to the right forum ...

now the problem :
i have this Olimex Board :
https://www.olimex.com/Products/Duino/D ... e-hardware

and booting the image is failing :

Code:
2.11 BSD Unix for PIC32, revision G480 build 1:
     Compiled 2016-01-03 by root@goa.vak.ru:
     /website/retrobsd/build/retrobsd-sources/sys/pic32/duinomite
cpu: 795F512L 80 MHz, bus 80 MHz
oscillator: HS crystal, PLL div 1:2 mult x20
spi3: pins sdi=RF2/sdo=RF8/sck=RD15
uartusb: port USB, interrupt 45, console
sd0: port SPI3, pin cs=RD5
gpio1: portB, pins oi-oiiiiiiiiiiii
gpio2: portC, pins iiii------------
gpio3: portD, pins ----iiiiii-i---i
gpio4: portE, pins --------iiiiiiii
gpio5: portF, pins ----------iii-ii
gpio6: portG, pins ------iiii--ii--
adc: 15 channels
pwm: 5 channels
sd0: no SD/MMC card detected
panic: No root filesystem found!
no fs on dev 0/1
syncing disks... done
halted


yes, i know, this is NOT the newest code, but G482 is identical error
the SD-card image is transferred

can you advice me what to do next ?

Thanks Dieter

Author:  majenko [ Sun Jul 03, 2016 3:50 pm ]
Post subject:  Re: sd0: no SD/MMC card detected

I think you want to use the duinomite-emega kernel, not the duinomite kernel. It looks like the SD card enable pin has changed from B13 to G13 between the two boards, so you can't use the duinomite kernel on the duinomite-emega kernel.

Author:  briefkopf [ Mon Jul 04, 2016 2:46 pm ]
Post subject:  Re: sd0: no SD/MMC card detected

Hi

how can i get this kernel ? there is no kernel for e-Mega to download

Full Build Download Bytes Downloads
retrobsd-duinomite-2016-06-23.zip 5,505,480 11
retrobsd-fubarino-2016-06-23.zip 5,513,373 1
retrobsd-max32-2016-06-23.zip 5,489,724 4
retrobsd-maximite-2016-06-23.zip 5,505,173 2
retrobsd-maximite-color-2016-06-23.zip 5,505,381 3
retrobsd-picadillo-2016-06-23.zip 5,501,159 0
retrobsd-pinguino-micro-2016-06-23.zip 5,513,680 0
retrobsd-sdxl-2016-06-23.zip 5,513,198 1
retrobsd-snadpic-2016-06-23.zip 5,513,271 0
retrobsd-ubw32-2016-06-23.zip 5,505,590 2
--------------------------------
if i must compile the kernel, can you point me to the doku (i can't find it)

Thanks Dieter

Author:  majenko [ Thu Jul 07, 2016 11:27 am ]
Post subject:  Re: sd0: no SD/MMC card detected

Is that board not in the auto-compilation list? SERGE! :P

Here, try this hex file...

Attachments:
duinomite-emega.zip [124.84 KiB]
Downloaded 808 times

Author:  briefkopf [ Thu Jul 07, 2016 8:31 pm ]
Post subject:  Re: sd0: no SD/MMC card detected

Hello

thank you for the Code

but it gives this errors on startup (i have used the 490 sdimage):
Code:
2.11 BSD Unix for PIC32, revision G492 build 9:
     Compiled 2016-07-07 by matt@dell:
     /home/matt/git/retrobsd/sys/pic32/duinomite-emega
cpu: 795F512L 80 MHz, bus 40 MHz
oscillator: HS crystal, PLL div 1:2 mult x20

*** 0x9d01bc64: exception 'Address Load'
*** badvaddr = 0x00000003
*** stack frame at 80007f0c
        0 ffffffff       20        0
        5        0        0        0
        0        0        0        0
        0        0        0 80000084
        1        0        0        0
        0        0        0        0
        0 80000000 80007f90        0
 9d01bbfc        0        2 10000002
 9d01bc64 9d02540c 9d0254f8        2
       14        0        0        0
 9d0051e0 9d0237ac 9d026984        0
       40 9d0006b0 9d0005bc        0
        0        0        0        0
        0        0        0        0
 9d00409c 4c4d3fa6 e8c1ccf0 9d000008
 dcc52dba
*** registers:
                t0 =        0   s0 = 80000084   t8 =        0   lo =        0
at =        0   t1 =        0   s1 =        1   t9 =        0   hi =        2
v0 = ffffffff   t2 =        0   s2 =        0               status = 10000002
v1 =       20   t3 =        0   s3 =        0                cause = 10800010
a0 =        0   t4 =        0   s4 =        0   gp = 80000000  epc = 9d01bc64
a1 =        5   t5 =        0   s5 =        0   sp = 80007f90
a2 =        0   t6 =        0   s6 =        0   fp =        0
a3 =        0   t7 =        0   s7 =        0   ra = 9d01bbfc
panic: unexpected exception
halted


Thanks Dieter

Author:  majenko [ Thu Jul 07, 2016 11:14 pm ]
Post subject:  Re: sd0: no SD/MMC card detected

I am not sure my build setup is working right - it's been a while since I used it. We'll have to wait for Serge to add the kernel to the autobuild scripts.

Author:  vak [ Fri Jul 08, 2016 3:49 am ]
Post subject:  Re: sd0: no SD/MMC card detected

Unfortunately, I don't have eMega board to test it myself. That's why it's not in the autobuild list.

The crash looks strange. May be it's just some issue in Matt's build environment...
OK, I will add eMega to the autobuild script, and we'll see.

Author:  vak [ Fri Jul 08, 2016 5:12 am ]
Post subject:  Re: sd0: no SD/MMC card detected

Dieter,
Please try this file: retrobsd-duinomite-emega-2016-07-07.zip

Author:  briefkopf [ Fri Jul 08, 2016 5:56 pm ]
Post subject:  Re: sd0: no SD/MMC card detected

Hi

thank you for providing the code, but i get this after programming the PIC and writeing the new SD-Image to card :

Code:
2.11 BSD Unix for PIC32, revision G491 build 1:
     Compiled 2016-07-07 by vak@goa.vak.ru:
     /website/retrobsd/build/retrobsd-sources/sys/pic32/duinomite-emega
cpu: 795F512L 80 MHz, bus 40 MHz
oscillator: HS crystal, PLL div 1:2 mult x20
spi3: pins sdi=RF2/sdo=RF8/sck=RD15
uartusb: port USB, interrupt 45, console
sd0: port SPI3, pin cs=RG12
gpio0: portA, pins ii---ii-iiiiiiii
gpio1: portB, pins oiiiiiiiiiiiiiii
gpio2: portC, pins iiii-------iiio-
gpio3: portD, pins iiiiiiiiiiii---i
gpio4: portE, pins ------iiiiiiiiii
gpio5: portF, pins --ii---i--iiiiii
gpio6: portG, pins ii----iiii--iiii
adc: 15 channels
pwm: 5 channels
sd0: card_cmd timeout, cmd=37, addr=00000000, reply=ff
sd0: card_cmd timeout, cmd=29, addr=40000000, reply=ff
sd0: card_cmd timeout, cmd=37, addr=00000000, reply=ff
sd0: card_cmd timeout, cmd=29, addr=40000000, reply=ff
.... until forever

Author:  briefkopf [ Tue Jul 12, 2016 10:38 pm ]
Post subject:  Re: sd0: no SD/MMC card detected

Hi Serge

i have now installed a development environment on FreeBSD 10.3, and i get the same timeout
error messages :

sd0: card_cmd timeout, cmd=37, addr=00000000, reply=ff
sd0: card_cmd timeout, cmd=29, addr=40000000, reply=ff
sd0: card_cmd timeout, cmd=37, addr=00000000, reply=ff

- on 3 different SD-Cards (2, 4 , 8GB)
- checked the PINs
Code:
https://www.olimex.com/Products/Duino/Duinomite/DUINOMITE-eMEGA/resources/DUINOMITE-eMEGA_rev_B1_schematic.pdf


Kontrolliere PINs

SD #CS RG12 OK
MOSI RF8 OK
SCK RD15 OK
MISO RF2 OK

###########

what can i/you do now for compiling the code that will work ?

Thanks Dieter

Author:  vak [ Wed Jul 13, 2016 12:59 am ]
Post subject:  Re: sd0: no SD/MMC card detected

Hi Dieter,

I've double-checked the schematics. All the signals look correct. There is also a power enable signal for SD card at RG13 - it's also set properly. I've also compared the kernel configuration with Duinomite board (which works fine). The only possible issue I can see is the bus frequency parameter. For Duinomite it is set as:
Code:
options "BUS_KHZ=80000"    # Frequency of peripheral bus
But for eMega the value is 40000, which seems suspicious. It may result in too high SPI clock when detecting the card. Bus frequency is actually configured by bootloader (via DEVCFG bits). I'm pretty much sure both Duinomite and eMega use identical bootloader, so bus frequency must be the same.

There were also some mismatches in gpio configuration, but it should not influence SD card.

I've modified the kernel configuration for eMega. Please, try the kernel from revision r492.

--Serge

Author:  briefkopf [ Wed Jul 13, 2016 10:42 pm ]
Post subject:  Re: sd0: no SD/MMC card detected

Hi Serge

some good news , some bad news ...

Code:
your compiling :

2.11 BSD Unix for PIC32, revision G492 build 1:
     Compiled 2016-07-12 by [color=#00BF00]vak@goa.vak.ru[/color]:
     /website/retrobsd/build/retrobsd-sources/sys/pic32/duinomite-emega
cpu: 795F512L 80 MHz, bus 40 MHz
oscillator: HS crystal, PLL div 1:2 mult x20
spi3: pins sdi=RF2/sdo=RF8/sck=RD15
uartusb: port USB, interrupt 45, console
sd0: port SPI3, pin cs=RG12
gpio0: portA, pins ii---ii-iiiiiiii
gpio1: portB, pins oiiiiiiiiiiiiiii
gpio2: portC, pins iiii-------iiio-
gpio3: portD, pins -iiiiiiiiiiiiiii
gpio4: portE, pins ------iiiiiiiiii
gpio5: portF, pins --ii------iii-ii
gpio6: portG, pins ii----iiii--iiii
adc: 15 channels
pwm: 5 channels
sd0: function groups 3/1/1/1/1/1, max current 100 mA
sd0: type SDHC, size 7676928 kbytes, speed 20 Mbit/sec
sd0a: partition type b7, sector 2, size 102400 kbytes
sd0b: partition type b8, sector 204802, size 2048 kbytes
sd0c: partition type b7, sector 208898, size 102400 kbytes
phys mem  = 128 kbytes
user mem  = 96 kbytes
root dev  = (0,1)
swap dev  = (0,2)
root size = 102400 kbytes
swap size = 2048 kbytes
*** 0x7f00c7a4: fsck: bus error
/: file system full

/: write failed, file system full
/etc/rc: 3 Bus error
--- Unknown error in fsck
/: file system full
July 12 18:00:39 init: /etc/rc failed: status = 0x100
erase ^?, kill ^U, intr ^C

# df
Filesystem  1K-blocks     Used    Avail Capacity  Mounted on
root           101999   101999        0   100%    /
#
-------------
# rm fsck.core    <<< my reaction
# df
Filesystem  1K-blocks     Used    Avail Capacity  Mounted on
root           101999   101941       58    99%    /

then kernel panik, after that, no boot possible

#########################################
00:28 14.07.2016

new compiled all, / is now 512MB

-----------

2.11 BSD Unix for PIC32, revision G492 build 1:
     Compiled 2016-07-13 by root@freebsd-10.3:  <<< it's my dev-environment
     /retrobsd/sys/pic32/duinomite-emega
cpu: 795F512L 80 MHz, bus 40 MHz    <<< strange, should be 80Mhz ?
oscillator: HS crystal, PLL div 1:2 mult x20
spi3: pins sdi=RF2/sdo=RF8/sck=RD15
uartusb: port USB, interrupt 45, console
sd0: port SPI3, pin cs=RG12
gpio0: portA, pins ii---ii-iiiiiiii
gpio1: portB, pins oiiiiiiiiiiiiiii
gpio2: portC, pins iiii-------iiio-
gpio3: portD, pins -iiiiiiiiiiiiiii
gpio4: portE, pins ------iiiiiiiiii
gpio5: portF, pins --ii------iii-ii
gpio6: portG, pins ii----iiii--iiii
adc: 15 channels
pwm: 5 channels
sd0: function groups 3/1/1/1/1/1, max current 100 mA
sd0: type SDHC, size 7676928 kbytes, speed 20 Mbit/sec
sd0a: partition type b7, sector 2, size 512000 kbytes
sd0b: partition type b8, sector 1024002, size 204800 kbytes
sd0c: partition type b7, sector 1433602, size 102400 kbytes
phys mem  = 128 kbytes
user mem  = 96 kbytes
root dev  = (0,1)
swap dev  = (0,2)
root size = 512000 kbytes
swap size = 204800 kbytes
panic: init died     <<<<<<< why ???
syncing disks... done
halted
#################
then , no more reboots are possible, maybe the SD-Card has corrupt Filesystem
but it's too late ... :-)


Author:  majenko [ Wed Jul 13, 2016 10:55 pm ]
Post subject:  Re: sd0: no SD/MMC card detected

Re-image your SD card.

Author:  Pito [ Thu Jul 14, 2016 9:33 pm ]
Post subject:  Re: sd0: no SD/MMC card detected

Start with slower SDcard speeds, like 8-10Mbit..

Author:  briefkopf [ Thu Jul 21, 2016 1:53 pm ]
Post subject:  Re: sd0: no SD/MMC card detected

Hello

i got a new (slower?, it show always 20MBit, who knows ...) SD-Card, and now all things are great.
I can login and it works, you can close the thread

Code:
2.11 BSD Unix for PIC32, revision G498 build 2:
     Compiled 2016-07-16 by root@freebsd-10.3:
     /retrobsd/sys/pic32/duinomite-emega
cpu: 795F512L 80 MHz, bus 80 MHz
oscillator: HS crystal, PLL div 1:2 mult x20
spi3: pins sdi=RF2/sdo=RF8/sck=RD15
uartusb: port USB, interrupt 45, console
sd0: port SPI3, pin cs=RG12
gpio0: portA, pins ii---ii-iiiiiiii
gpio1: portB, pins oiiiiiiiiiiiiiii
gpio2: portC, pins iiii-------iiio-
gpio3: portD, pins -iiiiiiiiiiiiiii
gpio4: portE, pins ------iiiiiiiiii
gpio5: portF, pins --ii------iii-ii
gpio6: portG, pins ii----iiii--iiii
adc: 15 channels
pwm: 5 channels
sd0: function groups 3/1/1/1/1/1, max current 100 mA
sd0: type SDHC, size 3887104 kbytes, speed 20 Mbit/sec
sd0a: partition type b7, sector 2, size 102400 kbytes
sd0b: partition type b8, sector 204802, size 2048 kbytes
sd0c: partition type b7, sector 208898, size 102400 kbytes
phys mem  = 128 kbytes
user mem  = 96 kbytes
root dev  = (0,1)
swap dev  = (0,2)
root size = 102400 kbytes
swap size = 2048 kbytes
/dev/sd0a: 1445 files, 12377 used, 89622 free
Starting daemons: update cron


2.11 BSD UNIX (pic32) (console)

login: root
Password:
Welcome to RetroBSD!
erase ^?, kill ^U, intr ^C

# pwd
/root
# ls -l
total 1
-rw-rw-r--  1 root          107 Jul 13 17:05 .profile
# df
Filesystem  1K-blocks     Used    Avail Capacity  Mounted on
/dev/sd0a      101999    12380    89619    12%   

Author:  wiz [ Fri Jul 22, 2016 6:08 pm ]
Post subject:  Re: sd0: no SD/MMC card detected

Hi All,

Gotta wonder what the real problem was/is?

Maybe previous SD's protocol is somehow different?

A low level tool to document the details and timing of trying to talk to the earlier SD would doubtless be a very good idea. Maybe a mode in the low level SD handler that can easily be invoked when needed and does not require a recompile.

From what I see, there is quite a feature war going on. Many devices most probably have subtle and not so subtle differences.

IMHO - We need to make it easy to spot these.

Wiz

Author:  briefkopf [ Wed Jul 27, 2016 3:46 pm ]
Post subject:  Re: sd0: no SD/MMC card detected

Hello

i have investigated the working/non working SD-Cards with this Information, but it is not clear, why the cards so work/not work

CID-decoder
http://goughlui.com/2014/01/02/project-read-collect-decode-sd-card-cid-register-data/
This works NOT with regular USB-SD-Card-Readers, only my laptop with build-in PCIe cardreader can read the CID.

I have attached a PDF with the cards.

Is there a low-level-tool to check the timing of SD-Cards ?

Dieter

Attachments:
File comment: Results of decoding CID
SD-Cards.pdf [22.58 KiB]
Downloaded 806 times

Author:  wiz [ Wed Jul 27, 2016 7:10 pm ]
Post subject:  Re: sd0: no SD/MMC card detected

Hi Briefkopf,

Hmmm.... Nice list :).

There is no low level tool that I am aware of. If we had dynamic loadable CPU modules, we could create a logging version of the SD driver. I actually have an abbreviated version of a loadable CPU module running on one of my retrobsd systems. Works OK. Requires a custom compiled version of the kernel.

I guess the ideal tool would be another system that monitors the SD <-> communications and logs it. A smart logic analyzer I guess. Maybe Majenko has or can suggest one? A program on the PIC itself would be best.

I recently read that the AR9331 doesn't do USB 1.x reliably, but does do USB 2 OK??!! So if you use the proper hub [now how do you tell?] things will work OK [ maybe? ] :).

Being a product designer I am especially tuned into problems like this. They can be real show stoppers. You customer buys a new card and it doesn't work. And then you get stuck trying to figure out how to help them.

Lots of fun :).

Wiz

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/