Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make SD card accessible over MSC, as CIRCUITPY, or as a dir in CIRCUITPY #1764

Closed
bobricius opened this issue Apr 8, 2019 · 7 comments
Closed
Milestone

Comments

@bobricius
Copy link

Hi, I am just interesting if is possible create device without spiflash.
Just MCU+SD card and run code directly from card and also save files to card.

Thanks

@dhalbert
Copy link
Collaborator

dhalbert commented Apr 8, 2019

Yes, you can import code or read data from an SD card, but, there is no mechanism for accessing the card via the USB port on the device. That is, there's no passthrough from USB to the card filesystem.

@bobricius
Copy link
Author

And is possible modify cpython to access to SD card, without use internal flash and spiflash ? ... simple device samd21e18+microsd card slot. I am just interesting about this possibility, SD card with fat system is more standardized and have unlimited storage.

@dhalbert
Copy link
Collaborator

dhalbert commented Apr 8, 2019

The firmware has to live in internal flash, and there needs to be some code to set up using the SD card (though that could be built into the the firmware).

In general, having a large SD card doesn't necessarily help a lot, because the size of programs is limited by the size of RAM, especially on a SAMD21 (32kB). If you have large data files (e.g., data you are streaming out), then the SD card can help. But having 2MB of CIRCUITPY is not that limiting. It's also faster than the SD card, though I couldn't quote you numbers right now.

The small SPI flash chips are also very inexpensive: cheaper than an SD card socket + the cost of a card, and take less board space.

@bobricius
Copy link
Author

Thanks for fast answer.
I know that firmware need live internal flash, I just asking if is possible replace spiflash with sd card.
If I understand, it is possible but spi flash is better ;)

@dhalbert dhalbert closed this as completed Apr 8, 2019
@BriscoeTech
Copy link

there is no mechanism for accessing the card via the USB port on the device. That is, there's no passthrough from USB to the card filesystem

Hello dhalbert,

What would need to be done to enable this functionality? It seems like the plumbing is already there since it works with spi flash chips already.

I have some projects that need to be enclosed in project boxes, yet the sd card will be full of sounds and config files that need to be edited from time to time. It would be great to do this over usb without having to open the boxes back up.

@dhalbert
Copy link
Collaborator

dhalbert commented Apr 20, 2019

CIRCUITPY is a single filesystem volume. The SD card is another storage volume, and so isn't visible inside CIRCUITPY.

It is conceivable we could do this, but we'd have to think about it. One issue is whether the SD card volume would be readonly. To use it safely while the program is running, it would need to be mounted readonly to the CircuitPython code, in case you were editing it over USB at the same time.

We can reopen this as a long-term feature. I'll discuss it with the other core developers. There may be some fundamental stumbling block I have forgotten.

@dhalbert dhalbert reopened this Apr 20, 2019
@dhalbert dhalbert changed the title Use micro SD card as main storage ?? Make SD card accessible over MSC, as CIRCUITPY, or as a dir in CIRCUITPY Apr 20, 2019
@dhalbert dhalbert added this to the Long term milestone Apr 20, 2019
@dhalbert
Copy link
Collaborator

See #2206 (comment) for a more thorough explanation of why this is very hard. Closing for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants