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.

TMS320F28379D: Flash boot on CPU2 and IPC's using

Part Number: TMS320F28379D
Other Parts Discussed in Thread: C2000WARE

Hi,

In my software, I want to use CPU1 and CPU2. Sequencing between each core is drive with IPC flags. Program for each core are loaded on FLASH.

During my tests, I tried many case : 

  • If I only load CPU1 (and removed IPC flags), after a restart of the MCU (power supply switch off then switch on), program restart correctly.

  • If I load CPU1 with an empty program (and no IPC flags) and CPU2 with a simple led blinking, program restart correctly after a restart (led blinking).

  • If I load CPU1 and CPU2 with their own program (and IPCs using), it works directly after programming, but it doesn't works after a restart.

  • I tried to add this line in CPU1 program, it doesn't works directly after programming both CPUs : 

                                       IPCBootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_FLASH)


Do you have an idea ? I suspect IPCs after a restart, but it's strange.

Thanks for your feedback.

Regards,

  • Ed,

    Have you tried ipc DriverLib example, and select the build configurations CPU1_FLASH, CPU2_FLASH ?

    C:/ti/c2000/C2000Ware_3_04_00_00/driverlib/f2837xd/examples/dual/ipc

  • Hello Santosh,

    Is it the same software than : C:\ti\c2000\C2000Ware_3_02_00_00\device_support\f2837xd\examples\dual\ipc_gpio_toggle

    I cannot try your example, because "Compiler version '18.12.1.LTS' is not currently installed!"

    How can I update the compiler ? Does it will change something on my previous programs if compiler is not the same ?

    Regards,

  • Ed,

    This example is similar to what you are running. I just tested the your example on my setup (F28379D controlCARD). It seems to work fine. I just needed to select CPU1_FLASH_STANDALONE build configuration. After writing the flash, I power-cycled the board and both LEDs are toggling as expected.

    Compiler version should not matter for this example. However you can install latest compiler and restart CCS, it should pick up latest compiler or select manually in 'Build Setting.."

    In your system, when it does not work, do you know where it gets stuck ?

  • Hello Santosh,

    I've just modified the program to have just a toggle on CPU1 (led toggle on CPU1) and a toggle on CPU2 on a free pin.

    - When CPU1 build configuration is CPU1_FLASH_DEBUG and CPU2 build configuration is CPU2_FLASH, program works in debug session, but when I disconnect CPU1 and CPU2, it doesn't works after a power-cycle.

    - When CPU1 build configuration is CPU1_FLASH_STADALONE and CPU2 build configuration is CPU2_FLASH, program doesn't works in debug session, but it works after a reboot.

    Is it the normal operation? I guess yes, so it seems to work.

    It seems my issue is due to multiple IPCs using. Some IPCs are drived by CPU1 and others by CPU2.
    What are common rules for IPC using ? Do I need to acknowledge flag directly after the !while instruction ?

    I have no issue with IPCs in my software when I execute it in Debug mode (so when I don't use IPCBootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_FLASH); instruction.
    But when I boot CPU2 on FLASH, I have some issue.

    I just show you example, first one is working after a reboot, not the second one : 

    First example, works after a reboot : 

    /////////////////////CPU1/////////////////////
    
    void main (void)
    {
        while(!IPCRtoLFlagBusy(IPC_FLAG17));
        IPCRtoLFlagAcknowledge(IPC_FLAG17);
        
            while(1)
        {
            functions
        }
    }
    
    __interrupt void ISR(void)
    {
        functions
        
        IPCLtoRFlagSet(IPC_FLAG4);
        
        functions
        
        PieCtrlRegs.PIEACK.all |= PIEACK_GROUP1;
    }
    
    /////////////////////CPU2/////////////////////
    
    void main(void)
    {
        // ---------- Declaration ----------
        // ---------- Code ----------
        IPCLtoRFlagSet(IPC_FLAG17);
    
        while(1)
        {
            while(!IPCRtoLFlagBusy(IPC_FLAG4));
            IPCRtoLFlagAcknowledge(IPC_FLAG4);
            IPCLtoRFlagClear(IPC_FLAG4);
            
            functions
        }
    }

    Second example, doesn't works after a reboot : 

    /////////////////////CPU1/////////////////////
    
    void main (void)
    {
        while(!IPCRtoLFlagBusy(IPC_FLAG17));
        IPCRtoLFlagAcknowledge(IPC_FLAG17);
        
            while(1)
        {
            functions
        }
    }
    
    __interrupt void ISR(void)
    {
        functions
        
        IPCLtoRFlagSet(IPC_FLAG4);
        
        functions
        
        while(!IPCRtoLFlagBusy(IPC_FLAG5));         
        IPCRtoLFlagAcknowledge(IPC_FLAG5);
        IPCLtoRFlagClear(IPC_FLAG5);
        
        PieCtrlRegs.PIEACK.all |= PIEACK_GROUP1;
    }
    
    /////////////////////CPU2/////////////////////
    
    void main(void)
    {
        // ---------- Declaration ----------
        // ---------- Code ----------
        IPCLtoRFlagSet(IPC_FLAG17);
    
        while(1)
        {
            while(!IPCRtoLFlagBusy(IPC_FLAG4));
            IPCRtoLFlagAcknowledge(IPC_FLAG4);
            IPCLtoRFlagClear(IPC_FLAG4);
            
            functions
            
            IPCLtoRFlagSet(IPC_FLAG5);
        }
    }

    Do you have an idea ?

    In my Init function (before the while(1) loop, I use this instructions for both CPU : IpcRegs.IPCCLR.all = 0xFFFFFFFF;

    Thanks for your support.

    Regards,

  • I'm not 100% sure that the issue is coming from the IPCs flag. It looks like when I add the instruction   IPCBootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_FLASH); , CPU2 program behavior is strange.

    Is this line mandatory ? Why cannot it works if I just add "_FLASH" in CPU2 predefined symbols ?

    Thanks for your support.

    Regards,

  • Hi Ed,

    To work in standalone mode, it needs to add _STANDALONE, which send this command to CPU2.

    IPCBootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_FLASH);

    Just wanted to confirm, are you able to run the example code from C2000Ware?

  • Hello Santosh,

    As explained on my previous post, yes it works in standalone mode (but only after a reboot).

    Forget all I explained previously with IPCs issues, it was a false issue.

    Let me just explain the issue I have today : 

    I have one program for CPU1 and one for CPU2, synchronized between themselves with IPC flags. SPI-A is drive by CPU2. CPU2 boot on FLASH (with instruction IPCBootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_FLASH); everything works properly in "standalone" mode after many reboots.

    I decided to use this program as a basis for adding functions. So I made a copy of these 2 programs.

    Immediately after copying these programs (so I didn't make any change), I built and launched them.

    - After reboots (so in standalone mode), it seems that SPI-A is not drive correctly by CPU2.

    - If I remove the instruction IPCBootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_FLASH); , (that means CPU1 and CPU2 are use in Debug mode, doesn't works after a reboot), SPI-A is drive correctly by CPU2

    Do you have an idea ? It's a very strange issue, I've just made a copy-paste of my programs and it doesn't work anymore.

    Regards,

  • Hi Ed,

    After copying the project, are you switching to CPU_FLASH configuration for CPU2? If yes, then calling IPCBootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_FLASH); on CPU1 should work.

    Other thing you can try to import from the previous project rather than copying it manually.

    Other than that, I do not any other idea. If you have a simpler project, I can try at my end.

  • What is the way to import a project and duplicate it instead of copying it manually ?

    Regards,

  • Go to CCS menu 'Project --> Import Projects'

    It pulls the settings from the original projects.

  • Hi Santosh,

    Thanks for your feedback.

    I have another linked question ; in my software, I need to write in the FLASH some values (I choose FLASH J for datas).

    In Debug mode, I can write new values in the FLASHJ, no issues.
    But when I'm in Standalone mode, program stopped, but it's link to the the FLASH memory writing. (when I remove this function, program is running)
    Do you have an idea ?

    Regards,

  • Hi Ed,

    Santosh asked me to take a look at this post.  Since we closed the original question of this post, please open a new post for your flash programming question.

    We will assign the new post to the corresponding expert to help you.  

    Thanks and regards,

    Vamsi