This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ipc concerto rtos semaphore

Hello,

I'm using Concerto M3 with TI-RTOS, C28X without OS.

I want M3 to comunicate with C28X,

so I use raw IPC register in this way for M3

uint32 Ipc_Generic(uint32 command, uint16 address, uint32 value)
{
	Semaphore_pend(Ipc_Semaphore, BIOS_WAIT_FOREVER);//lock

	// write COMMAND, ADDRESS, VALUE
HWREG(MTOCIPC_BASE + IPC_O_MTOCIPCCOM)= (uint32)command; HWREG(MTOCIPC_BASE + IPC_O_MTOCIPCADDR)= (uint32)address; HWREG(MTOCIPC_BASE + IPC_O_MTOCIPCDATAW)= (uint32)value; //read RESULT uint32 result = Ipc_GetResult(); Semaphore_post(Ipc_Semaphore);//unlock return(result); }

I use a Semaphore beacause more task calls this routine.

In particular I have a task that comunicate with PC via UART (and read some value from C28X)

and a task that save data to uSD from C28X. I call them TASK1 and TASK2.

When TASK2 calls Ipc_Generic TASK1 begins to doesn't work.

can someone help me ?

  • here the code of Ipc_GetResult

    uint32 Ipc_GetResult()
    {
    	#define TIMEOUT 2/*ms*/
    	#define FLAG IPC_FLAG1
    
    	IPCMtoCFlagSet(FLAG);//set FLAG
    
    	uint32 tick1 = Clock_getTicks();
        while (IPCMtoCFlagBusy(FLAG))//wait till FLAG zeroes
        {
        	uint32 tick2=Clock_getTicks();
        	if(tick2-tick1>TIMEOUT)
        		return(0);//no C28X answer, return 0
        }
    
        return(HWREG(MTOCIPC_BASE + IPC_O_MTOCIPCDATAR));//return M3 to C28 IPC data REGISTER
    }

  • Sorry ....

    I had not include Semaphore module to my sys ....

    now it works well.

     

  • Hello,
    can I ask you something? As I understand, you us on the M3 side RTOS on the C28 side none and you transfer data via IPC from M3 to C28 or vice versa.
    I'm trying this also, can you give me an simpel example code for both sites.

    With RTOS on both sides I get it out but I want to use different PINs of the C28 and it works probably better / easier without RTOS in my opinion.

    Thanks Chris