I'm attempting to build up my first SafeRTOS application. As I understand the processes, After initiaIizing the scheduler, I must have at least one task created before I can start the scheduler. I have two task initialization routines, both of them are basic, and each checks the call to xTaskCreate for a sucessful return, like this one:
int MasterTask::init(void){ if(xTaskCreate(&(this->runTask), (signed portCHAR *)"MasterTask", (signed portCHAR *)_taskStack, sizeof(_taskStack), NULL, //pointer set when task created PRIORITY_MASTER_TASK, NULL) //reference to created task != pdPASS) { printf("MasterTask Init Flunked.\n"); return 1; } printf("MasterTask Initialized.\n"); return 0;}
Yes, I am attempting to use a c++ static member function as the task function. The problem I am running into is that I have another class encapsulating another task, and whichever init function I call second will return with failure. Additionally, the call to xTaskStartScheduler returns, even if I initialize only one of the tasks.
Can someone tell me what I might be doing wrong, and where I could learn about troubleshooting strategies when calls to SafeRTOS API functions fail? Is there a non-ROM version that I can utilize in debug mode?
Update: I have created task functions outside the class for the tasks, there is no change in behavior.