rownyr
Posts: 41
Joined: Wed Jul 11, 2012 1:25 am

Additional SD card slot

Sat Apr 12, 2014 4:05 pm

It's great that module has 4GB eMMC on it, but is it possible to additionally support 1 (micro)SD card reader through the module pins?

6677
Posts: 383
Joined: Wed Mar 14, 2012 9:23 pm

Re: Additional SD card slot

Sat Apr 12, 2014 6:12 pm

The eMMC uses the pins previously used for the SD card. You could utilise an SPI attached SD card although a custom driver would be needed for the host OS or you could add a USB card reader as the only 2 options I can think of

Dutch_Master
Posts: 362
Joined: Sat Jul 27, 2013 11:36 am

Re: Additional SD card slot

Sat Apr 12, 2014 7:31 pm

Using the UART and a suitably programmed micro-controller you may get some result. Intel, Microchip, Amtel, take your pick ;) Most likely considerably slower then the SPI interface, but probably sufficient for static data. Variables would be better off in the eMMC.

Remember, this not an "out-of-the-box" design, so you need to think out-of-the-box too! :ugeek: :idea:

User avatar
Forrrge
Posts: 120
Joined: Fri Apr 27, 2012 6:07 am
Location: Gateshead, UK.

Re: Additional SD card slot

Wed May 07, 2014 9:43 am

Hi,

I've just been thinking about this :)

What could be really useful if there was an option to have say 3 micro SD slots, which you could switch between as the boot sd. That way you could have 3 operating systems that you could easily swap between.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26886
Joined: Sat Jul 30, 2011 7:41 pm

Re: Additional SD card slot

Wed May 07, 2014 10:12 am

Forrrge wrote:Hi,

I've just been thinking about this :)

What could be really useful if there was an option to have say 3 micro SD slots, which you could switch between as the boot sd. That way you could have 3 operating systems that you could easily swap between.
Not sure what use that would be on an embedded system though, which is what the CM is for.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

Dutch_Master
Posts: 362
Joined: Sat Jul 27, 2013 11:36 am

Re: Additional SD card slot

Wed May 07, 2014 10:12 am

The slots and board space they require cost money. And it isn't too difficult to swap SD cards, is it? :roll:

User avatar
GTR2Fan
Posts: 1601
Joined: Sun Feb 23, 2014 9:20 pm
Location: South East UK

Re: Additional SD card slot

Wed May 07, 2014 10:44 am

Dutch_Master wrote:The slots and board space they require cost money. And it isn't too difficult to swap SD cards, is it? :roll:
Neither is it difficult to run multiple OSes from the same SD card.
Pi2B Mini-PC/Media Centre: ARM=1GHz (+3), Core=500MHz, v3d=500MHz, h264=333MHz, RAM=DDR2-1200 (+6/+4/+4+schmoo). Sandisk Ultra HC-I 32GB microSD card on '50=100' OCed slot (42MB/s read) running Raspbian/KODI16, Seagate 3.5" 1.5TB HDD mass storage.

User avatar
rpdom
Posts: 17454
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Additional SD card slot

Wed May 07, 2014 10:52 am

GTR2Fan wrote:
Dutch_Master wrote:The slots and board space they require cost money. And it isn't too difficult to swap SD cards, is it? :roll:
Neither is it difficult to run multiple OSes from the same SD card.
The Compute Module doesn't have an SD card. It has built-in emmc memory instead which can't be swapped. It may be possible to put different OSes on it, but it's unlikely that will be the main use of a CM.

User avatar
GTR2Fan
Posts: 1601
Joined: Sun Feb 23, 2014 9:20 pm
Location: South East UK

Re: Additional SD card slot

Wed May 07, 2014 10:56 am

rpdom wrote:The Compute Module doesn't have an SD card. It has built-in emmc memory instead which can't be swapped. It may be possible to put different OSes on it, but it's unlikely that will be the main use of a CM.
I know. I was just carrying on the earlier reasoning that if an SD card interface were to be built by someone for the CM, one slot would almost definitely suffice.
Pi2B Mini-PC/Media Centre: ARM=1GHz (+3), Core=500MHz, v3d=500MHz, h264=333MHz, RAM=DDR2-1200 (+6/+4/+4+schmoo). Sandisk Ultra HC-I 32GB microSD card on '50=100' OCed slot (42MB/s read) running Raspbian/KODI16, Seagate 3.5" 1.5TB HDD mass storage.

