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.

TMS320F28388D: IPC - message sent but not received

Part Number: TMS320F28388D

Hi,

Trying to move from basic IPC to message queue IPC.

I have a timer interrupt triggering an interrupt in core 1 to send a message using flag 1, which triggers an IPC interrupt on core 2 upon reception.

CPU1 sends a message using IPC_sendMessageToQueue , which returns a success. CPU2 gets its IPC interrupt triggered, and tries to read the message using IPC_readMessageFromQueue. However, this function returns a failure, and the message remains 0 in all elements of the IPC_Message_t structure.

I have checked the IPC registers on both cores, everything seems in order.

Any idea what could be causing the issue ?

Best regards,

Adrien

  • Hello,

    The expert is on leave. Please expect a reply by 18th March.

    Thanks & Regards,

    Sinchita

  • As a complement :

    A timer interrupt on the sending end calls this function : 

    IPCM_error_t IPCM_sendMessage(const IPCM_config_t *ipcconfigofmessage,
                                const IPCM_Exchangdatatype_t *message)
    {
        IPCM_error_t    _ipcerror=IPCM_SUCCESS;
        bool_t          _flagsend;
    
        /*Contrôle des entrées*/
        if((ipcconfigofmessage==NULL)||(message==NULL)
                ||(message->addressdata==NULL))
        {
            _ipcerror=IPCM_ARGUMENT_INVALID;
        }
        else
        {
            IPCM_tx_msg.command = IPCM_CMD_READ_MEM;
            IPCM_tx_msg.address = message->addressdata;
            IPCM_tx_msg.dataw1  = message->sizeofdatas;
            IPCM_tx_msg.dataw2  = message->id_message;         // Message identifier
            _flagsend=IPC_sendMessageToQueue(ipcconfigofmessage->type, ipcconfigofmessage->msgqueue,
                                            IPC_ADDR_CORRECTION_ENABLE, &IPCM_tx_msg,
                                            IPC_NONBLOCKING_CALL);
            if(_flagsend==TRUE)
            {
                IPC_waitForAck(ipcconfigofmessage->type, ipcconfigofmessage->flags);
            }
            else
            {
                _ipcerror=IPCM_ERR_SEND;
            }
        }
    
        return _ipcerror;
    }

    The IPC_sendMessageToQueue function returns a 1, meaning the message was sent properly.

    On the receiving end, the IPC interrupt is as follows : 

    __attribute__((interrupt)) void IPC_GetData_ISR(void)
    {
    	IPCM_error_t _err_ipc;
    	int16_t test = 0;
     
    	while(test==0)
    	{
    		test = IPC_readMessageFromQueue(ipc_config_cpu1_to_cpu2.type,
    								ipc_config_cpu1_to_cpu2.msgqueue,
    								IPC_ADDR_CORRECTION_ENABLE, &IPCM_rx_msg,
    								IPC_NONBLOCKING_CALL);
    	}
    
    // redacted code //
    
    	//Acknowledge pour effacer les flags
    	IPC_ackFlagRtoL(ipc_config_cpu1_to_cpu2.type,
    					ipc_config_cpu1_to_cpu2.flags);
    
    	// Acknowledge the PIE interrupt.
    	Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP1);
    }

    IPC_readMessageFromQueue always returns 0, keeping it trapped in  the test loop. (test loop is meant to be removed once the IPC works as expected).

  • Hi,

    Could you check the values of the PutWriteIndex and the PutReadIndex? 

    Also could you check to see if this is helpful? There was a bug with our msgqueue examples:

    https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1292430/tms320f28388d-cpu1-to-cm-ipc-message-queue-problem

    Best Regards,

    Ben Collier

  • Hi,

    PutWriteIndex and the PutReadIndex values are both 0. This is precisely the issue : except for the flag, everything in the message queue structure is empty !

    If the whole message queue is empty, it only makes sense that the IPC fails. That's precisely the question though : why is the message queue blank ?

    I checked the related post you mentionned. I didn't really get the part about the conflict between the message queue and the data send. Do you mean they might occupy the same memory address ? If so, wouldn't the queue be filled with nonsense (the content of the data sent) rather than just zeros ?

    Also, I have had absolutely terrible experiences messing with the cmd files, I really don't think I am in capacity to make modifications on my own.

    Thanks for your help,

    Best regards,

    Adrien

  • Adrien,

    I looked at your pasted code again, are you creating your own IPC_sendMessageToQueue() function? 

    Have you tried our IPC Message queue examples? There are a few important things that I'm not sure are being done:

    • declaring your messageQueue as a IPC_MessageQueue_t (defined in ipc.h)
    • Initializing the messageQueue with IPC_initMessageQueue()
    • Some things might be missing from your send message function

    Could you try starting with one of our IPC message queue examples, then modifying it to meet your application? It may be easier to start with a working example.

    Best Regards,

    Ben Collier

  • Benjamin,

    We developped an IPC_Manager module, with our own functions & structures whose name starts with IPCM_, which might be confusing for an external reviewer. However, our IPCM_xxx functions call standard TI IPC_xxx functions and structures.

    I confirm that my messageQueue is declared as IPC_MessageQueue_t (defined in ipc.h)

    I also confirm that the message queue is initilised with IPC_initMessageQueue(). I can see in the expression watch that our own structure points to the right place in the memory.

    To be perfectly honest, I work with Eric, whose issues with IPC you've solved in this post. All the IPC Manager stuff I use are adapations of his (he is responsible cor CPU1-CM communication, I am responsible for CPU1-CPU2 communication), and are based on IPC message queue examples. Since you've solved his issue today, his code works on his end ... but not on mine, which is the strange part.  

    Coming back to the idea of conflict between the message queue and the message sent, wouldn't this mean that the message queue is in the CPU1 to CPU2 msg ram ? This is declared nowhere (including in the examples). Is it implicit in somehow in the type ? Do I need to specify which section of the memory the message queue is in ?

    Best regards,

    Adrien

  • Adrien,

    Coming back to the idea of conflict between the message queue and the message sent, wouldn't this mean that the message queue is in the CPU1 to CPU2 msg ram ?

    This is correct. Please look at the top of the ipc.c file:

    Do I need to specify which section of the memory the message queue is in ?

    This should be done already in ipc.c. 

    Best Regards,

    Ben Collier

  • Also, the below is correct. When I have seen this issue, we were not seeing all zeroes.

    Do you mean they might occupy the same memory address ? If so, wouldn't the queue be filled with nonsense (the content of the data sent) rather than just zeros ?

    I think your problem is with initialization or your first time calling IPC_sendMessageToQueue()

  • Hi Benjamin,

    I figured out the issue (I think ?). As shown in my previous screenshots, I had 2 messagequeues, one for sending messages, one for receiveing. When I removed one and started using the same message queue for both sending and receiving, this problem fixed itself.

    Now I have lots of other problems with IPC, but this one, at least, is solved.

    Thanks for your help,

    Adrien