SD cards which don't work with MMFS/SmartSPI/etc.

for bbc micro/electron hardware, peripherals & programming issues (NOT emulators!)
Post Reply
steve3000
Posts: 1886
Joined: Sun Nov 25, 2012 12:43 am
Contact:

SD cards which don't work with MMFS/SmartSPI/etc.

Post by steve3000 » Wed May 16, 2018 4:43 pm

Is it normal to find that some SD cards don't work with any of the MMFS/SmartSPI/etc. ROMs using a 99p user port interface on the beeb?

I recently got a couple of brand new, but very low capacity, SD cards (128mb) bundled with parts for another project. I was going to stick them in the back of my spares drawer as I couldn't think of a good use for them, but then thought why not use these on my two beebs and free up the 2gb SD cards I'm using at the moment. :)

The 128mb cards worked fine on my windows laptop, tested, formatted, tested again... So I popped BEEB.MMB onto them, and plugged into my 99p user port interface, only to find they aren't recognised on the beeb with any of the three different ROMs I've tried: MMFS 1.40, Smart SPI 1613, SuperMMC 0.9. (Just get the error "Card?").

My original 2gb cards work fine with all three ROMs, and I've checked the format is correct (FAT). Picture of the cards here:
tn_20180515_233252.jpg
Any thoughts?

duikkie
Posts: 2885
Joined: Fri Feb 07, 2014 3:28 pm
Contact:

Re: SD cards which don't work with MMFS/SmartSPI/etc.

Post by duikkie » Wed May 16, 2018 5:25 pm

which cards , brand and other marks ?

there are some sd cards that don't have the SPI protocol
only the other protocol ( more lines, don't know the name so)

that's why the will work with PC because
the pc can work with the two protocols

bbc (our mmc/mmb card reader ) works only under SPI proctocol

all other rom work only with SPI procotol ( smart spi, is the only one that tell it in the rom name :)

duikkie
Posts: 2885
Joined: Fri Feb 07, 2014 3:28 pm
Contact:

Re: SD cards which don't work with MMFS/SmartSPI/etc.

Post by duikkie » Wed May 16, 2018 5:35 pm

There are two bus protocols defined for SD Cards. The default mode is native SD mode but the card
can be configured to use a slower SPI mode. Protocol selection is done during the first reset command
after power up. The SD Card powers up in SD mode. To switch the card to SPI mode, the CS signal
must be asserted while the host issues a reset command to the card. Once a particular protocol is
configured, it cannot be changed while power is applied. The only way to switch between protocol
modes is to do a power cycle.
Information in the remaining sections are for normal SD mode operation. Differences between SD
mode and SPI mode are summarized in Section 5.0.

so we have sd mode and SPI mode

some cards have only sd mode ( cheaper to make )

steve3000
Posts: 1886
Joined: Sun Nov 25, 2012 12:43 am
Contact:

Re: SD cards which don't work with MMFS/SmartSPI/etc.

Post by steve3000 » Wed May 16, 2018 5:48 pm

Thanks duikkie, very useful summary.
duikkie wrote:which cards , brand and other marks ?
I only have what is in the photo, no brand or other marks.

So this would be SD only then, no SPI, that's a shame. :(

Hopefully not the start of a new trend in SD only cards...

User avatar
DutchAcorn
Posts: 1890
Joined: Fri Mar 21, 2014 9:56 am
Location: Maarn, Netherlands
Contact:

Re: SD cards which don't work with MMFS/SmartSPI/etc.

Post by DutchAcorn » Wed May 16, 2018 6:22 pm

Did you use the SD card formatter to format them? Modern versions of windows are known to have issues with formatting SD cards?
Paul

duikkie
Posts: 2885
Joined: Fri Feb 07, 2014 3:28 pm
Contact:

Re: SD cards which don't work with MMFS/SmartSPI/etc.

Post by duikkie » Wed May 16, 2018 7:13 pm

aliexpress ? maybe there is a pc software program that can read more factory data off the micro sd card ?

duikkie
Posts: 2885
Joined: Fri Feb 07, 2014 3:28 pm
Contact:

Re: SD cards which don't work with MMFS/SmartSPI/etc.

Post by duikkie » Wed May 16, 2018 7:15 pm

i don't think that will help ? the card must responce to calls , if wrong format . it gives an other error
was it not wrong format or so
DutchAcorn wrote:Did you use the SD card formatter to format them? Modern versions of windows are known to have issues with formatting SD cards?

steve3000
Posts: 1886
Joined: Sun Nov 25, 2012 12:43 am
Contact:

Re: SD cards which don't work with MMFS/SmartSPI/etc.

Post by steve3000 » Wed May 16, 2018 7:19 pm

DutchAcorn wrote:Did you use the SD card formatter to format them? Modern versions of windows are known to have issues with formatting SD cards?
Yep, that's what I used...

Not sure how to get more information off the card though, is there a tool to extract information?

duikkie
Posts: 2885
Joined: Fri Feb 07, 2014 3:28 pm
Contact:

Re: SD cards which don't work with MMFS/SmartSPI/etc.

Post by duikkie » Wed May 16, 2018 8:28 pm

i think you have to look at pc software :)
on the smart-spi make ssd , you can maybe alter the smart-spi rom so that after it test sd card with cmd0
you get answer cmd0 give responce ???

