Other Parts Discussed in Thread: SYSBIOS
Hi,
we work on sdk 7.3. In order to send data from mcu21 to a linux application, we init ipc and send a special msg to mcu21 at the beginning of the linux application; then, we modify the rtos ipc code, if mcu21 received this special msg, it will keep this endpoint,and send data to the linux app through this endpoint in other task later.
linux app code
void init() { ret = appCommonInit(); ret = appIpcSendNotify(APP_IPC_CPU_MCU2_1, 0x11223344); } …………
rtos code
//$PSDKRA/vision_apps/utils/ipc/src/app_ipc_sysbios.c static void appIpcRpmsgRxHandler(RPMessage_Handle rpmsg_handle, void *arg, void *data, uint16_t len, uint32_t src_cpu_id, uint16_t src_endpt, uint16_t dst_endpt) { uint32_t app_cpu_id, payload; app_ipc_obj_t *obj = arg; payload = *(uint32_t*)data; if(src_cpu_id<IPC_MAX_PROCS && len == sizeof(payload)) { app_cpu_id = g_ipc_to_app_cpu_id[src_cpu_id]; if((payload == 0x11223344) && (appIpcGetSelfCpuId() == APP_IPC_CPU_MCU2_1)) { reply_endpt_app = src_endpt; App_IpcRxCbk((unsigned char *)&payload); } ………… } int32_t appIpcSend_App(uint32_t dest_cpu_id, unsigned char *buf, uint32_t buf_len) { int32_t status = -1; app_ipc_obj_t *obj = &g_app_ipc_obj; uint32_t port_id; if(dest_cpu_id == IPC_MPU1_0){ if(reply_endpt_ips == 0){ return -1; } port_id = reply_endpt_app; }else{ port_id = APP_IPC_TIOVX_RPMSG_PORT_ID; } …… }
We have do a large number of cycle power on test, In most case, it work well;but in occasional case, mcu21 cannot receive the msg from linux, at this moment, linux app dose not return error,mcu21 startup log normal and work well,it just donot receive ipc msg.
by the way, we modify the map layout,here is the code
//vision_apps/apps/basic_demos/app_tirtos/tirtos_linux/mcu2_1/linker_mem_map.cmd MEMORY { /* R5F_TCMA [ size 32.00 KB ] */ R5F_TCMA ( X ) : ORIGIN = 0x00000000 , LENGTH = 0x00008000 /* Main OCRAM for MCU2_1 [ size 128.00 KB ] */ MAIN_OCRAM_MCU2_1 ( RWIX ) : ORIGIN = 0x03620000 , LENGTH = 0x00020000 /* R5F_TCMB0 [ size 32.00 KB ] */ R5F_TCMB0 ( RWIX ) : ORIGIN = 0x41010000 , LENGTH = 0x00008000 /* DDR for MCU2_1 for Linux IPC [ size 1024.00 KB ] */ DDR_MCU2_1_IPC ( RWIX ) : ORIGIN = 0xA4000000 , LENGTH = 0x00100000 /* DDR for MCU2_1 for Linux resource table [ size 1024 B ] */ DDR_MCU2_1_RESOURCE_TABLE ( RWIX ) : ORIGIN = 0xA4100000 , LENGTH = 0x00000400 /* DDR for MCU2_1 for code/data [ size 31.00 MB ] */ DDR_MCU2_1 ( RWIX ) : ORIGIN = 0xA4100400 , LENGTH = 0x01EFFC00 /* Memory for IPC Vring's. MUST be non-cached or cache-coherent [ size 32.00 MB ] */ IPC_VRING_MEM : ORIGIN = 0xB0000000 , LENGTH = 0x02000000 /* Memory for remote core logging [ size 256.00 KB ] */ APP_LOG_MEM : ORIGIN = 0xB2000000 , LENGTH = 0x00040000 /* Memory for TI OpenVX shared memory. MUST be non-cached or cache-coherent [ size 63.62 MB ] */ TIOVX_OBJ_DESC_MEM : ORIGIN = 0xB2040000 , LENGTH = 0x03FA0000 /* Memory for shared memory buffers in DDR [ size 384.00 MB ] */ DDR_SHARED_MEM : ORIGIN = 0xB8000000 , LENGTH = 0x18000000 /* DDR for MCU2_1 for non-cached heap [ size 112.00 MB ] */ DDR_MCU2_1_NON_CACHE ( RWIX ) : ORIGIN = 0xD1000000 , LENGTH = 0x07000000 /* DDR for MCU2_1 for local heap [ size 16.00 MB ] */ DDR_MCU2_1_LOCAL_HEAP ( RWIX ) : ORIGIN = 0xDA000000 , LENGTH = 0x01000000 }
Thanks!