This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/PROCESSOR-SDK-AM335X: USB access to SD card

Part Number: PROCESSOR-SDK-AM335X


Tool/software: TI-RTOS

Hi Experts,

Based on the https://e2e.ti.com/support/arm/sitara_arm/f/791/t/622577#pi316653=2

1. How is the progress of "umount/safely remove command" ?

2. We found that it cannot work with MacOS & Linux, only works well with Windows. ( P.S. Our customer's OS is Android )

MacOS  => ICE console log : CortxA8: Unhandled ADP_Stopped exception 0x20023

Linux => dmesg :
[ 105.569915] usb 1-1.5: reset high-speed USB device number 6 using dwc_otg
[ 110.749893] usb 1-1.5: device descriptor read/64, error -110
[ 126.109893] usb 1-1.5: device descriptor read/64, error -110
[ 126.339886] usb 1-1.5: reset high-speed USB device number 6 using dwc_otg
[ 131.469881] usb 1-1.5: device descriptor read/64, error -110
[ 146.830229] usb 1-1.5: device descriptor read/64, error -110
[ 147.050232] usb 1-1.5: reset high-speed USB device number 6 using dwc_otg

Regards,
Eten

  • The RTOS team have been notified. They will respond here.
  • Hi Eten

    We haven't had chance to work on the safely unmount issue yet.

    However, in our experience, the USB-MMCSD demo works better in Linux than on Windows. We didn't try with Android. 

    Curious if you see the problem when you use the "safely remove" command or when you just unplug the USB cable and plug it back in?

    Thanks

  • Hi Thanh,

    My testing Linux were Raspbian & Ubuntu16.04 in Parallels , so I will test it with the real Linux machine & Android, and report the test result.

    If there is no safely remove command, our target, AM335x, should proactively disconnect the USB interface.
    Because our target has two mode to access the MMCSD, one is the internal application via FATFS API, another is the USB host device. ( I think that they cannot access the MMCSD resource at the same time ).
    But I cannot find the corresponding APIs, like USB_close(), to close the USB interface & to un-register the USB interrupt for safely releasing resource.

    Can you help us to resolve the problem ?

    Thank you !!

    Regards,
    Eten

  • Hi Eten

    You could call function HwiP_disableInterrupt() to disable the USB interrupts.  When you're ready to mount the USB drive again, you could run the same code that the USB_open() does.  Hope this works

    Thanks

    Thanh

  • Hi Thanh,

    1. Unfortunately, the test with our customer's device, Android, is fail.
    2. To call HwiP_disableInterrupt() can stop the USB interrupt event, but the recovery method....
    Method 1 : USB_open() => the return value is zero. => fail
    Method 2 : only usbdIntrConfig() => crash
    Method 3 : HwiP_enableInterrupt() => it works, but if PC do some action to USB and timeout occur, this method still cannot recovery.

    Can you help us to resolve the problem ?

    Thank you !!

    Regards,
    Eten

  • Hi Eten

    The USB_open() will fail if call it twice. I meant to say that you could replicated what done inside the USB_open() to restart the USB.

    But we will do some experiments and come back to you. 

    Thanks

    Thanh