resume before suspend on heavy CPU load

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • resume before suspend on heavy CPU load

    Hello,

    I have a low priority task1 that starts an automatic ADC/DMA sequence to aquire some data in realtime. When the sequence is started,
    the low priority task1 suspends itsself. At the end of the sequence, a DMA complete interrupt fired and task1 is resumed and starts
    to process the aquired data with low priority. This works well in lower load situation, however in high CPU load situations, a higher priority
    task2 preempts the low priority task1 and before OS_Suspend is called, the automatic sequence finishes and calls OS_Resume which leads to
    an OS_Error.

    What would be a reliable and good way to solve this? Of course I cuold poll for a volatile flag instead of the OS_Suspend but this seems
    ugly to me. Is there a nicer way to fix this?

    Regards,
    Christian
  • Dear Christian,

    Thanks for your inquiry.
    embOS does offer several means to solve this situation, one of which is task events. Using these, task1 were to suspend itself using "OS_WaitEvent(BITMASK)", and could subsequently be resumed through calling "OS_SignalEvent(BITMASK, &task1_ControlBlock)" from within the ISR. More information may also be found inside the User & Reference Guide for embOS, Chapter 10 "Task events".
    Please let me know if I can be of any further help.

    Best regards,

    SEGGER - Support embOS
    Martin
  • Dear Martin,

    thank you for the quick help. Now it works perfectly. Once again, a Segger product is woth every penny.
    Do you offer embOS (advanced) trainings? I understand the basics of RTOSes but at some points, I am unsure
    if the way I use the OS functions is really suitable/elegant. (like in the example above).

    Best Regards,
    Christian
  • Dear Christian,

    Do you offer embOS (advanced) trainings?


    Yes, of course!
    An embOS training is usually a one day event which can be held at our training facility or at your location.
    We teach in an embOS training not only the RTOS basics and explain the API but also discuss how embOS can be used in your actual application.

    Please contact us per email/phone for further information.

    Best regards,
    Til