fruitoftheloom
Posts: 23917
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Additional SD card slot

Wed May 07, 2014 10:57 am

rpdom wrote:
GTR2Fan wrote:
Dutch_Master wrote:The slots and board space they require cost money. And it isn't too difficult to swap SD cards, is it? :roll:
Neither is it difficult to run multiple OSes from the same SD card.
The Compute Module doesn't have an SD card. It has built-in emmc memory instead which can't be swapped. It may be possible to put different OSes on it, but it's unlikely that will be the main use of a CM.
Not merit what-so-ever to having a SDCard slot, just have a multiboot system, with the boot files on the eMMC and the Distros on a Hard Disk Drive..........
Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot) RaspiOS64 ARM64
Asus ChromeBox 3 Celeron is my other computer...

User avatar
Gert van Loo
Posts: 2487
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: Additional SD card slot

Wed May 07, 2014 2:10 pm

There is a second SD card interface on the Pi GPIO pins.
See the GPIO alternate function table, pins 22-27. (data sheet page 102)
It is not as fast as the primary (eMMC) interface but it DOES work.
So, yes, you can connect an SD-card alongside the eMMC.

arm2
Posts: 253
Joined: Thu Dec 15, 2011 3:46 pm

Re: Additional SD card slot

Wed May 07, 2014 9:35 pm

Hi Gert. Why slower?
Even another eMMC chip was used?
I believe even Class 10 SD cards will be slower than eMMC.
I'm guessing the extra connection or track length may have something to do with it

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1571
Joined: Sat Sep 10, 2011 11:43 am

Re: Additional SD card slot

Thu May 08, 2014 5:38 am

Gert is thinking about a completely different (i.e. not even pretending to be SDHCI compatible) hardware interface, for which there is a driver (probably released somewhere, just not sure where) which had a whole host of bugs that need fixing first!

So yes it is possible, just not simple...

Gordon
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

arm2
Posts: 253
Joined: Thu Dec 15, 2011 3:46 pm

Re: Additional SD card slot

Thu May 08, 2014 8:51 pm

GSH: I'm confused.
Is there a second SD bus on CM 200pin connector?
Are you saying the second SD bus is non standard?
What is "not simple" about it?
Or am I misunderstanding something?

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2428
Joined: Thu Jul 11, 2013 2:37 pm

Re: Additional SD card slot

Thu May 08, 2014 9:41 pm

There are two peripheral blocks in BCM2835 that can be used to talk to SD cards (or SDIO devices, with a bit of hackery). The eMMC is connected to the fully-featured SD-HC interface, but a legacy interface that has lower throughput and a bit of a hobbled feature set is still available.

These two interfaces can be exposed on several sets of GPIO pins. On the SODIMM there is the possibility to access the legacy controller through one of the subsets.

There are a number of not insignificant barriers to using the legacy controller:
- It's quite buggy
- There is no publicly released documentation for it
- I don't believe the pinmux settings for it are available
Rockets are loud.
https://astro-pi.org

User avatar
PiModules
Posts: 96
Joined: Sun Mar 03, 2013 9:20 pm
Location: Athens -Greece
Contact: Website

Re: Additional SD card slot

Sun Jun 22, 2014 12:18 am

Hi,

from the manual I read

"Also note that once booted over USB, BCM2835 needs to re-enable the eMMC device (by releasing EMMC_DISABLE_N) to allow access to it as a mass storage device"


So, as far I understand you can boot from the USB memory stick, but after that you need to switch back the eMMC?
My questions are:
What happen if I not switch back to the eMMC, the RPiCM will still use the USB memory stick or not.
Why do I need to switch back to eMMC ? I suppose that if the RPiCM booted once from the USB memory stick should continue use it as a mass storage device? Is it possible ? or not ?

On additional question, how fast is the reading from the USB memory stick, faster or slower than the eMMC ?

