none
Can you call SetEvent inside an ISR callback? RRS feed

  • Question

  • I added an ISRHandler for our SOC's ADC interrupt because the latency is just too high if we handle it in the IST. The ADC has support for 8 channels and the channel id is embedded in the ADC data while sharing the same interrupt.

    So what I wanted once the data is read we will send an event the channel thread. However, my system hang-up during adc read operation. So I would just like to clarify in parellel if calling SetEvent from an ISR callback could cause this? Thanks

    Tuesday, September 2, 2014 2:19 AM

Answers

  • No, you can not.

    How did you implement the ISR? If you did it right you should return the SYSINTR value of the interrupt you are servicing. The kernel will then set the associated interrupt event and you handle any further data processing in a normal IST.

    Just do the things that need to be done super fast inside your ISR and don't call any system functions. Make sure to keep code execution time to an absolute minimum otherwise you will impact the entire system.

    See this for more info: http://msdn.microsoft.com/en-us/library/ee483140.aspx


    Good luck,

    Michel Verhagen, eMVP
    Check out my blog: http://guruce.com/blog

    GuruCE
    Microsoft Embedded Partner
    http://guruce.com
    Consultancy, training and development services.

    • Marked as answer by MJ Masbad Monday, September 8, 2014 3:03 AM
    Thursday, September 4, 2014 9:58 AM
    Moderator

All replies

  • No, you can not.

    How did you implement the ISR? If you did it right you should return the SYSINTR value of the interrupt you are servicing. The kernel will then set the associated interrupt event and you handle any further data processing in a normal IST.

    Just do the things that need to be done super fast inside your ISR and don't call any system functions. Make sure to keep code execution time to an absolute minimum otherwise you will impact the entire system.

    See this for more info: http://msdn.microsoft.com/en-us/library/ee483140.aspx


    Good luck,

    Michel Verhagen, eMVP
    Check out my blog: http://guruce.com/blog

    GuruCE
    Microsoft Embedded Partner
    http://guruce.com
    Consultancy, training and development services.

    • Marked as answer by MJ Masbad Monday, September 8, 2014 3:03 AM
    Thursday, September 4, 2014 9:58 AM
    Moderator
  • Thank you Michel.

    BTW, do you have any link for a clear guide on how to implement installable ISR other than what is on MSDN?

    Right now our vendor is hard coding the ISR handling in the OEMInterruptHandler code, and I think this is very in-convenient especially that our architecture is approaching a platforming kind of design. So some build may want to use ISR for this driver while others may not.

    If I remember, there were some good folks in CE group that have made good guides on this one which only requires the ISRHandler registration to the system. But somehow, I just can't find it anymore.

    Monday, September 8, 2014 3:08 AM
  • No, but I'll try to put it in a blog item.

    If you have any specific questions about what is unclear I can surely help.


    Good luck,

    Michel Verhagen, eMVP
    Check out my blog: http://guruce.com/blog

    GuruCE
    Microsoft Embedded Partner
    http://guruce.com
    Consultancy, training and development services.

    Monday, September 8, 2014 3:13 AM
    Moderator