none
SD Card insertion and removal interrupt is not generating?? RRS feed

  • Question

  • Dear Developers,

    Greetings!!

    As, I have observed one issue after modifying our code related to eMMC for slot2 and we are using micro SD Card for slot 0.

    The problem is that for slot 0, when ever we insert or remove the card, H/W should generate the interrupt and its kernel responsibility to capture the interrupt by IRQ and call to ISR and ISR call the interrupt handler and finally Kernel schedules the IST and IST call InterruptDone function and in turn InterruptDone call the OEMInterrupt done function. 

    My case

    When we insert or remove the card, we cannot see any debug messages on PB console neither from oem.c file nor from sdhc.cpp file. But when we insert the card and supply power to the board, we got all the debug messages from both files. as shown below -

    7653 PID:400002 TID:2ff0006 CardInterrupt(1)
       7653 PID:400002 TID:2ef0006 CardDetectInterrupt: Card inserted!
       7654 PID:400002 TID:2ef0006 HandleInsertion
       7664 PID:400002 TID:2ef0006 ====SendInitSequence-----
      10568 PID:400002 TID:3170006 CardInterrupt(1)

    and in the mentioned case, we can see the card as a mounted device. and when we remove the card still the interrupt not generated and the virtual images exist there..

    I am just thinking that how the functionality for slot 2 affect the functionality for slot 0?????

    The problem is similar like 

    https://social.msdn.microsoft.com/Forums/en-US/b665518d-10a7-4cce-9f3d-2571d3f374cb/mount-sd-card-windows-ce-6?forum=winembplatdev

    Wednesday, March 18, 2015 6:19 AM

All replies

  • Hi Partap,

    I am just thinking that how the functionality for slot 2 affect the functionality for slot 0?????
    This strange because eMMC does not use GPIO for (interrupt) detection (obviously).

    You could verify this by not loading the driver instance for eMMC?

    So to be clear you never get an interrupt when you boot without card inserted (not even once?)

    I would suspect interrupt is not being initialized correctly or not at all, and that there is a different in card detection at boot vs interrupts in the driver. 


    Good Luck,

    Erwin Zwart, eMVP
    Check out my blog: http://guruce.com/blog
    GuruCE
    Microsoft Embedded Partner
    http://guruce.com
    Consultancy, training and development services.

    Wednesday, March 18, 2015 7:52 AM
  • Dear Developers,

    Erwin Zwart, The logs what I shared I captured when the card was inserted during the time of booting and your suggestion is good to check the interrupt by disabling the instance of eMMC. and, definitely eMMC wont generate any interrupt as it is not using CardDetectGpio



    Wednesday, March 18, 2015 9:09 AM
  • Dear Developers,

    Erwin Zwart, I have checked after disabling the instance of eMMC. But, I am facing the same issue. The interrupt is not generating for both insertion & removal

    Wednesday, March 18, 2015 9:37 AM
  • So this could be one of two things:

    - Interrupt is not being generated (kernel/CE) bug.

    - Interrupt is not correctly configured/ overwritten by something.

    Let's assume, for this moment, that the first is not the case. Create a test application and in that test application you need to configure the GPIO, used for detection, as interrupt and see whether you receive interrupts.

    You can also choose not to load the driver instance for the SD and load the driver when the system has booted.

    This just to make sure the interrupt configuration is not overwritten. You need to be absolutely sure that your interrupt settings are correct.

    for pointers also check 

    https://social.msdn.microsoft.com/Forums/en-US/a9dac365-9a60-4979-8b69-7b3cc19ea6fe/sysintr-stops-being-triggered-after-a-period-of-time?forum=winembplatdev



    Good Luck,

    Erwin Zwart, eMVP
    Check out my blog: http://guruce.com/blog
    GuruCE
    Microsoft Embedded Partner
    http://guruce.com
    Consultancy, training and development services.

    Wednesday, March 18, 2015 9:55 AM
  • Dear Developers,

    Erwin I have one point, why the interrupt is generating while booting(just once)

    Wednesday, March 18, 2015 10:06 AM
  • Hi Partap,

    You really need to do a bit more investigation.

    As I saw in a previous  thread you are using the TI AM335x processor from TI right? Now this is all based on assumption but if I took a quick peek at the in-box BSP from TI, TI_SDP44XX (probably completely different) and saw that the logging generated "comes from"/"possibly comes from" the CardInterrupt() method called in SDHCCardDetectIstThreadImpl(). In the initialization the thread (SDHCCardDetectIstThreadImpl) it calls CardInterrupt(TRUE); when MMC_NO_GPIO_CARD_DETECT is set....and exits the IST... again guessing around here...

    If this driver is also in your BSP could this be the case?

    again take a good look at the implementation of the initialization procedure of you SDHC driver...


    Good Luck,

    Erwin Zwart, eMVP
    Check out my blog: http://guruce.com/blog
    GuruCE
    Microsoft Embedded Partner
    http://guruce.com
    Consultancy, training and development services.

    Wednesday, March 18, 2015 10:27 AM
  • Dear Delvelopers,

    Erwin, Yes we are using AM335x TI. and the also we have the same function what you have mentioned. I am doing R&D to find out the issue.

    Wednesday, March 18, 2015 11:04 AM
  • Dear Developers,

    I got some new debug logs, when I remove the card I have not got any logs but when I re-insert the card I got the following logs -

    419962 PID:400002 TID:2f50006 +CSDIOControllerBase::ProcessCommandTransferStatus: status = 1
     419962 PID:400002 TID:2f50006 SDHControllerIstThread() - Got command response timeout!
     419963 PID:400002 TID:2f50006 SDHControllerIstThread() - Got command response timeout!
     419964 PID:400002 TID:2f50006 SDHControllerIstThread() - Got command response timeout!
     419965 PID:400002 TID:2f50006 SDHControllerIstThread() - Got command response timeout!
     419966 PID:400002 TID:22d000e CSDDevice::SDSynchronousBusRequest_I  Waiting until request is complete.
     419966 PID:400002 TID:22d000e CSDDevice::SDSynchronousBusRequest_I  Request completed. 
     419967 PID:400002 TID:22d000e SDGetCardStatus Failed: status 0xC0000014
     419968 PID:400002 TID:22d000e SDCardInfoQuery__X: Failed status 0xC0000014 

    As, I know the Wince Interrupt Mechanism. Any one will tell me the Interrupt mechanism with SD Card(Card Detect). ????

    I googled it but unable to find any information related to this

    Friday, March 20, 2015 4:37 AM
  • So it seems that you are receiving interrupts then when you insert the card? What was the problem?

    It looks like it cannot communicate to the SD card via the SD bus. First few pointers would be:

    IOMux correctly setup?

    Clocks needed enabled?



    Good Luck,

    Erwin Zwart, eMVP
    Check out my blog: http://guruce.com/blog
    GuruCE
    Microsoft Embedded Partner
    http://guruce.com
    Consultancy, training and development services.

    Friday, March 20, 2015 1:54 PM