but there are sd card without spi mode , and if no spi mode it will never work on bbc :(

steve3000 wrote:
DutchAcorn wrote:Did you use the SD card formatter to format them? Modern versions of windows are known to have issues with formatting SD cards?
Yep, that's what I used...

Not sure how to get more information off the card though, is there a tool to extract information?

User avatar
hoglet
Posts: 7500
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: SD cards which don't work with MMFS/SmartSPI/etc.

Post by hoglet » Wed May 16, 2018 8:52 pm

Steve,

There is a debug build of MMFS that (U/MMFSDBG.rom) that logs the SPI commands sent to the card, and the responses.

That might help us see where things are messing up.

Dave

steve3000
Posts: 1886
Joined: Sun Nov 25, 2012 12:43 am
Contact:

Re: SD cards which don't work with MMFS/SmartSPI/etc.

Post by steve3000 » Wed May 16, 2018 10:38 pm

hoglet wrote:There is a debug build of MMFS that (U/MMFSDBG.rom) that logs the SPI commands sent to the card, and the responses.
Thanks Dave - just tried this, and upon issuing *CARD, I get about 40 rows of "FF400000000095:FF" before it returns the "Card?" error...

Guess that means no SPI?

User avatar
topcat96
Posts: 173
Joined: Thu Jun 26, 2008 12:17 am
Location: Somewhere wonderful!
Contact:

Re: SD cards which don't work with MMFS/SmartSPI/etc.

Post by topcat96 » Wed May 16, 2018 10:44 pm

Have you checked that the 128mb cards are real and not those fake capacity ones that lurk on places like Ebay and Alibaba?

Some handy tools here to check if unsure ...

https://www.geckoandfly.com/22803/detec ... -ssd-disk/
Image

User avatar
simoni
Posts: 430
Joined: Wed May 25, 2016 6:18 pm
Contact:

Re: SD cards which don't work with MMFS/SmartSPI/etc.

Post by simoni » Thu May 17, 2018 4:12 am

A lot of the time many of the cards people list as 'fake' or 'don't support SPI' are in fact cards that work fine, but require closer adherence to the communication specs for SD cards. If you look at the Chan FAT FS project examples you'll see the recommended "works with almost anything" design:
avr_cfmm2.png
If you look at the schematic you'll notice a MOSFET in there which can power down the card. Some cards only respond to the SPI initialisation sequence direct from power up. Pull-ups on the various lines are also recommended.

If your hardware consists of 2 quid's worth of resistors (or similar) acting as level converters with no power control - expect issues.

As another note, most cards over 32Gb require exFAT support rather than FAT. This can also create problems.

I'm not that familiar with the MMFS style cards/software, but I thought these points might be interesting.

steve3000
Posts: 1886
Joined: Sun Nov 25, 2012 12:43 am
Contact:

Re: SD cards which don't work with MMFS/SmartSPI/etc.

Post by steve3000 » Thu May 17, 2018 5:52 am

topcat96 wrote:Have you checked that the 128mb cards are real and not those fake capacity ones that lurk on places like Ebay and Alibaba?
Great thought, and useful tools thanks, but i don't think anyone is trying to fake a 128mb (not gb) card. If anything this would be a larger capacity card cut down to 128mb as I don't think you can get smaller capacities than this. Either way, as above I fully tested these on the PC and had no issues filing the cards up using a test tool and the data repeatedly verified ok.
simoni wrote:If you look at the schematic you'll notice a MOSFET in there which can power down the card. Some cards only respond to the SPI initialisation sequence direct from power up. Pull-ups on the various lines are also recommended.

If your hardware consists of 2 quid's worth of resistors (or similar) acting as level converters with no power control - expect issues.

As another note, most cards over 32Gb require exFAT support rather than FAT. This can also create problems.
Great points, thanks. The card is only 128mb and formatted as FAT, so this shouldn't be the issue. The power control is interesting, I hadn't realised this difference. The interface seems a little more complex than just resistors, but likely just uses level shifters, so not sure if it has the power control. I'm sure Dave or duikkie would know, and if their software makes use of this?

Post Reply