Thank you for your clarifications
My Warmest Regards
Pi Master

User avatar
rpdom
Posts: 17454
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Additional SD card slot

Sun Jun 22, 2014 7:14 am

PiModules wrote:So, as far I understand you can boot from the USB memory stick, but after that you need to switch back the eMMC?
Not quite.

The CM cannot boot from a USB memory stick or any other storage device.
It can be booted from another computer using the USB connection by squirting a boot image into it.
The only (currently) available bootable image contains a driver that makes the eMMC appear as a USB mass storage device, so you can format it and copy over the "real" boot code.

As I understand it, the CM tries to boot from eMMC first, then tries USB. Obviously if you have bad bootcode on the eMMC it will try to boot that and the unit will appear to be bricked. However there is an option on the CM to temporarily disable the eMMC which forces an attempt to boot from a USB host. Then the eMMC is enabled again so you can correct the code. Very neat idea :)

User avatar
PiModules
Posts: 96
Joined: Sun Mar 03, 2013 9:20 pm
Location: Athens -Greece
Contact: Website

Re: Additional SD card slot

Sun Jun 22, 2014 12:14 pm

So, it means as far you like you can work on your PC "side" booting and testing code, and when you finished, you can boot from PC again, and after that switch to eMMC, correct the final code on it, remove PC cable, and boot again from the eMMC running the "final" version of your code from the eMMC. It seems that the booting from the PC is a kind of debugging mode.
M'I right?

Sorry for bothering, but from tomorrow I will have my own ordered RPiCM and start testing. But, until then I'm trying to clarify all thinks in my mind.

Thank you for your answers
Warmest Regards
Pi Master

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: Additional SD card slot

Tue Jul 08, 2014 9:02 pm

jdb wrote:There are two peripheral blocks in BCM2835 that can be used to talk to SD cards (or SDIO devices, with a bit of hackery). The eMMC is connected to the fully-featured SD-HC interface,
...on GPIO48 -> GPIO53
but a legacy interface that has lower throughput and a bit of a hobbled feature set is still available.
...on GPIO22 -> GPIO27

http://elinux.org/RPi_BCM2835_GPIOs

User avatar
raspitrick
Posts: 29
Joined: Fri Jun 07, 2013 12:49 pm
Contact: Website

Re: Additional SD card slot

Fri Oct 10, 2014 8:08 am

Sorry to reopen this topic again, but this is important to me as I need to design a CM baseboard including an SD card slot for (low-throughput) logging purposes.

Which of the three possibilities to design and address a low-throughput SD card slot are viable and supported by Broadcom, the Foundation, and Raspbian for a commercial medium-term project (release spring 2015):

- attach via a supported USB media controller (increases BOM, cost, and energy balance, blocks USB for other uses)
- attach via SPI (kernel/driver support unclear)
- attach via SD1_* (aka "hobbled controller", kernel/driver support unclear)

Is there any official statement from the Foundation I can base my design decisions on?
Thanks for your patience!
RasPiGNSS - a precision GPS+GLONASS+SBAS expansion board (drfasching.com/products/gnss/raspignss)

Killertechno
Posts: 208
Joined: Wed Jan 02, 2013 8:28 am

Re: Additional SD card slot

Tue Sep 01, 2020 10:57 am

Hi to all users!

I added secondary SD card to CM1 (not working) on pins GPIO34-GPIO39.

sdio34-overlay.dts:

Code: Select all

/dts-v1/;
/plugin/;

/* Enable SDIO from MMC interface via GPIOs 22-27. Includes sdhost overlay. */

/{
compatible = "brcm,bcm2708";

fragment@0 {
target = <&mmc>;
sdio_mmc: __overlay__ {
pinctrl-names = "default";
pinctrl-0 = <&sdio_pins>;
non-removable;
bus-width = <4>;
brcm,overclock-50 = <0>;
status = "okay";
};
};

fragment@1 {
target = <&gpio>;
__overlay__ {
sdio_pins: sdio_pins {
brcm,pins = <22 23 24 25 26 27>;
brcm,function = <7>; /* ALT3 = SD1 */
brcm,pull = <0 2 2 2 2 2>;
};
};
};

__overrides__ {
poll_once = <&sdio_mmc>,"non-removable?";
bus_width = <&sdio_mmc>,"bus-width:0";
sdio_overclock = <&sdio_mmc>,"brcm,overclock-50:0";
};
}; 
sudo dtc -@ -I dts -O dtb -o sdio34.dtbo sdio34-overlay.dts
sudo mv sdio34.dtbo /boot/overlays/


