This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VMXEVM: R5F;MCU2_0;multitask;

Part Number: TDA4VMXEVM
Other Parts Discussed in Thread: SYSBIOS

HI,

I wrote a multitasking program that runs on MCU2_0.

If I create only one task, the firmware can start normally.

If I create two or more tasks, mcu2_0 cannot start normally, but I don't know where the problem lies.

Here is my code. Terminal does not print any log about mcu2_0 after running.

SDK:psdk_rtos_auto_j7_06_01_00_15

#include <stdio.h>
#include <string.h>

extern "C" {
#include <app.h>
#include <app_ipc_rsctable.h>
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>
#include <utils/console_io/include/app_log.h>
#include <xdc/runtime/Error.h>
}

static uint8_t task1buff[2048]
__attribute__((section(".bss:taskStackSection")))
__attribute__((aligned(1024)));
static uint8_t task2buff[2048]
__attribute__((section(".bss:taskStackSection")))
__attribute__((aligned(1024)));
static uint8_t task3buff[2048]
__attribute__((section(".bss:taskStackSection")))
__attribute__((aligned(1024)));

Task_Handle task1,task2,task3;
Task_Params tskParams1,tskParams2,tskParams3;
Error_Block eb1,eb2,eb3;

static Void Func1(UArg arg0, UArg arg1) {
appInit();
appRun();
appLogPrintf("dbcparser_output_appLogPrintf\n");
printf("-----------Task function FUNC1()------------>\n");
printf("-----------Task function FUNC1()------------>\n");
printf("-----------Task function FUNC1()------------>\n");
while(1)
{
appLogWaitMsecs(1000u);
}

}
static Void Func2(UArg arg0, UArg arg1){
printf("Task function FUNC2()------------>\n");
printf("Task function FUNC2()------------>\n");
printf("Task function FUNC2()------------>\n");
while(1)
{
appLogWaitMsecs(1000u);
}

}

static Void Func3(UArg arg0, UArg arg1){
printf("--------------Task function Func3()------------>\n");
printf("--------------Task function Func3()------------>\n");
printf("--------------Task function Func3()------------>\n");
while(1)
{
appLogWaitMsecs(1000u);
}

}

void StartupEmulatorWaitFxn(void) {
volatile uint32_t enableDebug = 0;
do {
} while (enableDebug);
}

int main(void) {
Error_init(&eb1);
Error_init(&eb2);
Error_init(&eb3);
Task_Params_init(&tskParams1);
Task_Params_init(&tskParams2);
Task_Params_init(&tskParams3);

StartupEmulatorWaitFxn();

tskParams1.arg0 = (UArg)NULL;
tskParams1.arg1 = (UArg)NULL;
tskParams1.priority = 16;
tskParams1.stack = task1buff;
tskParams1.stackSize = 2048;
task1 = Task_create((Task_FuncPtr)Func1, &tskParams1, &eb1);
if (nullptr == task1) {
printf("task1 create failed!!!!!!!!\n");
BIOS_exit(0);
}
tskParams2.arg0 = (UArg)NULL;
tskParams2.arg1 = (UArg)NULL;
tskParams2.priority = 16;
tskParams2.stack = task2buff;
tskParams2.stackSize = 2048;
task2 = Task_create((Task_FuncPtr)Func2, &tskParams2, &eb2);
if (nullptr == task1) {
printf("task2 create failed!!!!!!!!\n");
BIOS_exit(0);
}
tskParams3.arg0 = (UArg)NULL;
tskParams3.arg1 = (UArg)NULL;
tskParams3.priority = 16;
tskParams3.stack = task3buff;
tskParams3.stackSize = 2048;
task2 = Task_create((Task_FuncPtr)Func3, &tskParams3, &eb3);
if (nullptr == task3) {
printf("task3 create failed!!!!!!!!\n");
BIOS_exit(0);
}
BIOS_start();
return 0;
}

Thanks.