Part Number:TMS320C6678
Tool/software: TI-RTOS
Hi,
One of our product has developed using bios_6_37_02_27 & ipc_3_21_00_07 and we want to do add certain features. we found that MessageQ_alloc() & MessageQ_free() are used accessed without any lock protection from multiple core. does these APIs are protected internally?
if not, i have tried to uses these following function to provide the lock and core is hang at while loop in HSEM_Unlock(). Now the issue is occasionally device core 0 is hung. we found that while receiving message in messageQ is getting into this stage. Can you please help me to resolve the issue?
void HSEM_Lock(Hsem *pThis) { //volatile CSL_SemVal semVal; // not required for C6678 while(1) { if(CSL_semIsFree (pThis->Sem_Number)) { break; } else { Task_yield();// SYSBIOS function } } while(1) { if(!CSL_semAcquireDirect(pThis->Sem_Number)) { LOG_TRACE0("CSL_semHwControl error"); } if((!CSL_semIsFree (pThis->Sem_Number)) &&(CSL_semGetResourceOwner(pThis->Sem_Number)== Core_Num)) { break; } else { Task_yield();// SYSBIOS function } } } void HSEM_Unlock(Hsem *pThis) { while(1) { if(CSL_semIsFree (pThis->Sem_Number)) { break; } else { CSL_semReleaseSemaphore(pThis->Sem_Number); } } }
Regards
Bala