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.

F28M35x How does M3 respond the IPC interrupt from C28

Other Parts Discussed in Thread: CONTROLSUITE

Hi friends,

I have some questions about the application of ipc.For instance,M3 is handling some other tasks, and C28 generates a IPC interrupt at the same time.So, How does M3 respond the IPC interrupt from C28? Does M3 respond the IPC interrupt when M3 having finished some other tasks?If is it feasible?If is there some better methods?Thank you!

Best reagrds,

Honeyue

  • Hi Honeyue (Hi Gautam)!

    About IPC I would recommend you this material (mainly an example on p.102)3187.F28M35x_Workshop_2-0.pdf. Also this thread will be useful http://e2e.ti.com/support/microcontrollers/c2000/f/171/t/279813.aspx?pi177899=1.

    Regards,

    Igor

  • Thank you Gautam and lgor!

    I have gone through these threads,and I hold that what I mean is a little different from these threads.What I want to know is how the two cores do about  untreated IPC interrupts.

    Best regards,

    Hongyue

  • Hi Hongyue!

    I'm not sure but I try to answer your question. For flexible exchange data between master (M3) and control (C28x) subsystems there is the unit of an interprocessor exchange (IPC), which contains a several unidirectional (from M3 to C28 or vice versa) register's RAM of messages and also the configurated RAM for data exchange. In addition, for the several RAM registers of messages there are interrupts which provide the exchange of critical-data in real-time without distracting processors for poll of the bits of the register of an interprocessor interaction.

    Regards,

    Igor

  • Hi lgor,

    Thank you! There are still several problems to consult you.

    1、If there is a IPC interrupt when M3 or C28 is busy,and the IPC interrupt is important and must be handled.Is there a good method to solve this problem?As what you said,IPC interrupt will not be ignored regardless of the two cores handling other events .Is't right?

    2、 Now I'm not clear about the process of IPC communication.Can you explain this function "   IPCMtoCDataWrite(&g_sIpcController1, pulMsgRam[0],(unsigned long)usWWord16,  IPC_LENGTH_16_BITS, ENABLE_BLOCKING, NO_FLAG);" (mtoc_ipcdrivers)to me?And does the function generate a IPC interrupt to C28 when excuting the function? If so,C28 will respond this IPC interrupt and excuting the ISR and excuting the corresponding IPCMtoCDataWrite(&sMessage),after finishing the instruction,C28 will return the MTOCIPCACK.I don't know what I understand is right or not.If not right,please help me to correct it.

    Best regards,

    Hongyue

     

  • Hello Hongyue!

    Sorry for the long answer. A brief summary of the interprocessor communication I have tried already to do above. I have supposed that I can add somthing else regarding your new questions but I think the best way consists at the study of Chapter 1.12 of TRM with accent on "IPC with Interrupts" and "IPC with Flags" 4621.TI_F28M35x_manual.pdf. Also I would recommend you to refer to the IPC examples from ti\controlSUITE\device_support\f28m35x\v201\F28M35x_examples_Dual\

    Regards,

    Igor

  • Hi lgor!

    I wonder whether it will generate an IPC interrupt or not when I execute the function "IPCMtoCDataWrite() or IPCMtoCDataRead()".That is to say,if it will set MTOCIPCSET register and generate MTOCIPCINTx to the C28x through the PIE when I execute the function "IPCMtoCDataWrite()".Thank you!

    Best Regards,

    Hongyue

  • Hi Hongyue!

    If you look at source code of this functions carefully then you can see that they operate with IPC flags only and they do not set any registers for generation of interrupt (for example MTOCIPCSET). Please pay attention that for the work with IPC-registers the macros for hardware access are used (HWREG(....)).

    Regards,

    Igor

     

  • Hongyue,

    You got it right.

    IPCMtoCDataWrite() calls the function IpcPut() which in turn sets the IPCSET flag. When this flag is set an a C28x IPC interrupt is generated .

    Thanks

    Noah

  • Hello Noah!

    Noah:Berhanu said:

    IPCMtoCDataWrite() calls the function IpcPut() 

    I'm disappointed twice! 

    1 I misled Hongyue.

    2 It is not apparent absolutly from the source code which is presented in controlSUITE.

    Please show me a place (a line) in the source code of IPCMtoCDataWrite() where this function IpcPut() is called explicitly (or implicitly). Or this calling is hidden at some library? What technical documentation enlights this mechanism (TRM does not contain that info)?

    Thanks,

    Regards,

    Igor

  • Igor,

    please look at the following directory in controlSUITE.

    C:\TI\controlSUITE\device_support\f28m35x\v201\MWare\driverlib (whatever version you have is fine - it doesn't have to be v201)

    The drivers are built based on the source and header files found in this folder. Take a look at the files ipc.c , ipc.h, ipc_lite.c , ipc_util.c, Those two particular functions are found in ipc.c

    Thanks

    Noah

  • Hi Noah!

    Many thanks. I found this calling

    // Put Message into PutBuffer and set IPC INT flag
    usStatus = IpcPut (psController, &sMessage, bBlock);

    Funny search problem have taken place. I have looked for "IpcPut(" but at source code is "IpcPut (" (with space). I hope I will be more careful in the future.

    Nevertheless, the function IpcPut() is hidden in the library  ti\controlSUITE\device_support\f28m35x\v201\MWare\driverlib\ccs\Debug\driverlib.lib. Or I'm wrong again?

    Regards,

    Igor

  • Igor,

    You are right. the .lib is the compiled binary. But we also provide the source code in .....\f28m35x\v201\MWare\driverlib\ipc.c 

    Thanks

    Noah

  • Hi Noah!

    Again many thanks. I found all.  It was the same problem with space. That's funny. Obviously the source code of IPC  has several authors: somebody writes space after function name and somebody not. Well at least I was interested to delve into the IPC code.

    Thanks,

    Regards,

    Igor

    PS Hongyue! Please accept my apologies for some incorrect statements.

  • Thank you Noah! Thank you lgor all the same!

    I'm very glad to get your help!Thank you!

    Best regards,

    Hongyue

  • Hi Noah and lgor!

    When I execute the function "IPCMtoCDataWrite()"(mtoc_ipcdrivers),M3 writes data into address that belongs to M3 not C28,is't right?If writting data into address of M3,C28 should execute the function "IPCMtoCDataRead() ".  But according to the routine in the controlSuite,after M3 executing the funcion IPCMtoCDataWrite(),C28 enters interrupt and executes the corresponding "IPCMtoCDataWrite()",So I don't understand this process.

    Best Regards,

    Hongyue

  • Hi Hongyue!

    hongyue yu said:

    But according to the routine in the controlSuite,after M3 executing the funcion IPCMtoCDataWrite(),C28 enters interrupt and executes the corresponding "IPCMtoCDataWrite()"

    What the routine do you mean? What is C-file? Could you please represent this source code?

    Regards,

    Igor

  • Hi lgor,

    Sorry! My expression is not clear.It's the manual "F28M35x-DRL-UG.pdf".As the following figure

    Best Regards,

    Hongyue

  • Hi Hongyue!

    I see.

    extern void IPCMtoCDataWrite(tIpcMessage *psMessage);// F28M35x_Ipc_drivers.h - receiving at C28

    extern unsigned short IPCMtoCDataWrite(volatile tIpcController *psController,
    unsigned long ulAddress,
    unsigned long ulData,
    unsigned short usLength,
    unsigned short bBlock,
    unsigned long ulResponseFlag);//ipc.h - sending from M3

    Regards,

    Igor

  • Hongyue,

    We have IPCMtoCDataWrite defined in both M3 and C28. But their functionality is different. In M3 it sends a write command to C28 , the data to be written along with which local memory (local to C28) the data should be written.

    For example M3 can not write to C28 M0 memory location. But if M3 wants a particular data value to be written to M3 it can use IPCMtoCDataWrite and provide the address and data value. 

    IPCMtoCDataWrite  on M3 side writes the above data  and address to the message rams (M to C)and sets a flag. The flag results in an interrupt on C28.

    The C28 application would have an isr that services this particular interrupt. This isr, has to call IPCMtoCDataWrite function that is defined in C28 which will read the data written by M3 from the message rams (M to C) and writes the data to the specific memory address requested by M3.

    Thanks

    Noah 

  • Hi Noah,

    Thank you! That is to say,In isr IPCMtoCDataWrite function means a read not a write,isn't right?

    Best regards,

    Hongyue

  • Hi Hongyue!

    You can see clearly from  the following source code.

    1)

    ti\controlSUITE\device_support\f28m35x\v201\F28M35x_examples_Dual\mtoc_ipcdrivers\c28\mtoc_ipcdrivers_c28.c:

    //*****************************************************************************
    // MtoC INT1 Interrupt Handler - Handles Data Word Reads/Writes
    //*****************************************************************************
    __interrupt void
    MtoCIPC1IntHandler (void)
    {
    tIpcMessage sMessage;

    // Continue processing messages as long as MtoC GetBuffer1 is full
    while (IpcGet (&g_sIpcController1, &sMessage,
    DISABLE_BLOCKING)!= STATUS_FAIL)
    {
    switch (sMessage.ulcommand)
    {
    case IPC_SET_BITS:
    IPCMtoCSetBits(&sMessage);
    break;
    case IPC_CLEAR_BITS:
    IPCMtoCClearBits(&sMessage);
    break;
    case IPC_DATA_WRITE:
    IPCMtoCDataWrite(&sMessage);
    break;
    case IPC_DATA_READ:
    IPCMtoCDataRead(&g_sIpcController1, &sMessage, ENABLE_BLOCKING);
    break;
    case IPC_FUNC_CALL:
    IPCMtoCFunctionCall(&sMessage);
    break;
    default:
    ErrorFlag = 1;
    break;
    }
    }

    // Acknowledge IPC INT1 Flag and PIE to receive more interrupts from group
    // 11
    CtoMIpcRegs.MTOCIPCACK.bit.IPC1 = 1;
    PieCtrlRegs.PIEACK.all = PIEACK_GROUP11;
    }

    2)

    ti\controlSUITE\device_support\f28m35x\v201\F28M35x_common\source\F28M35x_Ipc.c:

    void IPCMtoCDataWrite(tIpcMessage *psMessage)
    {
    // Data word length = dataw1 (15:0), responseFlag = valid only for IPC flags
    // 17-32
    //
    Uint16 length = (Uint16) psMessage->uldataw1;
    Uint32 responseFlag = (psMessage->uldataw1) & 0xFFFF0000;

    // Write 16/32-bit word to address
    //
    if (length == IPC_LENGTH_16_BITS)
    {
    *(Uint16 *)(psMessage->uladdress) = (Uint16)psMessage->uldataw2;
    }
    else if (length == IPC_LENGTH_32_BITS)
    {
    *(Uint32 *)(psMessage->uladdress) = psMessage->uldataw2;
    }

    // If data write command is in response to a data read command from C28
    // to M3, clear ResponseFlag, indicating read data from M3 is ready.
    //
    CtoMIpcRegs.CTOMIPCCLR.all |= responseFlag;
    }

    Regards,

    Igor