Teensy 3, SD - Mass storage

Status
Not open for further replies.

pht

Member
Is this something that is going to be worked upon?

If not, I will need to design some other way to get stuff off the SD card on my design.

I've not worked with onboard/separate EEPROM storage, but if it would be possible to show that data on a PC as a mass storage device, that would be swell too. Although I'm not sure if EEPROM storage would use a filesystem like FAT32.. I'll read up on that later today.

My device will be in an inaccessible area and I need to find an easier way to get data off the SD card inside it. If mass storage worked, I can just have a long USB cable and a laptop to make the data a lot more accessible.

Cheers.
 
PJRC offers a SD card slot that you can connect to the Teesy3 per SPI bus.The SDfat library takes care of the software side.

Teensy MIcro SD guide

Edit: Ahh. Now I understadn. You already have a SD card in your project but need to get data onto another device ?

I would say that there are several ways this could be approached. You'd need to provide a litttle more info on the project details thoug.
 
Last edited:
I implemented this on Teensy 2.0, but even there, it's never really been completed to a point where it's truly useful for data logging. The main trouble involves access by both the USB and your code, where neither is aware of changes to the media made by the other. PCs cache almost everything, so if you write to the card, the filesystem can become corrupted.

I put in some undocumented functions to allow "removal" of the card (as far as the PC can see), which in theory would allow you to have access, then when you're done you could restore the PC's access. But it's never really worked. There's at least 2 problems: the timing or some other detail isn't quite right, so the PC doesn't always recognize the media changed (even though it seems like it should based on the sense codes). The other issue is some incompatibility between the SD library and my code. It works sometimes, but fails others. I've never really put the time into troubleshooting this. I may do that someday, but it's a relatively low priority right now.

Since then, a newer media transfer protocol has become popular. I'm considering completely abandoning the USB mass storage and going to that protocol. It (supposedly) solves the issues of who has access, because it works at the file level rather than the raw block level. But so far, this is merely at the planning stage. So far, no actual coding has begun on this idea.
 
If you ever consider spending time on the media transfer protocol, please give me a chance to test that.

As of now, I've built an app on Windows that connects to the Teensy over Serial and allows me to retrieve and store files on the microsd. Works over USB. Not the most fun way to spend a weekend trying to understand the abomination that is Visual Basic but it does the job well.

Cheers.
 
I was a happy Visual Basic 6 user.. rapid non-production apps. Perfect.
VB .Net - is so convoluted in comparison, I decided to invest my time in learning C++ for WIn32 APIs and some of the .NET and virtual Windows OS machine, rather than VB .NET. The serial port - in C++, I started with .NET for the serial port, but fell back to Win32 because of fast/efficient access to the port's data available status and call-backs, and not having to be forced to use managed arrays as happens with .NET.
Worked out well, talking at 115200 to an embedded device's UART.
 
Wow, I literally registered this account just to ask this same question!

I'm working on a project prototype that displays .bmp images from an SD card on a T2, and it works great. Burning my code to the T2 with the usb set to Serial + SD Access works great, BUT my project's featureset needs more EEPROM than what the T2 provides (and it's code, not constants or patterns.) So I bought the T3 thinking it would have the same modes for SD-over-USB that the T2 did, and I was wrong. I've been researching for a bit now and haven't found a good answer as to how to proceed. I don't need both hosts to access the SD card at the same time, but I do need to expose the SD over USB so that the card doesn't have to be removed from the product for programming (this would make my target audience sad, and require additional adapters which is no good.)

Do you have a beta version where this works on T3 but concurrent access doesn't? It would help me move my prototypes along.
 
maybe a better question - is it ever your intention to make the T3 behave like a T2 in the SD functionality, regardless of how 'broken' it is?
 
I have a Teensy 3.1 project where I had the same problem: Getting data off of my micro SD card, which isn't designed to be removed due to space/enclosure constraints. For now, I have settled on using the USB Raw HID support which is fast enough for my needs. This has the downside that I need to write a specific client to run on the host (very thankful for the examples found at https://www.pjrc.com/teensy/rawhid.html).

Just out of curiosity, I was wondering how much work it would be to actually implement USB Mass Storage Device support for Teensy 3? Let's say, starting with reading files only, no write support. Looking at the work others in this forum have done to implement support for other USB device types, I was hoping that maybe it would be possible to come up with an implementation in a reasonable amount of time, or am I dreaming? Maybe reusing some code from the Teensy 2 or LUFA?
 
The Teensy 2.0 code would be a starting point for read-only support.

It's a huge project. Let me know if you get anywhere with it?
 
You could always use the UHS mini from Circuitsathome, I wrote the mass storage bits. I verified that it works on the teensy3 and the teensy++ 2. I use it for my gigantic project that needs literally gigabytes of storage. It supports fat 16/32, long filenames, etc. Everything is accessed like unix mountpoints, thus it is very easy to use.
 
Thanks so much for your suggestions. It's on my todo-list now - while not on top, I'm certainly intrigued...
 
Status
Not open for further replies.
Back
Top