STM32F767. USB-Dev-MSC. How to write/read to/from MCU from the PC?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-10-25 12:56 AM
Hi, colleges!
I use Nucleo-144 STm32F767 development board to learn USB.
Now - Application example - device USB MSC.
How can I write/read to/from MCU from the PC?
Do I need some software on PC? Or can I do it by file manager (f.e. Total Commander)?
Please, reveal me the process? Or where can I read about it?
- Labels:
-
STM32CubeMX
-
STM32F7 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-10-25 4:04 AM
Device emulates a sub set of SCSI commands. Should be able to find SCSI/ATAPI docs online.
OS typically has an MSC or USBSTOR driver to talk to device, reads ID, CAPACITY and provides block READ /WRITE function. Would need to format media usually with a partition table, and then a file system. ​
OS might provide means to get handle to device to use IOCTL interface to query size, read/write blocks, or send commands. See tools like WinImage.​
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-10-25 4:52 AM
If I want to use FARfs on my device, is thees steps right?
- Include ff, f_gen_drv, diskio files
- Create my own usbd_diskio.c
- In this file i fill functions _initialize, _status, _read, _write, _ioctl with functions, which work with SD card (initialize, read, write, ...). Is it right?
- in file usbd_storage_if.c i need to fill all functions (Init, GetCapacity, Read, Write). But what i need to write here?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-10-25 5:41 AM
Look through HAL code/examples trees and port the microsd to MSC ones to your platform.​
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-10-25 6:27 AM
HAL examples doesn't use FATfs with usb msc device mode. It is used only in host mode.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-10-25 8:01 AM
>>HAL examples doesn't use FATfs with usb msc device mode. It is used only in host mode.
And why would it need to use FATFs in this context, the PC wants to see a block storage device?
I'm confused about what you want to do.
If you want to read the MicroSD card on a PC, via USB, be a USB MSC Device.
If you want to read files from the MicroSD on the STM32 side, use FATFs.
Access SD Card from PC
STM32Cube_FW_F7_V1.12.0\Projects\STM32756G_EVAL\Applications\USB_Device\MSC_Standalone\readme.txt
Files from an SD Card on STM32
STM32Cube_FW_F7_V1.12.0\Projects\STM32F769I_EVAL\Applications\FatFs\FatFs_uSD
Files from a USB Flash Stick on STM32
STM32Cube_FW_F7_V1.12.0\Projects\STM32F769I_EVAL\Applications\FatFs\FatFs_USBDisk
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-10-25 11:21 PM
Thanks a lot, Clive Two.Zero!
I want to see file system on PC when I'm working with SD card via USB.
Next, I will use external SD RAM on my own board instead of SD card.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-10-26 1:05 AM
"I want to see file system on PC when I'm working with SD card via USB."
Are thees steps right?
- Include ff, f_gen_drv, diskio files
- Create my own usbd_diskio.c
- In this file i fill functions _initialize, _status, _read, _write, _ioctl with functions, which work with SD card (initialize, read, write, ...). Is it right?
- in file usbd_storage_if.c i need to fill all functions (Init, GetCapacity, Read, Write). But what i need to write here?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-10-26 4:03 AM
No​
Up vote any posts that you find helpful, it shows what's working..
