But you did make it work. The while(1) loop you posted above is working as expected. I think you have proven the principle and should move on to applying it to your application as you describe above.
By the way, it’s best to avoid suspending tasks as a general rule. Instead, signal the task to stop its work so it can do so cleanly. Then it can either report that it is stopped, or perhaps wait for a signal “forever”, as an indication that STOP mode is now safe (see eNoTasksWaitingTimeout
). Or, for simple tasks, they can be designed to “always” be ready for STOP mode anytime they are not in the ready state.