On /boot/config.txt:

Code: Select all

dtoverlay=sdio,poll_once=off

I can only see primary SD card:

Code: Select all

pi@raspberrypi:~$ lsblk
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
mmcblk0      179:0    0  3.7G  0 disk
├─mmcblk0p1  179:1    0 43.9M  0 part /boot
└─mmcblk0p2  179:2    0    2G  0 part /
mmcblk0boot0 179:32   0    4M  1 disk
mmcblk0boot1 179:64   0    4M  1 disk
mmcblk0rpmb  179:96   0  512K  0 disk
pi@raspberrypi:~$
Am I missing something about alternate pins on SDIO?
I have no mmc1 messages on dmesg.....
Thanks.
Attachments
micro_SD.jpg
micro_SD.jpg (157.84 KiB) Viewed 297 times

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 3168
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Additional SD card slot

Tue Sep 01, 2020 11:13 am

1. Your overlay might work, but it is at least showing its age a bit ("brcm,bcm2708", having its own sdio_overclock parameter, etc.) Actually, failing to disable the new mmc-nr node might be a problem.
2. Instead of using your new overlay (sdio34) you are loading the existing one (sdio).
3. The existing overlay already includes everything you need:

Code: Select all

pi@raspberrypi:~$ dtoverlay -h sdio
Name:   sdio

Info:   Selects the bcm2835-sdhost SD/MMC driver, optionally with overclock,
        and enables SDIO via GPIOs 22-27. An example of use in 1-bit mode is
        "dtoverlay=sdio,bus_width=1,gpios_22_25"

Usage:  dtoverlay=sdio,<param>=<val>

Params: sdio_overclock          SDIO Clock (in MHz) to use when the MMC
                                framework requests 50MHz

        poll_once               Disable SDIO-device polling every second
                                (default on: polling once at boot-time)

        bus_width               Set the SDIO host bus width (default 4 bits)

        gpios_22_25             Select GPIOs 22-25 for 1-bit mode. Must be used
                                with bus_width=1. This replaces the sdio-1bit
                                overlay, which is now deprecated.

        gpios_34_37             Select GPIOs 34-37 for 1-bit mode. Must be used
                                with bus_width=1.

        gpios_34_39             Select GPIOs 34-39 for 4-bit mode. Must be used
                                with bus_width=4 (the default).


PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 3168
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Additional SD card slot

Tue Sep 01, 2020 11:16 am

Oh, and congratulations on reviving a thread that is almost as old as the length of time I've been at Raspberry Pi. :roll:

Killertechno
Posts: 208
Joined: Wed Jan 02, 2013 8:28 am

Re: Additional SD card slot

Tue Sep 01, 2020 1:02 pm

I avoided to open new discussion with same topic.

In my overlay I have only these parameters:

Code: Select all

Params: sdio_overclock          SDIO Clock (in MHz) to use when the MMC
                                framework requests 50MHz

        poll_once               Disable SDIO-device polling every second
                                (default on: polling once at boot-time)

        bus_width               Set the SDIO host bus width (default 4 bits)

I used image I already found on CM1.
So should I upgrade system, just this?

Code: Select all

pi@raspberrypi:/boot/overlays $ cat /etc/issue
Raspbian GNU/Linux 9 \n \l
pi@raspberrypi:/boot/overlays $ uname -a
Linux raspberrypi 4.14.79+ #1159 Sun Nov 4 17:28:08 GMT 2018 armv6l GNU/Linux

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 3168
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Additional SD card slot

Tue Sep 01, 2020 1:07 pm

You're won't get any support for 4.14 from me - we're shipping 5.4 now.

Return to “Compute Module”