arjun.a
range data
5aefcf4
raw
history blame
3 kB
Ticket Name: PROCESSOR-SDK-TDAX: when I debuged the app_tidl(vision_apps/apps/dl_demos/app_tidl), I have some questions
Query Text:
Part Number: PROCESSOR-SDK-TDAX Other Parts Discussed in Thread: TDA2 question1: In the file of vision_apps/utils/ipc/src/app_ipc_linux_rpmsg_char.c, I found that obj->ipc_notify_handler was a function pointer to the type of app_ipc_notify_handler_f.But,I don't know it pointer to which function when call obj->ipc_notify_handler(app_cpu_id, payload),the function show as below. typedef struct { app_ipc_init_prm_t prm; void *hw_spin_lock_addr; app_ipc_notify_handler_f ipc_notify_handler; int tx_fds[APP_IPC_CPU_MAX]; uint32_t local_endpt[APP_IPC_CPU_MAX]; rpmsg_char_dev_t *rcdev[APP_IPC_CPU_MAX]; pthread_t task; int unblockfd; } app_ipc_obj_t; static void appIpcRpmsgRxHandler(uint32_t app_cpu_id, uint32_t payload) { app_ipc_obj_t *obj = &g_app_ipc_obj; if(app_cpu_id<APP_IPC_CPU_MAX) { #ifdef APP_IPC_DEBUG appLogPrintf("IPC: RX: %s -> %s (port %d) msg = 0x%08x\n", appIpcGetCpuName(app_cpu_id), appIpcGetCpuName(appIpcGetSelfCpuId()), (uint32_t)obj->local_endpt[app_cpu_id], payload); #endif if((payload & 0xFFFF0000) == 0xDEAD0000) { /* echo message dont send to handler */ printf("IPC: RX: %s -> %s (port %d) msg = 0x%08x\n", appIpcGetCpuName(app_cpu_id), appIpcGetCpuName(appIpcGetSelfCpuId()), (uint32_t)obj->prm.tiovx_rpmsg_port_id, payload); } else { if(obj->ipc_notify_handler) { obj->ipc_notify_handler(app_cpu_id, payload); } } } } then I found a suspectable call in the function (void tivxObjDescInit(void)),detail definition showed as below , I can't confirm that,because I added some printf information("======") ,but it didn't show in the terminal. void tivxObjDescInit(void)(tiovx/source/framework/vx_obj_desc.c) { printf("=====================================\n"); tivxPlatformGetObjDescTableInfo(&g_obj_desc_table); tivxIpcRegisterHandler(tivxObjDescIpcHandler); printf("=====================================\n"); } question2: I found that there are four definitions about the function tivxInit(void), in order to determine which tivxInit() function to be called , so I added some printf information(printf("from file : %s ; from function: %s\n", __FILE__, __FUNCTION__);) in every tivxInit() function, before called the tivxInit(void) ,I added printf("++++++++++++++++++++++++++\n"); But there are nothing about from file : %s ; from function: %s\n", __FILE__, __FUNCTION__ ,Only show the "+++++++++++++++++++++++++++" in the terminal. So don't kown why?
Responses:
Hi, Although there are 4 tivxInit, they are used for different purpose/platform. The one defined in vision_sdk/linux (biod)/tivx_init.c was used on TDA2/3x devices, so you could ignore them. The one defined in pc/common/tivx_init.c is used in PC emulation mode. The one defined in psdk_j7/common/tivx_init.c is actually used on TDA4x.. For the first question, yes, this is where IPC handler is registers. The call flow is tivxIpcHandler -> g_ipc_handler. Regards, Brijesh