In this startup file, a single task is created and then vTaskStartScheduler() is called. From within this task, your "app_main()" is called. So "app_main()" is already running from a task context, which is why you must not call vTaskStartScheduler() again.