Unable to detect SD Card removal

Hi,
We are using USB2244I IC to connect SD Card to WP76xx USB OTG port. When the SD Card is inserted , it appears as a mass storage device and we can see the entry in /dev list.
But when the SD Card is removed the entry doesn’t get deleted and reinserting the SD Card doesn’t change anything. The dmesg output doesn’t show any change.
If the file system is mounted then any writes and reads throw error and we can see that in the dmesg output.
We have tried this by not mounting any file system too but the /dev entry doesn’t change.
Can anyone suggest where to look so that we can refresh the /dev entries and detect SD card reinsertion
Srinivas

Can you try the following on mangoh green board?

  1. connect an USB OTG cable to the USB port of mangoh green board
  2. insert USB thumb drive to the USB OTG cable before power on the board
  3. power on the mangoh green board
  4. you should be able to see the /dev/sda*
  5. remove the USB thumb drive and see if the /dev/sda* is still there
  6. if it is removed, that means there is something wrong on your setup.

Hi jyijyi,
Sorry for the late reply. I tried connecting the USB directly to a Linux machine and there the SD card insertion and removal is detected without any issue. The
But the same doesn’t work with the sierra module.
When I see the dmesg, i see that the USB goes to suspeded/powerdown mode when SD card is removed and doesn’t wake up when the SD card is inserted
Srinivas

Can you try the following on mangoh green board?

  1. connect an USB OTG cable to the USB port of mangoh green board
  2. insert USB thumb drive to the USB OTG cable before power on the board
  3. power on the mangoh green board
  4. you should be able to see the /dev/sda*
  5. remove the USB thumb drive and see if the /dev/sda* is still there
  6. if it is removed, that means there is something wrong on your setup.

FYI, I just made a test on mangoh green board with WP7601 R16, when power on with USB OTG cable with USB thumb drive, I can see /dev/sda device.
After that if I remove the USB thumb drive from the USB OTG cable, the /dev/sda disappeared.
After that if I connect the USB thumb drive again to the USB OTG cable, I can see the /dev/sda.

So it seems your hardware did not give the unplug message to the host via the USB OTG cable.

You might also need to run a wakeup app to make the module not going to sleep mode when using USB OTG mode