Quantcast
Channel: Processors forum - Recent Threads
Viewing all articles
Browse latest Browse all 17527

RTOS/TMS320C6678: MessageQ_alloc() & MessageQ_free() does these bios APIs are protected from multiple core access?

$
0
0

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


Viewing all articles
Browse latest Browse all 17527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>