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.

gadget usb insert detection

how to detect a connection when my usb connector conect my board to my PC in linux c?

in usb host case,i can found info in /sys/block/sda1/

where i can find the info of usb gadget

  • Tracy,

    From what I understand, your DM814x board is USB device/gadget, and your linux PC is USB host, is that correct?

    And you need to know where in linux PC you should check that DM814x USB is detected?

    BR
    Pavel

  • board is USB gadget and PC is USB host,correct.

    I want to check if usb is connect or not in DM814x not in my linux  pc.

    insmod g_file_storage.ko file=/dev/sbulla stall=0 removable=1

    when the first time 8148 connect to PC,USB can be detected

    but if i remove it in my linux PC,the second time ,can not detect..

    i think i must rmmod g_file_storage.ko and insmod again after disconnect from my pc,so i need to detect the status of usb connection in 8148.

    now i found another way is :

    insmod g_file_storage.ko file=/dev/sbulla stall=0

    but i still don't konw how to detect the usb connection status in 8148..

  • tracy mcgrady said:
    but i still don't konw how to detect the usb connection status in 8148

    This should be possible through the sysfs, debugfs and/or procfs, see the below wiki pages for more info:

    BR
    Pavel