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.

f28m35h52c1 - IPC Shared Memory

Other Parts Discussed in Thread: CONTROLSUITE

Hi at all,
I'm running into some problems. I want to share some data between the c28 am M3 on my F28M35H52C1 Controller.
I create a new Projekt for the M3 and implement a IPC Messaging to share Data between my M3-Project and the SolarExplorer_PVInverter C28Part out of the ControlSuite (controlSUITE_INSTALL_DIR\development_kits\SolarExplorer_v1.1\SolarExplorer_PVInverter_F28M35Hx\C28x). This works very well.

So I create a new Project for the C28 an implement a IPC Messaging and an LED Blinking.
But my M3 and C28 Programms do not share any Data. Both Programms are running . The M3 display some text at the console and the LED, controlled by the c28 are blinking. I think there is something missing in my C28 Project.
Can someone explain me what's missing or what I'm doing wrong?

At the Line 536 to 540 in empty.c in the M3-Project there are some read and write operations through shared Memory.
At the line 198 to 202 in main.c there are the read an write operations in the C28-Project.
The CMD-Files are copies from the SolarExplorer_PVInverte.

I'm using CCS V6.1.3.00033

Thanks an best regarts Chris

3162.MyF28_MyM3_2016_08_08.zip

  • Hi C.Lorei,

    I'm looking at your project now, but for reference could you let me know what version of ControlSuite the working example was based off of?

    Best,
    Alexander
  • Hi Alexander,
    the controlSUITE Version is 3.4.0.

    "off of"
    Sorry for my bad englich. I wanted to say that my m3 project works with the original code  SolarExplorer_PVInverter. I just add some lines of code to the SolarExplorer_PVInverter C28Project. So that the two struct matches with the struct in my m3 Project and Values are shared between the two project.

  • Hi C.Lorei,

    Apologies for the late reply, from the BIOS documentation for the IPC module "Concerto devices have 8 segments of shared RAM. Each segment has 8 KB. Only one core can have read/write access to a shared memory segment at a time. The other core has read access to that segment".

    Even though you're using the ControlSuite's IPC module, you'll need to state that the M3 core has write access to a specific shared memory block. This is done through the RAMMReqSharedMemAccess() API. See the following thread for an example on how to set this functionality up.

    Another example of setting up shared access can be seen in your ControlSuite installation:
    C:\ti\controlSUITE\device_support\f28m36x\v207\F28M36x_examples_Dual\mtoc_ipcdrivers\m3\mtoc_ipcdrivers_m3.c


    Best,
    Alexander
  • Hi Alexander,
    apologies for the late reply and thanks for your answer.
    I think that the settings in my M3 Project are fine. Because with this lines of code in my M3-Project:

    #define M3_MTOC_PASSMSG 0x2007F800  // MTOC MSG RAM offsets for passing data
    #define M3_CTOM_PASSMSG 0x2007F000  // CTOM_MSG RAM
    
    MtoC_Message1_Ptr= (void *)M3_MTOC_PASSMSG;
    MtoM_Message1_Ptr= (void *)M3_CTOM_PASSMSG;
    
    //the structs 
    
    // Variables that need to shared with C28x and M3
    // m3 owned memory region
    struct MtoC_Message {
    	int		InvStart;
    	int 	InvStop;
    	float 	LightCommand;
    };
    
    volatile struct MtoC_Message *MtoC_Message1_Ptr;
    
    //C28x owned memory region
    struct CtoM_Message {
    	int InverterStatus;
    	float PanelPower;
    	float PanelPower_Theoretical;
    	float PanelVoltage;
    	float PanelCurrent;
    	short BoostVoltage;
    };
    
    volatile struct CtoM_Message	*CtoM_Message1_Ptr;

    and with MtoC_Message1_Ptr->MEMBER_NAME to write Data (e.q. MtoC_Message1_Ptr->InvStop = 10;)
    and with CtoM_Message1_Ptr->MEMBER_NAME to read Data (e.q. int testvar = CtoM_Message1_Ptr->InverterStatus;)

    It is possible to share data between M3(MyCode) and C28(original Code). The M3 project seems to set the required read/write Options to the original C28.
    The problem must be in my C28 Project, in my humble opinion.

  • Hi C.Lorei,

    A few things I did notice in your linker command files are that you're definitions for the Memory block for the C28 to M3 shared RAM segments have different names and lengths.

    Within the M3 linker.cmd file:

        CTOMMSGRAM (R)  : origin = 0x2007F000, length = 0x800
        MTOCMSGRAM (RW) : origin = 0x2007F800, length = 0x800

    Within the C28 linker.cmd file:

       CTOMRAM     : origin = 0x03F800, length = 0x000380     /* C28 to M3 Message RAM */
       MTOCRAM     : origin = 0x03FC00, length = 0x000380     /* M3 to C28 Message RAM */
       

    Also from my understanding you're able to write data to the M3 shared memory but when reading data on the C28x the data is corrupt. Is this correct?

    Could you step through the code and look at the memory browser view from the C28 and M3 perspectives and look at what each is showing?

    Best,

    Alexander

  • Oh shi...
    I have so often checked this and didn't see it.
    I'll take a look at the Linkerfile, until next Tuseday.
  • Hi Alexander ,
    I have checked the settings again. The linker.cmd Files are correct.
    The two cmd files in my project are 1:1 copies from the SolarExplorer_PVInverter_F28M35x-Project. Here are also different names and lengths defined.


    The Combination of MyM3-Project and the original C28-Project (SolarExplorer_PVInverter_F28M35x_C28x) works fine.
    I made a few adjustments to the C28 Project. So I can write Values from M3 to C28, read the values at the C28 and manipulate them, write values from C28 to M3 and
    read the values at the M3-Project.


    But the Combination myM3-Project and myC28-Project did not work. I can't share any Informatio through the shareed memory.


    My Solution is to remove all unnecessary code out of the original C28-Project and implements a new logic.
  • Hi C.Lorei,

    Could you upload the .out file for your m3 and c28 application in addition to the map files?

    Also if you write from the c28 or m3 are you able to see that memory change value in the memory browser?

    Best,
    Alexander