Has anyone published P1 code functionally similar to SparkFun Thing Plus Dual-Port Logging Shield?
There is plenty of source code available to read sensors and log data to a microSD card. I wrote spin/pasm source code to log data to a microSD card. When it comes to reading the logged data, I have two choices:
1. Eject the microSD card and plug it into my computer card reader.
2. Connect my device to a computer and use TeraTerm and one-character commands to display a directory list of files, select a file, and transfer a file using XMODEM.
I have written spin source code that interfaces the P1 to my computer via a FT200XD USB UART Bridge and FSRW objects. My device powers up and enters Data Transfer mode when the USB cable is connected to a computer. This works fine, but I'd rather enjoy seeing Windows File Explorer or Mac Finder open and display the microSD card files when the USB is connected.
The SparkFun Thing Plus Dual-Port Logging Shield appears to provide the capability I am seeking, but this is for Arduino. The "dual port" feature refers Arduino logging data to the micro SD card through one "port" (a separate Thing device) and a USB connection allowing the computer to access the files through the second "port" (this shield). Only one "port" is active at a time, which is perfect for my application.
I am about to download the Arduino source code to see if there are enough clues to write similar functionality into my device to replace my simple user interface and TeraTerm.
In the meantime, I decided to ask the forum if anyone has published P1 code that provides similar functionality.
EDIT: I discovered that the "magic sauce" in the SparkFun Thing Plus Dual-Port Logging Shield is the Microchip USB2241 Ultra Fast USB 2.0 Multi-Format, SD/MMC, and MS Flash Media Controllers . The Shield lets the USB2241 interface the microSD card to the USB and computer.
Comments
well Flexspin has some sort of Filesystem to allow the Prop to access the PC file System and Pc access to the SD filesystem without removing SD from the Prop.
Mike
I'm not seeing it. Flexspin compiles to hub memory.
Please advise more details.
Thanks!
I believe Mike is referring to the Plan 9 Filesystem. This lets the Prop use the PC for storage, but I have never seen any way for the PC to mount the SD on the Prop or access it remotely. If that ability does exist, I’ve missed it (and whoa-baby I sure could use it! Lol).
Paging @ersmith for clarification…
Thanks. If the P1 code doesn't exist, I will create and publish it!
Not the second part. The host filesystem in flexspin lets the Prop access the PC file system (you'll need to use loadp2 or my modified proploader on the PC side to support this). But there's no built in way for the PC to access the SD on the Prop.
Does anyone happen to have a release copy of ISO/IEC 14776-326:2015 Reduced Block Commands (RBC).pdf (or equivalent) I can borrow? It's a bit pricey. Drafts are available for free, but I would hate to implement obsolete code.
This pdf describes the USB packets for format, read, write and other commands.
I think this information along with other documents I have will permit me to turn a P1/P2 into a USB card reader for on-board microSD cards to avoid removing the microSD card and using a computer card reader. The USB connection will require a separate FT200XD in lieu of the FT231XS in the Parallax Prop Plug and on other boards.
I reviewed all the documents and have become familiar with the USB Mass Storage Class, thanks to advice on this forum.
My implementation will be slower than a typical USB flash drive by about 10x. My design will pass data through the P1, which is acceptable as my application uses small files. Data does not pass through the USB mass storage controller in a USB flash drive. The SparkFun Thing Plus Dual-Port Logging Shield passes data like a USB flash drive.
Unfortunately, my project can't proceed with a FTDI FT200XD USB slave IC. My hardware is constrained to use I2C between the P1 and USB and I need to find a different device.
According to the FTDI Knowledgebase : "FTDI have defined our own device class, so FTDI devices return a 0 for the bDeviceClass (Vendor class). The class cannot be configured by the designer. Our devices do not return the correct USB device descriptors to be USB HID class or USB Mass Storage class. It may be possible to write a filter driver that will make our chip appear to be a HID or mass storage class device, but to do this would involve a lot of work."
I have to find a different USB I2C slave IC in which I can change bDeviceClass. All referrals will be appreciated!