Tuesday, May 22nd 2018, 6:23am UTC+2

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.



Date of registration: Oct 26th 2012

Posts: 7


Tuesday, August 23rd 2016, 4:34pm

resume before suspend on heavy CPU load


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?


SEGGER - Martin

Super Moderator

Date of registration: Jul 1st 2014

Posts: 35


Tuesday, August 23rd 2016, 5:38pm

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



Date of registration: Oct 26th 2012

Posts: 7


Wednesday, August 24th 2016, 7:53am

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,


Super Moderator

Date of registration: Nov 14th 2007

Posts: 271


Wednesday, August 24th 2016, 9:07am

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,