0

I have an embedded system with an UART that I communicate with over an USB to RS485 cable. I can read and write data to flash by sending serial commands. The software on the device is written in C++.

I would like to implement a file-system that my computer would recognize when I plug in the USB, and would let me browse the files on the embedded devices' flash.

How would I go about doing this?

Q-bertsuit
  • 3,223
  • 6
  • 30
  • 55
  • 1
    You obviously uses a Raspberry Pi1+ Model B board as you doesn't say any different! Use raspbian and install a file system driver with apt-get and some other glue. Or put enough details into your text so that it's possible to answer the question – jeb Mar 22 '17 at 08:20
  • @jeb I have tagged blackfin processor – Q-bertsuit Mar 22 '17 at 08:25
  • 2
    Too broad for SO. Mainly you can choose whatever you want as far as your pc OS can read it. – LPs Mar 22 '17 at 08:42
  • @Q-bertsuit Now everything fell into place. You are using the Sciopta OS and want to access a file system for your computer, an Atari ST. Simply take the right drivers and write the correct code. (Perhaps you should put a little, little bit more INFORAMTIONS into your question) – jeb Mar 22 '17 at 09:07
  • It is entirely unclear what the first paragraph about your UART has to do with the question about having your board appear as a USB mass storage device. Does your chip have a USB controller peripheral? – Clifford Mar 22 '17 at 09:48
  • @Clifford The point is that I don't have a USB chip, only UART. My question is if it is still possible to implement/use some drivers that will let my device appear as a storage device when I connected it with a USB to UART converter cable into my computer. Sorry if I haven't explained myself clearly. – Q-bertsuit Mar 22 '17 at 10:44
  • @jeb Thanks for the sarcasm. – Q-bertsuit Mar 22 '17 at 11:12

1 Answers1

2

From the PC's view the "device" is the cable, not your board. Logically the USB<->RS485 converter adds an RS485 interface to your PC rather then a USB interface to your board - even if the USB/485 chip were on your board that would be logically if not physically true. Therefore it cannot appear as a USB mass-storage device, because it is explicitly a USB CDC/ACM device.

For your board to appear as a true USB mass storage device, you would need to use a USB Device controller - some (but not all) Blackfin devices have an on-chip USB controller, and analogue devices provide a USB device stack library for that. In that case you would need to implement and use a USB interface on your board rather that a serial adaptor cable.

If you lack a USB controller or only wish to use the serial interface, then it may be simplest perhaps to implement a TCP/IP stack with PPP and use FTP. That would make the serial link far more flexible in any case (can then support Telnet and other protocols simultaneously). Using PPP in Linux is relatively straightforward, in Windows it is possible but it is tied up in the dial-up connection support, so is not particularly intuitive for a direct cable connection. In this case you'd need to use an FTP client on your PC as it would not appear as a direct file-system device to the PC.

Clifford
  • 88,407
  • 13
  • 85
  • 165
  • Thank you so much for your answer! Exactly what I was wondering about, even though I might have phrased it a bit unclear. I already have a working PPP connection with Windows and my blackfin, I'll look into using FTP with it. – Q-bertsuit Mar 22 '17 at 10:49
  • On investigation, it is possible to use Windows Explorer (the Windows shell and file manager - not _Internet Explorer_) as an FTP client: http://support.hostgator.com/articles/how-to-use-ftp-via-windows-explorer. Also for SFTP, you can achieve similar integration using a tool called Swish: https://www.howtogeek.com/165893/how-to-integrate-a-remote-sftp-directory-into-windows-explorer/ – Clifford Mar 22 '17 at 17:37