Other Parts Discussed in Thread: SYSBIOS
Tool/software: Code Composer Studio
EVMK2GX
bios_6_52_00_12
ccsv8
ipc_3_47_01_00
multiprocmgr_3_0_4_0
pdk_k2g_1_0_9
processor_sdk_rtos_k2g_4_03_00_05
ti-cgt-c6000_8.2.2
xdctools_3_50_03_33_core
ti-processor-sdk-linux-k2g-evm-04.03.00.05
I would like to use CCS to debug a TI-RTOS programs on the DSP which is using IPC with a Linux program on the ARM. To make things simple, I started with the IPC ex02_messageq example which runs fine when I mpmcl load it the DSP and run the host from the linux commandline. When I load the program through CCS Debug, it fails. There must be something that mpmcl load/run is doing that I need to replicate in code or a GEL file, but I have no idea what. Can someone who has this working supply a file?
After starting the debug session, and continuing through main, there's an internal assertion failure
VirtQueue_Instance_init:
Assert_isTrue(!(marValue & 0x1), NULL);
followed by failure due to VirtQueue having no available buffers.
The CCS Debug console output:
[t=0x000000a4:7ccf2f47] ti.ipc.family.tci6638.VirtQueue: ERROR: line 187: assertion failure
ti.ipc.family.tci6638.VirtQueue: line 187: assertion failure
xdc.runtime.Error.raise: terminating execution
2 Resource entries at 0x800000
[t=0x000000a4:7cd901a5] xdc.runtime.Main: --> main:
registering rpmsg-proto:rpmsg-proto service on 61 with HOST
[t=0x000000a6:4e4818c3] xdc.runtime.Main: NameMap_sendMessage: HOST 53, port=61
[t=0x000000a6:4e4873e8] ti.sysbios.knl.Semaphore: ERROR: line 202: assertion failure: A_badContext: bad calling context. Must be called from a Task.
ti.sysbios.knl.Semaphore: line 202: assertion failure: A_badContext: bad calling context. Must be called from a Task.
xdc.runtime.Error.raise: terminating execution
The stack:
- xdc_runtime_Assert_raise__I(unsigned short, char *, int, unsigned int)() at Assert.c:36 0x00871410
- ti_sysbios_knl_Semaphore_pend__E(struct ti_sysbios_knl_Semaphore_Object *, unsigned int)() at Semaphore.c:208 0x0085F440
- RPMessage_send(unsigned short, unsigned int, unsigned int, void *, unsigned short)() at RPMessage.c:569 0x0085FA24
- sendMessage$26(char *, char *, unsigned int, enum rpmsg_ns_flags)() at NameMap.c:81 0x0086DC74
- NameMap_register(char *, char *, unsigned int)() at NameMap.c:95 0x008738B8
- ti_ipc_transports_TransportRpmsg_Instance_init__E(struct ti_ipc_transports_TransportRpmsg_Object *, unsigned short, struct ti_ipc_transports_TransportRpmsg_Params *, struct xdc_runtime_Error_Block *)() at TransportRpmsg.c:114 0x00869224
- ti_ipc_transports_TransportRpmsg_create(unsigned short, struct ti_ipc_transports_TransportRpmsg_Params *, struct xdc_runtime_Error_Block *)() at messageq_single_pe66.c:32,025 0x00870660
- ti_ipc_transports_TransportRpmsgSetup_attach__E(unsigned short, void *)() at TransportRpmsgSetup.c:72 0x0086DE96
- IpcMgr_ipcStartup() at IpcMgr.c:96 0x0086A660
- ti_sysbios_BIOS_startFunc__I() at messageq_single_pe66.c:4,450 0x00873EBC
- ti_sysbios_BIOS_start__E() at BIOS.c:115 0x00877118
The problem seems to be that VirtQueue has no available buffers, so RPMessage blocks, which is not allowed inside BIOS_start.
ti/ipc/rpmsg/RPMessage.c:
Int RPMessage_send(...)
do { token = VirtQueue_getAvailBuf(transport.virtQueue_toHost, (Void **)&msg, &length); } while (token < 0 && Semaphore_pend(transport.semHandle_toHost, BIOS_WAIT_FOREVER));
ti/ipc/family/tci6638/VirtQueue.c:
Int16 VirtQueue_getAvailBuf(VirtQueue_Handle vq, Void **buf, Int *len)
/* There's nothing available? */ if (vq->last_avail_idx == vring->avail->idx) { head = (-1); }