FTDI Community

General Category => Discussion - Software => Topic started by: jney on August 05, 2020, 10:07:29 AM

Title: V2DIP1-32 SPI2DSC example USB_HOST never enumerated
Post by: jney on August 05, 2020, 10:07:29 AM
Hello,

I'm using the V2DIP1-32 development module with the VNC2 debug module.
I want to implement a data transfer between SPI and USB mass storage.

Unfortunately the SPI2DSC example (https://www.ftdichip.com/Support/Documents/AppNotes/AN_186_VNC2_SPI_to_USB_Memory_Bridge.pdf (https://www.ftdichip.com/Support/Documents/AppNotes/AN_186_VNC2_SPI_to_USB_Memory_Bridge.pdf)) does not recognize my USB device.
It does not get out of the loop in line 273 of SPI2DSC.c where checking usbhost_connect_state:
Code: [Select]
while (usbhost_connect_state(hUSBHOST_1) != PORT_STATE_ENUMERATED)
I've tried two different FAT32 USB Sticks, both with the same result.

Best regards
Jonas
Title: Re: V2DIP1-32 SPI2DSC example USB_HOST never enumerated
Post by: FTDI Community on August 05, 2020, 01:24:50 PM
Hello,

Looks like the firmware cannot enumerate the USB driver.

The Vinculum firmware support BOMS devices formatted in FAT12, FAT16 or FAT32 file systems only where the sector size is 512 bytes.
 
You can determine the sector size by entering the following command into a windows command promt:
 
wmic DISKDRIVE get bytespersector, caption
 
Data displayed:

BytesPerSector  Caption
512             TOSHIBA DT01ACA050 SCSI Disk Device
512             SanDisk Cruzer Blade USB Device

Best Regards,
FTDI Community
Title: Re: V2DIP1-32 SPI2DSC example USB_HOST never enumerated
Post by: jney on August 05, 2020, 01:51:05 PM
Hello,

Thanks for the fast responds.

I just had a look and both my USB Sticks are using 512 Bytes per Sector.

What else could be the problem?
Title: Re: V2DIP1-32 SPI2DSC example USB_HOST never enumerated
Post by: FTDI Community on August 05, 2020, 03:16:41 PM
Hello,

Can I get you to try the following files in your project to see if they help?
BOMS files (ftp://u45902898-ide:Ftd1$erv@ftp.ftdichip.com/CES/Uploads/BOMS%20files)

Some instructions:
Replace the “.a” files in
C:\ProgramData\FTDI\Vinculum II Toolchain\Firmware\Drivers\lib
and the “.h” files in
C:\ProgramData\FTDI\Vinculum II Toolchain\Firmware\Drivers\include


Unfortunately if these do not help it may indicate the enumeration issue could be related to the USB drives hardware.
Flash drives are a commodity product and are designed as such, often you find these are not designed to the applicable specs.
It may be worth using flash drives you can guarantee from the manufacture which are designed to a standard with proper bill of materials control. And which would guarantee that their devices were identical and would work the same throughout the lifetime of the product.

Best Regards,
FTDI Community

Title: Re: V2DIP1-32 SPI2DSC example USB_HOST never enumerated
Post by: jney on August 06, 2020, 11:20:38 AM
Hi,

I've tried what you suggested but without success.

However, I've solved the problem.

Seems like the SPI USB bridge example is not designed for the V2DIP1-32 Evaluation Board.
To make it work I had to change the code to use the second USB device.

Changing
Code: [Select]
usbhost_init(VOS_DEV_USBHOST_1, -1, &usbhostContext); to
Code: [Select]
usbhost_init(-1, VOS_DEV_USBHOST_1, &usbhostContext); solved the problem.

Title: Re: V2DIP1-32 SPI2DSC example USB_HOST never enumerated
Post by: FTDI Community on August 06, 2020, 01:53:06 PM
Hello,

Good catch!
Yes the examples tend to initialize only 1 USB port from the 2 available, and in the case of the V2DIP1-32 this isn't the USB port that is pinned out on the module.

Best Regards,
FTDI community