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: How to create mutiltasking on R5f?

Part Number: TDA4VMXEVM

Hi,

I wrote a multi-tasking executable on R5f,mcu2_0,but canot work.I don't know where the problem is,Following is my code.

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 Void appMain(UArg arg0, UArg arg1) {
appInit();
appRun();
printf("Task function appMain()------------>\n");
}
static Void func(UArg arg0, UArg arg1){
appInit();
appRun();
printf("Task function fun()------------>\n");
}
void StartupEmulatorWaitFxn(void) {
volatile uint32_t enableDebug = 0;
do {
} while (enableDebug);
}

static uint8_t gTskStackMain[8 * 1024]
__attribute__((section(".bss:taskStackSection")))
__attribute__((aligned(8192)));

int main(void) {
Task_Handle task1,task2;
Task_Params tskParams;
Error_Block eb;

StartupEmulatorWaitFxn();

Error_init(&eb);
Task_Params_init(&tskParams);

tskParams.arg0 = (UArg)NULL;
tskParams.arg1 = (UArg)NULL;
tskParams.priority = 8u;
tskParams.stack = gTskStackMain;
tskParams.stackSize = sizeof(gTskStackMain)/2;
task1 = Task_create(appMain, &tskParams, &eb);

tskParams.stack = gTskStackMain;
tskParams.stackSize = sizeof(gTskStackMain)/2;
task2 = Task_create(func, &tskParams, &eb);

if (nullptr == task1) {
BIOS_exit(0);
}
if (nullptr == task2) {
BIOS_exit(0);
}
BIOS_start();
return 0;
}
When executed, the error is:

APP_LOG: Mapped 0xb8000000 -> 0xffffa0e10000 of size 262144 bytes
[MCU2_0] 0 CIO: Init ... Done !!!
[MCU2_0] 0 ### CPU Frequency <ORG = 1000000000 Hz>, <NEW = 1000000000 Hz>
[MCU2_0] 0 APP: Init ... !!!
[MCU2_0] 0 SCICLIENT: Init ... !!!
[MCU2_0] 0 SCICLIENT: DMSC FW version [19.8.0-v2019.08 (Terrific Llama]
[MCU2_0] 0 SCICLIENT: DMSC FW revision 0x13
[MCU2_0] 0 SCICLIENT: DMSC FW ABI revision 2.6
[MCU2_0] 0 SCICLIENT: Init ... Done !!!
[MCU2_0] 0 UDMA: Init ... !!!
[MCU2_0] 0 [UDMA]
[MCU2_0] 0 [Error] Sciclient event config failed!!!
[MCU2_0] 0 [UDMA]
[MCU2_0] 0 [Error] Event config failed!!
[MCU2_0] 0 [UDMA]
[MCU2_0] 0 [Error] Global master event register failed!!!
[MCU2_0] 0 UDMA: ERROR: Udma_init failed !!!
[MCU2_0] 0 UDMA: Init ... Done !!!