I designed a board equipped with ATSAME70Q21A. I’m using Atmel studio ver 7.0.1931 with ASF4.
In my board there is an USB host port to allow the use of a memory stick (key).
The behavior of the system changes if I insert keys with a memory of less than 4G from those with higher memory.
If I insert a 8G key, the key recognition procedure fails. If I insert keys with less memory, sometimes the procedure is ok, but sometimes the procedure fails but in a different way from the case of a memory stick with memory above 4G.
My test routine is basically the same proposal in "usb_start.c". In particular:
if (!mschf_is_enabled(&USB_HOST_MSC_0_inst)) //(1)
/* MSC device disconnected */
tested = false;
/* MSC device connected */
tested = true;
/* Select the LUN 0 */
USB_HOST_MSC_0_operation_end = false;
rc = mschf_select_lun(&USB_HOST_MSC_0_inst,0,false,USB_HOST_MSC_0_operation_cb); //(2)
if (rc == ERR_NOT_READY)
/* Wait until selection end */
while (!USB_HOST_MSC_0_operation_end) //(3)
else if (rc != ERR_NONE)
/* Select LUN fail! */
When I try to insert a key with more than 4G, the function “mschf_select_lun” ends returning the ERR_IO code
I have one key with 1G of memory that works well with my PC, but when I insert it in the USB port of my board, the function “mschf_is_enabled” never recognizes it.
Can someone help me?