There are some other ways you can consider to achieve the same:
- You can create a task at the highest priority which does all the initialization. No other task can run until this initialization task is done because it is the highest priority task.
- If you are using timers, you can set configTIMER_TASK_PRIORITY to the highest priority and use Daemon Task Startup Hook for initialization.