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 C28-BootLoader

Other Parts Discussed in Thread: SYSBIOS, CONTROLSUITE

 Dear support,

We have Concerto F28M35H52C1 Loader M3 that prform M3-application programming. 
But we have to program C28 firmware also and as result of it our loader should be dual (include M3 and C28 parts). 

C28 firmware run from the flash only if its start address = 0x13FFF0.

   FLASH       : origin = 0x100000, length = 0xFFE0
   BEGIN       : origin = 0x13FFF0, length = 0x2

 If I change this address to another one – C28 doesn’t start after booting. 

   FLASH       : origin = 0x100000, length = 0xFFE0
  BEGIN       : origin = 0x10FFE0, length = 0x2

 How to run  C28 firmware with begin-address different from 0x13FFF0? How M3-loader/application know what C28 program to run (our C28 flash include two programs – C28 loader and C28 application)

 Could you help us with it?

 Thanks, Sabina

  • Sabina,

    the address where C-Boot ROM branches to when given a boot to flash IPC command is fixed, this is documented in the C-Boot ROM chapter of the device TRM.

    if you want to alter the that then try the branch IPC command supported by C-Boot ROM instead of the boot to flash IPC command.

    Hope it helps.

    Best Regards

    Santosh

     

  • Hi Santosh,

    Thanks for reply.

    We have M3 preloader that jump to M3Loader or M3Application depend on read value via SPI from some specific periferial.
    in C28Preloader we also can jump to C28Loader or C28application.

    The problem is how to sinchronize M3Preloader&C28Preloader(without Sys/Bios).

    Now we have the following scenario:

    1. RunM3/C28 preloader and perform IPC sinchrinization
    2. M3Preloader  read SPI value and send Notification to C28 what value was written
    3. M3/C28 jump to Loader or Application

    Could we do IPC sincronization only for notification?  If yes - how to do it?
    Does TI provide any example with IPC sinchrinization for notification only?

    I started with ctom_ipcdrivers dual example , but i am not sure if we need all these sinchronization process. Preloader should work very quickly.

    In additional in this example M3 is not continue after:

        IPCMtoCBootControlSystem(CBROM_MTOC_BOOTMODE_BOOT_FROM_FLASH);

    command,

    and in c28 it wait always in the command:

        // Spin here until M3 has written variable addresses to pulMsgRam
        while (CtoMIpcRegs.MTOCIPCSTS.bit.IPC17 != 1)
        {
        }

    Could you please help us with it?

    Thanks,Sabina

     

  • Sabina,

    yes it should be possible to implement a simple IPC synchronization sequence between M3 and C28x.

    Sabina Greenberg101872 said:

    Now we have the following scenario:

    1. RunM3/C28 preloader and perform IPC sinchrinization
    2. M3Preloader  read SPI value and send Notification to C28 what value was written
    3. M3/C28 jump to Loader or Application

    for 1 above you would be using a Boot to flash IPC command or a Branch IPC command supported by C-Boot ROM.

    Now for 2, once the preloader starts it can reinitialize the PIE Vector table and install its own IPC ISR routines which does what you need (at the least complex level, M3 sets an IPC flag which can trigger an IPC interrupt on C28x and the ISR on C28x sets a global variable for the preloader function to proceed. The same can be used by M3 to transfer a 32 bit data to C28x using IPC registers, C28x ISR after it is done with the data reads it will ACK or clear the IPC flag and M3 keeps polling for C28x to clear this flag)

    Does your preloader run SYSBIOS if yes, then you might have to post a question to SYSBIOS forum to see what you plan to do comes in way with SYSBIOS IPC support. if Preloader doesn't run SYSBIOS then its simple.

    for 3, again you can use IPC from M3 to C28x to let the pre-loader know that it has to branch to a certain location to start the application.

     

    Best Regards

    Santosh

  • Hi Santosh,

    Thanks for explanation.

    all this process with  M3/C28 preloader and IPC sinchrinization work outside the debugger. I use IO/Leds  for know if sinchrinization succedded or not.  I work without sys/Bios in CC5.1.

    Should sinchrinization work with CCS debugger also ? 

    Thanks,Sabina

  • Sabina,

    yes it should work with debugger connected as well, but you might have to be make sure that both the cores are running. When M3 application sends a IPC Boot mode command or other IPC commands to C-Boot ROM you need to be running C-Boot ROM and when M3 application sends IPC commands to C28x application you would need to have C28x application running.

    Also be aware of what is going on, on a debug reset from the GEL scripts because it could meddle with the understanding of current status of the system. In other words there are no GEL scripts in standalone mode so things like that are different.

     

    hope this helps.

    Best Regards

    Santosh

     

  • Hi Santosh,

    You help us a lot, thank you very much.

    Now i have may be the last question.

    1.M3/C28 preloader synchronization finish successfully,
    2.M3 read IO periferial data and send it to C28 - work good.
    3. Now i would like to jump from M3 to M3Application and from C28 to C28 application - here is the problem

    I succeeed to jump from M3/C28 preloader to M3/C28 loader/application only before synchronization(i did it for testing only to be sure that all adresses are OK).  
    After synchronization process jump from M3/C28 preloader to M3/C28 application doesn't work.


    m3: send notification to C28 and jump:


        usWWord16 = 0x1234;
        IPCLiteMtoCDataWrite(IPC_FLAG1, pulMsgRam[0],(unsigned long)usWWord16,
                             IPC_LENGTH_16_BITS,
                             IPC_FLAG32);

          unsigned short usRWord16 = 0xffff;
        while (IPCLiteMtoCGetResult(&usRWord16,IPC_LENGTH_16_BITS,
                                    IPC_FLAG32) != STATUS_PASS)
        {
        }
        if (usWWord16 != usRWord16)
        {
            ErrorCount++;
        }

         IntMasterDisable();
       JumpStackPointerToAddress(uiBootAddress); //bootLoader


    where:
    static void JumpStackPointerToAddress(unsigned long address)
    {
    __asm(" mov sp, r0\n"   // sp is now *address
          " bx r0\n" );     // jump to *address
    }

    c28: jump after  get notification from M3:    
            DINT;

            IER = 0x0000;
             IFR = 0x0000;
             PieCtrlRegs.PIEIER11.bit.INTx1 = 0;     // MTOCIPC INT1
           asm ("  LB 0x0013cff0");

     

    Could you please help us with this problem? Why i can not jump to another application after IPC sinchronization.

    Thanks, Sabina

  • Sabina

    Thanks -On C28x, do you make sure you clear both IPC FLAG1 and IPCFLAG32 before you branch to the application? what is the branch address on M3 is the LSB of the address set to 0x1 (the address needs to be ODD).

    On C28x, where is the branch to the application happening from - ISR or after the core returns from ISR?

    which core is getting stuck without branching to the application, M3 or C28x or both? and are you able to put breakpoints and debug where exactly the code is hanging?

     

    Best Regards

    Santosh

  • Hi Santosh,
    I clear IPC Flags and performs brunch to the application not from ISR.
    I put breakpoints on the jump, but it is no so clear how to bebug it. It is assembling code. Jump start running for both cores ... but after it applications M3/C28 don't work. I put IO toggle in the M3/C28 application.
     

    My problem is M3/C28 sinchronization. Affter sinchronization brunch to the application doesn't work. Without sinchronization brunch to the application work properly - but i have m3/c28 sinchronization to send to C28 information from M3 to what application to jump (C28Loader or C28Application).


    M3/C28 Preloader - without Sys/Bios
    M3/C28 Loader& Application - with Sys/Bios

    M3 Preloader:
    unsigned long M3_LoaderBootAddress      = 0x0023e001;
    unsigned long M3_ApplicationBootAddress = 0x0027e001;

    static void JumpStackPointerToAddress(unsigned long address)
    {
     __asm(" mov sp, r0\n"   // sp is now *address
       " bx r0\n" );     // jump to *address
    }

    static void StartApplication(unsigned long uiBootAddress)
    {
      usWWord16 = 0x1234;
     IPCLiteMtoCDataWrite(IPC_FLAG1, pulMsgRam[0],(unsigned long)usWWord16,
       IPC_LENGTH_16_BITS,
       IPC_FLAG32);
      unsigned short usRWord16 = 0xffff;
     while (IPCLiteMtoCGetResult(&usRWord16,IPC_LENGTH_16_BITS,
       IPC_FLAG32) != STATUS_PASS)
     {
     }
     if (usWWord16 != usRWord16)
     {
      ErrorCount++;
     }
      IPCLiteMtoCClearBits(IPC_FLAG1, pulMsgRam[0], CLEARMASK_16BIT,
       IPC_LENGTH_16_BITS,
       IPC_FLAG32);
      while (IPCLiteMtoCGetResult(&usRWord16,IPC_LENGTH_16_BITS,
       IPC_FLAG32) != STATUS_PASS)
     {
     }

     if (usRWord16 & (~CLEARMASK_16BIT) != (~CLEARMASK_16BIT))
     {
      ErrorCount++;
     }
     IPCLiteMtoCClearBits(IPC_FLAG1, pulMsgRam[1], CLEARMASK_32BIT,
       IPC_LENGTH_32_BITS,
       IPC_FLAG32);

     unsigned long ulRWord32 = 0;
     while (IPCLiteMtoCGetResult(&ulRWord32,IPC_LENGTH_32_BITS,
       IPC_FLAG32) != STATUS_PASS)
     {
     }

     if (ulRWord32 & (~CLEARMASK_32BIT) != (~CLEARMASK_32BIT))
     {
      ErrorCount++;
     }
     BlinkLeds(20000, 50);
     JumpStackPointerToAddress(uiBootAddress); //jump to loader
    }

    int IPCInit_1(void)
    {
      unsigned short usWWord16;
     unsigned long ulWWord32;
     unsigned short usRWord16;
     unsigned long ulRWord32;
     unsigned long *pulMsgRam;
     RAMMReqSharedMemAccess (S0_ACCESS, SX_M3MASTER);
     HWREG(SYSCTL_MWRALLOW) = 0xA5A5A5A5;
     HWREG(RAM_CONFIG_BASE + RAM_O_MSXRTESTINIT1) |= 0x1;
     while((HWREG(RAM_CONFIG_BASE + RAM_O_MSXRINITDONE1)&0x1) != 0x1)
     {
     }

     HWREG(RAM_CONFIG_BASE + RAM_O_MTOCCRTESTINIT1) |= 0x1;
     while((HWREG(RAM_CONFIG_BASE + RAM_O_MTOCRINITDONE)&0x1) != 0x1)
     {
     }

      HWREG(SYSCTL_MWRALLOW) = 0;
     //  Tells M3 Core that the vector table is at the beginning of C0 now.
     HWREG(NVIC_VTABLE) = 0x20005000;

     //  Disable Clocking to Watchdog Timer1 and Watchdog Timer0
     SysCtlPeripheralDisable(SYSCTL_PERIPH_WDOG0);
     SysCtlPeripheralDisable(SYSCTL_PERIPH_WDOG1);

     //  Send boot command to allow the C28 application to begin execution
     IPCMtoCBootControlSystem(CBROM_MTOC_BOOTMODE_BOOT_FROM_FLASH);

     // Initialize all variables used in example.
     //
     ErrorFlag = 0;
     usWWord16 = 0x1234;
     ulWWord32 = 0xABCD5678;
     usRWord16 = 0;
     ulRWord32 = 0;
     pulMsgRam = (void *)M3_CTOM_PASSMSG;

     // Spin here until C28 is ready
     while (!IPCCtoMFlagBusy(IPC_FLAG17)) ;
     IPCCtoMFlagAcknowledge(IPC_FLAG17);
     return 0;
    }

    int
    main(void)
    {
     // Disable Protection
     HWREG(SYSCTL_MWRALLOW) =  0xA5A5A5A5;
     // Setup main clock tree for 75MHz - M3 and 150MHz - C28x
     SysCtlClockConfigSet(SYSCTL_SYSDIV_1 | SYSCTL_M3SSDIV_2 | SYSCTL_USE_PLL |
       (SYSCTL_SPLLIMULT_M & 0x0F));
     // Disable clock supply for the watchdog modules
     SysCtlPeripheralDisable(SYSCTL_PERIPH_WDOG1);
     SysCtlPeripheralDisable(SYSCTL_PERIPH_WDOG0);
     memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);
     // Call Flash Initialization to setup flash waitstates
     // This function must reside in RAM
     FlashInit();
     IntMasterEnable();
     IPCInit_1();
      // Enable clock supply for the following peripherals
     SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
     SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
     SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
     SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);
     SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
     SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
     SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOG);
     SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOH);
     SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOJ);

     GPIOPinConfigureCoreSelect(GPIO_PORTA_BASE, 0x1, GPIO_PIN_C_CORE_SELECT); //temporary 
      GPIOPinTypeGPIOOutput(GPIO_PORTA_BASE, GPIO_PIN_1); //led3
     GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_1, ~0);
     GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_0);
     GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_0, ~0);
     GPIOPinTypeGPIOOutput(GPIO_PORTA_BASE, GPIO_PIN_4); //temporary
     GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_4, ~0);

     volatile unsigned long ulLoop;
     unsigned short readVal = 0; //getServiceSwitchValue();
     if(readVal == 0) //pressed
     {

      GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_0, 0);
      GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_1, 0);

      const unsigned long* ptrLoader= (unsigned long *)(M3_LoaderBootAddress); //loader address
      if(*ptrLoader != 0xffffffff)
      {
       StartApplication(M3_LoaderBootAddress);
      }
     }

     const unsigned long* ptr= (unsigned long *)(M3_ApplicationBootAddress); //loader address
     if(*ptr != 0xffffffff)
     {
      StartApplication(M3_ApplicationBootAddress);
     }
     const unsigned long* ptrLoader1= (unsigned long *)(M3_LoaderBootAddress); //loader address
     if(*ptrLoader1 != 0xffffffff)
     {
      StartApplication(M3_LoaderBootAddress);
     }
     while(1);
    }


    //*****************************************************************************
    // Function run by IPC_FUNC_CALL command
    //*****************************************************************************
    void
    FunctionCall (void)
    {
     FnCallStatus = 1;
    }

    void
    FunctionCallParam (unsigned long ulParam)
    {
     FnCallStatus = ulParam;
    }

    //*****************************************************************************
    // Function to Indicate an Error has Occurred (Invalid Command Received).
    //*****************************************************************************
    void
    Error(void)
    {
     // An error has occurred (invalid command received). Loop forever.
     for (;;)
     {
     }
    }



    C28 Preloader:

     void IPCInit_1(void)
    {
         unsigned short usWWord16;
        unsigned long ulWWord32;
        unsigned long *pulMsgRam;
        DINT;
        EALLOW; // This is needed to write to EALLOW protected registers
        PieVectTable.MTOCIPC_INT1 = &MtoCIPC1IntHandler;
        EDIS;    // This is needed to disable write to EALLOW protected registers
        // Enable CPU INT1 which is connected to MTOCIPC INT1-4:
        IER |= M_INT11;
        // Enable MTOCIPC INTn in the PIE: Group 11 interrupts
        PieCtrlRegs.PIEIER11.bit.INTx1 = 1;     // MTOCIPC INT1
        // Enable global Interrupts and higher priority real-time debug events:
        EINT;       // Enable Global interrupt INTM
        ERTM;   // Enable Global realtime interrupt DBGM
        // Initialize all variables.
        ErrorFlag = 0;
        FnCallFlag = 0;
        usWWord16 = 0;
        ulWWord32 = 0;
        EALLOW;
        SysCtrlRegs.PCLKCR0.all = 0;
        EDIS;

        pulMsgRam = (void *)C28_CTOM_PASSMSG;
        pulMsgRam[0] = (unsigned long)&usWWord16;
        pulMsgRam[1] = (unsigned long)&ulWWord32;
        pulMsgRam[2] = (unsigned long)&SysCtrlRegs.PCLKCR0.all;
        pulMsgRam[3] = (unsigned long)&FunctionCallNoReturn;
        pulMsgRam[4] = (unsigned long)&FunctionCallReturn;
        pulMsgRam[5] = (unsigned long)&FnCallFlag;

        // Flag to M3 that the variables are ready in MSG RAM with CTOM IPC Flag 17
        //
        IPCCtoMFlagSet(IPC_FLAG17);

    }

    void checkStatusForJump()
    {
     if(ReceivedData == 0x1234)
     {
      DSP28x_usDelay(200);
      BlinkLeds(20000, 100);
      DINT;
      IER = 0x0000;
      IFR = 0x0000;
      PieCtrlRegs.PIEIER11.bit.INTx1 = 0;     // MTOCIPC INT1


      IPCCtoMFlagClear(IPC_FLAG1);
      IPCCtoMFlagClear(IPC_FLAG32);
     asm ("  LB 0x0013cff0");

     }
    }

    void main(void)
    {
       unsigned long delay;
        InitSysCtrl();
        InitGpio(); 
        EALLOW;
        GpioG1CtrlRegs.GPADIR.bit.GPIO0 = 1;
        EDIS;
        GpioG1CtrlRegs.GPADIR.bit.GPIO0 = 1;// turn off LED
    // Step 3. Clear all interrupts and initialize PIE vector table:
    // Disable CPU interrupts
        DINT;

       memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize); 
       
        InitFlash();       
         InitPieCtrl();

    // Disable CPU interrupts and clear all CPU interrupt flags:
        IER = 0x0000;
        IFR = 0x0000;
        InitPieVectTable();
        IPCInit_1();

        for(;;)
        {
              GpioG1DataRegs.GPADAT.bit.GPIO0 = 0;
            for(delay = 0; delay < 2000000; delay++)
            {
             checkStatusForJump();
            }
              GpioG1DataRegs.GPADAT.bit.GPIO0 = 1;
               for(delay = 0; delay < 2000000; delay++)
            {
             checkStatusForJump();
            }
          }

    }

     

    //*****************************************************************************
    // Functions run by IPC_FUNC_CALL command
    //*****************************************************************************
    void
    FunctionCallNoReturn (void)
    {
        FnCallFlag = 1;
    }

    Uint32
    FunctionCallReturn (Uint32 ulData)
    {
        ulData = 2;
        return ulData;
    }

    //*****************************************************************************
    // MtoC INT1 Interrupt Handler - Handles Data Word Reads/Writes
    //*****************************************************************************
    interrupt void
    MtoCIPC1IntHandler (void)
    {
        // Continue processing messages
        switch (CtoMIpcRegs.MTOCIPCCOM)
        {
        case IPC_SET_BITS_16:
            IPCLiteMtoCSetBits(IPC_FLAG1, IPC_FLAG32);
            break;
        case IPC_SET_BITS_32:
            IPCLiteMtoCSetBits(IPC_FLAG1, IPC_FLAG32);
            break;
        case IPC_CLEAR_BITS_16:
            IPCLiteMtoCClearBits(IPC_FLAG1, IPC_FLAG32);
            break;
        case IPC_CLEAR_BITS_32:
            IPCLiteMtoCClearBits(IPC_FLAG1, IPC_FLAG32);
            break;
        case IPC_DATA_WRITE_16:
            IPCLiteMtoCDataWrite(IPC_FLAG1, IPC_FLAG32);
            ReceivedData = (Uint16)CtoMIpcRegs.MTOCIPCDATAW;
            break;
        case IPC_DATA_WRITE_32:
            IPCLiteMtoCDataWrite(IPC_FLAG1, IPC_FLAG32);
            break;
        case IPC_SET_BITS_16_PROTECTED:
            IPCLiteMtoCSetBits_Protected(IPC_FLAG1, IPC_FLAG32);
            break;
        case IPC_SET_BITS_32_PROTECTED:
            IPCLiteMtoCSetBits_Protected(IPC_FLAG1, IPC_FLAG32);
            break;
        case IPC_CLEAR_BITS_16_PROTECTED:
            IPCLiteMtoCClearBits_Protected(IPC_FLAG1, IPC_FLAG32);
            break;
        case IPC_CLEAR_BITS_32_PROTECTED:
            IPCLiteMtoCClearBits_Protected(IPC_FLAG1, IPC_FLAG32);
            break;
        case IPC_DATA_WRITE_16_PROTECTED:
            IPCLiteMtoCDataWrite_Protected(IPC_FLAG1, IPC_FLAG32);
            break;
        case IPC_DATA_WRITE_32_PROTECTED:
            IPCLiteMtoCDataWrite_Protected(IPC_FLAG1, IPC_FLAG32);
            break;
        case IPC_DATA_READ_16:
            IPCLiteMtoCDataRead(IPC_FLAG1, IPC_FLAG32);
            break;
        case IPC_DATA_READ_32:
            IPCLiteMtoCDataRead(IPC_FLAG1, IPC_FLAG32);
            break;
        case IPC_FUNC_CALL:
            IPCLiteMtoCFunctionCall(IPC_FLAG1, IPC_FLAG32);
            break;
        default:
            ErrorFlag = 1;
            break;
        }

        // IPC Lite Driver Functions acknowledge the IPC interrupt.
        // There is no need to ACK the IPC interrupt flag separately.
        //
        PieCtrlRegs.PIEACK.all = PIEACK_GROUP11;   // Acknowledge interrupt to PIE
    }

    //*****************************************************************************
    // Function to Indicate an Error has Occurred (Invalid Command Received).
    //*****************************************************************************
    void
    Error(void)
    {
        // An error has occurred (invalid command received). Loop forever.
        for (;;)
        {
        }
    }


     

  • Sabina,

    on the C28x IPCinit_1(), don't you need to poll for M3 to clear the IPCFLG17? I think its good to have that 'wait until acked/cleared' check before C28x goes and does anything.

     

    Also not sure where ReceivedDatais being set for checkStatusForJump function? It is very had to review the code pasted on the forum post not knowing if all of it is provided or not. It will help if you put a flow diagram showing both the cores execution time line.

    also it is good idea to add another IPC SYNC state between M3 and C28x so that C28x would wait for M3 to complete the initialization part before accessing the GPIO.

    other than above I don't see much wrong in your code, it should work. Only other thing is you need to make sure that C28x is running before M3 application writes something to IPC and M3 should be running while C28x writes something to IPC. So you should be careful when selecting the break points and/or stepping the code. Make sure you start from a clean reset each time you debug.

    Did you mention that this code (with IPC Synchronization) works when in standalone but you have tough time getting it work with debugger connected?

     

    Best Regards

    Santosh

     

     

  • Hi Santosh,

    This code (with IPC Synchronization) works when in standalone. I see on the scope IO toggle from both cores. 

     With shared memory using (M3 write to shared memory before jump to M3Loader/M3Application and C28 read in the while for some specific value for jump to the Loader/Application) it work also.

    Jump doesn't work only after IPC sincronization. How IPC sincronization could influence on the jump?

    you wrote:


    on the C28x IPCinit_1(), don't you need to poll for M3 to clear the IPCFLG17? I think its good to have that 'wait until acked/cleared' check before C28x goes and does anything

    Do you mean the following:
     // Spin here until M3is ready
     while (!IPCCtoMFlagBusy(IPC_FLAG17)) ;
     IPCCtoMFlagAcknowledge(IPC_FLAG17);

    the same as it is done on M3?

    you wrote:

    also it is good idea to add another IPC SYNC state between M3 and C28x so that C28x would wait for M3 to complete the initialization part before accessing the GPIO.

    I'll add it for testing.

    Thanks,Sabina

  • Sabina,

    since the code works in stand-alone, I don't suspect anything is wrong with either M3 or C28x code. would you agree?

    When in debug mode could you list the steps you do to run the code.

    1.> connect to both M3 and C28x

    2.> load M3 app

    3.> load C28x app

    4.>. run M3 , m3 is waiting for C28x signal from C28x app? (note that here you are not running C-boot ROM, so M3 shouldn't send the boot mode IPC command here)

    5.> run C28x

     

    Best Regards

    Santosh

  • Hi Santosh,

    It seems that i didn't explain my problem .

    The situation is the following:


    1. M3/C28 bootLoader without IPC sinchronization perform jump properly from stand-alon .

    2.M3/C28 bootLoader with IPC sinchronization doesn't perform jump at all(not from debug and not from stand-alon)

    For now i use sharded memory instead of IPC sinchronization in M3/C28 bootLoader and Jump to M3/C28 loader/Application work peroperly .

    My question is:

    Does exist known problem with jump after IPC sinchronization? If no - could you assist me to fix this problem? In the  previous post I sent my code. Does it help if i send you a short test application (M3/C28) with jump after IPC sinchronization or you can reproduce the problem.

    Thanks a lot, Sabina

     

  • Sabina,

    I don't think there are any problems in using IPC for synchronization mechanisms for both the cores. Please send a sample test code in which you are able to reproduce the problem, I'll see if I can reproduce it.

     

    Best Regards

    Santosh

  • Hi Santosh,

    Attached projects : 1425.TI test Appl.rar

    It includes M3Preloader, C28 Preloader,  M3Blink And C28Blink applications.

    M3Preloader:( SectorN) jump to M3Blink( Sectors: G-A)

    C28Preloader: (Sector A) jump to C28Blink ( Sectors:N-H)

    I work with Concerto Evaluation board and load all file to the flash by using CCS ver 5.1.

    After disconnect/connect power supply from the EvaluationBoard  two leds blink: M3 and C28. so jump work properly.

    If you add in M3 Preloader code sinchronization commands ( calling IPCMtoCBootControlSystem(CBROM_MTOC_BOOTMODE_BOOT_FROM_FLASH);  or IPCInit_1() to both M3and C28 ) - leds stop blinking. 


    You can reproduce it by opening line#270 in M3PreLoaderMain.c or open calling IPCInit_1() in preloader projects.

    Thanks for help,Sabina

    .

     

     

     

     

    Thanks,Sabina

  • Thanks Sabina,

    give me sometime to replicate this on my set up. I will get back to you.

     

    Best Regards

    Santosh

     

     

  • Sabina,

    I didn't see any issue. I uncommented IPCInit_1() on both M3 and C28x projects (by the way on M3 I',m running M3PreLoader project) , the IPCInit_1() passes just fine, boot mode command is passed on properly and C28x branches to flash.

    I don't see any other communication happening because your code nothing is programmed at M3 blink address.

    anyways, below are the steps  I did.

    1.> power up board and connect to both M3 and C28x on CCS

    2.> load M3 flash with M3 Preloader , load c28x Flash with C28 Preloader.

    3.> reset and RUN C28x. Now C28x is running C-Boot ROM and is waiting for IPC boot command from M3

    4.> Now step through the code or put a break point after m3 sends the boot Mode IPC command, in your ipcInit_1 function.

    5.> run M3 and it will hit the break point after sending the boot mode IPC command.

    6.> now Pause C28x and you will see C28x is running the application in flash.

    7.> now continue stepping the code it pass through the IPC17 flag check and acks the flag.

    are you doing same above steps?

    more observations:-

    1.> if I force PC on M3Preloadermain.c to line 397 then the write to ptrData will make C28x branch to some address. Not sure whatever is programmed at this address on c28x would be able to handle IPC from M3?

    2.> if I continue stepping through M3 code and go into startApplication function it calls JumpStackPointerToAddress and goes to weeds because nothing is yet programmed.

    Now if I skip that branch and continue, I bet M3 would be able to send IPC commands properly but C28x is not ready to accept anything because the CheckStatusForJump made it branch to somewhere else already.

     

    Hope this helps.

    Best Regards

    Santosh Athuru

     

     

     

  • Hi Santosh,

    thank you very much for so detail answer.

    I do the same steps as you, but I programm the targed with both applications(preloader and application for M3&C28).

    1.Pls programm preloader without IPC_init() calling and programm application. 
    2.Restart the target.
    3.You should see two blinks leds (c28&m3) if application start properly.

    the next time do the following:
    1.Pls programm preloader with IPC_init() calling and programm application. 
    2.Restart the target.
    3.here i don't see two blinks leds (c28&m3) - I see only m3 blink led. c28 application doesn't running.

    Do you see the same behavior?

    Thanks,Sabina

  • Sabina,

    ok I'll try it over that way. Are you able to debug it with break points and see whats wrong? When you program M3 blinker and then M3 Preloader, are you making sure that what you programmed previously in flash remains intact? I mean its not getting erase/re-programmed? 

    can you confirm one thing, in your below steps?

    Sabina Greenberg101872 said:
    the next time do the following:
    1.Pls programm preloader with IPC_init() calling and programm application. 
    2.Restart the target.
    3.here i don't see two blinks leds (c28&m3) - I see only m3 blink led. c28 application doesn't running.

    at step 2, is it simple restart or a reset? you should make sure you reset the target not just restart because M3 application sends a boot mode IPC command and while that happens you need to have C-Boot ROM running on the other end.

    what happens if you power off/on the board after you have everything programmed with ipc_init()?

    after above:

    please follow this steps and let me know what's going on.

    1.> program LED apps, C28 and M3

    2.> Program preloaders with IPC_init on both M3 and C28x

    3.> reset the target (C28x first and then M3)

    4.> put a break point at the entry point or main() on M3 of your M3 preloader

    5.> run M3 preloader

    6.> run C28x from reset - this should run C-Boot ROM

    7.> pause C28x, and observe where PC is at in the dis-assembly window. It should point to an IDLE instruction.

    8.> if yes then run C28x (else we have a problem, C-Boot ROM is not running properly)

    9.> Now while C28x is running C-Boot ROM, step through M3 Preloader all the way to IPC_INIT()

    10.> you will reach a point where M3 preloader is sending a boot mode IPC command.

    11.> step over the boot mode IPC command send function, does it pass through that or does it hang over there?

    12.> if the execution passes over then pause C28x at this point and see where the execution control is at? it should be in C28x Preloader waiting for next IPC command?

    13.> if c28x is good and running preloader, keep C28x running and continue step through on M3

    14.> you should eventually see M3 starting its blinker app and C28x its blinker app.

     

    Let me know what happens when you follow above steps, where the execution gets stuck. I will follow same steps at my end on Monday and we will sync up the results.

     

    Best Regards

    Santosh

  • Hi Santosh,

    Sorry for so long delay, i was out of office. Thank you very much for the help.

    [Are you able to debug it with break points and see whats wrong?]

    I put breakpoint on Jump and see that program reach Jump, but after it i see assembly code and can not observe what is wrong  after jump.



    [ When you program M3 blinker and then M3 Preloader, are you making sure that what you programmed previously in flash remains intact? I mean its not getting erase/re-programmed? ]

    Flash is programmed with Blink software always , I reload only Preloader M3/C28 with /withoit IPC

    [at step 2, is it simple restart or a reset? you should make sure you reset the target not just restart because M3 application sends a boot mode IPC command and while that happens you need to have C-Boot ROM running on the other end.]

    It is HW reset. I disconnect evaluationBoard from power supply and connect it again. 

    [what happens if you power off/on the board after you have everything programmed with ipc_init()?]

    I see only M3 led blinking

    [7.> pause C28x, and observe where PC is at in the dis-assembly window. It should point to an IDLE instruction.]

    yes, it is in the idle instruction
    3ff6b7:   7621        IDLE  

    [11.> step over the boot mode IPC command send function, does it pass through that or does it hang over there?]

    it pass through this command. but it doesn't exit from :
     while (!IPCCtoMFlagBusy(IPC_FLAG17)) ;

    12.> if the execution passes over then pause C28x at this point and see where the execution control is at? it should be in C28x Preloader waiting for next IPC command?

    it is in the same idle instruction
    3ff6b7:   7621        IDLE        

    13.> if c28x is good and running preloader, keep C28x running and continue step through on M3

    14.> you should eventually see M3 starting its blinker app and C28x its blinker app.

     I see nothing - no leds are blinking

    thanks,Sabina

  • Sabina,

    sorry took me a while to get back at this, between steps 10 and 11, could you put a break point at location 0x13FFF0 on C28x (from your C28x dis-assembly window), run C28x and then execute step 11 on M3 and see if the break point on C28x is hit?

    Best Regards

    Santosh

     

  • Hi Santosh,

    Yes, program reach the breakpoint:

            code_start, $D:/ti/controlSUITE/device_support/f28m35x/v140/F28M35x_common/source/F28M35x_CodeStartBranch.asm:41:46$:
    13fff0:   0053EF41    LB           _c_int00

    and _c_int_00 has the code:

            _c_int00:
    13ef41:   28AD0050    MOV          @SP, #0x0050
    13ef43:   FF69        SPM          #0
    13ef44:   561F        SETC         OBJMODE
    13ef45:   5616        CLRC         AMODE
    13ef46:   561A        SETC         M0M1MAP
    13ef47:   E6100200    SETFLG       RNDF32=1
    13ef49:   2940        CLRC         PAGE0
    13ef4a:   761F0000    MOVW         DP, #0x0
    13ef4c:   2902        CLRC         OVM
    13ef4d:   761B        ASP         
    13ef4e:   7622        EALLOW      
    13ef4f:   28A9F1BE    MOV          @AL, #0xf1be

  • Let me try to produce this time by programming blinky code first and then the pre_loaders.

     

    Best Regards

    santosh

  • Sabina,

    what is the rev-id of the chip you are using, the value of DID0 register?

     

    Best Regards

    Santosh

     

  • Hi Santosh,

    DID0 = 0x20400000

    DID1=0x1154804C

     

    Thanks,Sabina

  • Sabina,

    looks like this is REV0 device as well. Did you try it on REVA device and see? Please check the last 6 posts in this forum post and see if it relates to your problem as well.

    http://e2e.ti.com/support/microcontrollers/c2000/f/171/p/317040/1115909.aspx#1115909

     

    I did try to run your code with blinky programmed, I observed that both M3 pre-loader and the M3 blinky both try to send a boot mode IPC command to C28x which is not good - correct. You will have to take out the function call to IpcBootControlSystem() on M3 blinky because you will have the C28x preloader launching the blinky.

     

    Best Regards

    Santosh

     

  • Hi Santosh,

    I didn't succeed to fix this problem.

    1. I changed driverlib to v160 for preloaderM3&C28 and blinkApplications - didn't help.
    2. Removed IpcBootControlSystem() on M3 blinky - didn't help also.

     

    the solution that i have today is to work with shared memory instead of IPC commands in BootLoader.

    our devices has DID0 = 0x20400000

    Does it mean that we have a problem here?

    From the linked post:
    "awesome - please get a REVA as soon as possible. there were lots of fixes done and it is TMS I believe"
    what fixes were done in REVA?

    Thanks a lot for your help, Sabina

  • Sabina,

    can you send me the updated blinky out files, I'll give it a try sometime today.

    there are lots of nice fixes done on REVA compared to REV0, please check the errata on REV0 most of them if not all are fixed on REVA as would be indicated in each listing.

     

    Best Regards

    Santosh

     

  • Hi Santosh,

    Pls see attached

    3554.BlinkAppLib160.rar

     

    Thank you very much, Sabina

  • to update and close the thread. We had offline discussions and the problem was found to be with the second IPC Boot mode command from M3 blinky application. The M3 preloader already sends the IPC Boot mode command to C-Boot ROM so C28x is out of boot ROM context and at this stage if M3 blinky calls the IPC Boot mode command send function for second time things would fail.

    Once this second call to send IPC Boot mode command from M3 blinky is removed the application started working with IPC Sync.

     

    Best Regards

    Santosh