USB Host MSC, FAT_FS, and HUBs

1 post / 0 new
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have the USB Host MSC example code running fine, but have a couple questions:


1. What is the proper way to see if a USB drive is present?  The example does this:

// Mount drive

memset(&fs, 0, sizeof(FATFS));

res = f_mount(lun, &fs);

if (FR_INVALID_DRIVE == res) {

// LUN is not present

lun_states[lun] = TEST_NO_PRESENT;



Which doesn't actually do anything to see if a drive is present.  All the f_mount() call checks is lun < _VOLUMES.  It will return FR_OK regardless of if a drive is plugged in or not.


2. I want to add a hardwired hub.  Where is a good starting place to learn how this is done?