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.

TMS320F28P550SJ: M0/M1 initialization fails after POR

Part Number: TMS320F28P550SJ
Other Parts Discussed in Thread: C2000WARE

Tool/software:

Hi champs,

The user needs to initialize RAM like M0/M1 before main().

They used to code on F28003x like this and it works.

// By default RAM is only initialized to zero by power-on reset, but not by warm reset
// _system_pre_init() is to initialize RAM to zero on all reset including warm reset. TI RTS library will call _system_pre_init() before main().
int _system_pre_init(void)
{
    EALLOW;

    *(volatile int *)(MEMCFG_BASE + MEMCFG_O_DXINIT)  = 0x0003;               // RAM INIT FOR M0/M1 Memory
    while(!(*(volatile int *) (MEMCFG_BASE + MEMCFG_O_DXINITDONE) == 0x3));   // Wait for InitDone Status

    EDIS;

    return 1;
}

But now it fails on F28P550SJ9x after power-on reset (POR) (powering on for the first time).

"Fail" means it cannot run to main() after POR.

Note that we also confirmed it works if the user

1. only initializes LSx RAM and GSx RAM after POR or reset by nXRS.

2. only initializes M0/M1 RAM after reset by nXRS.

That is, it fails only if the user initializes M0/M1 after powering-on for the first time.

Is it possible this is related to ROM boot code for POR on F28P55x?

This issue is not observed on F280039C because the user uses the same code here.

Therefore, would you please support us how to deal with it?

The goal is to initialize RAM before main() no matter it's POR or reset by nXRS.

BTW, I am not able to reproduce this on CCS and can only see it in standalone running from flash after powering on for the first time. Is it possible to use CCS to emulate flash boot after POR?

  • Hi champs,

    Please confirm if you can reproduce this on your side.

    My environments:

    CCS 12.8.1

    C2000ware V5.04

    C:\ti\c2000\C2000Ware_5_04_00_00\driverlib\f28p55x\examples\led

    TI F28P55x control card (Launchpad is OK)

    Add the code above before main or replace the file with below one.

    Use standalone (flash) mode.

    Disconnect CCS and run it from flash and observe this for the first power-on. You should see LED not blinking.

    After nXRS reset, LED can blink again.

    //#############################################################################
    //
    // FILE:   main.c
    //
    // TITLE:  Universal LED Project
    //
    // Universal LED Project Example
    //
    // This example demonstrates how to blink an LED using the **Universal Project**.
    // In order to migrate the project within syscfg, click the swtich button under 
    // the device view and select your corresponding device to migrate, saving the
    // project will auto-migrate your project settings.
    //!
    //!  \note This example project has support for migration across our C2000 
    //!  device families. If you are wanting to build this project from launchpad
    //!  or controlCARD, please specify in the .syscfg file the board you're using.
    //!  At any time you can select another device to migrate this example.
    //
    //#############################################################################
    //
    //
    // 
    // C2000Ware v5.04.00.00
    //
    // Copyright (C) 2024 Texas Instruments Incorporated - http://www.ti.com
    //
    // Redistribution and use in source and binary forms, with or without 
    // modification, are permitted provided that the following conditions 
    // are met:
    // 
    //   Redistributions of source code must retain the above copyright 
    //   notice, this list of conditions and the following disclaimer.
    // 
    //   Redistributions in binary form must reproduce the above copyright
    //   notice, this list of conditions and the following disclaimer in the 
    //   documentation and/or other materials provided with the   
    //   distribution.
    // 
    //   Neither the name of Texas Instruments Incorporated nor the names of
    //   its contributors may be used to endorse or promote products derived
    //   from this software without specific prior written permission.
    // 
    // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
    // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
    // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
    // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
    // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
    // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
    // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
    // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    // $
    //#############################################################################
    
    //
    // Included Files
    //
    #include "driverlib.h"
    #include "device.h"
    #include "board.h"
    #include "c2000ware_libraries.h"
    
    // By default RAM is only initialized to zero by power-on reset, but not by warm reset
    // _system_pre_init() is to initialize RAM to zero on all reset including warm reset. TI RTS library will call _system_pre_init() before main().
    int _system_pre_init(void)
    {
        EALLOW;
    
        *(volatile int *)(MEMCFG_BASE + MEMCFG_O_DXINIT)  = 0x0003;               // RAM INIT FOR M0/M1 Memory
        while(!(*(volatile int *) (MEMCFG_BASE + MEMCFG_O_DXINITDONE) == 0x3));   // Wait for InitDone Status
    
        EDIS;
    
        return 1;
    }
    
    // Main
    //
    void main(void)
    {
    
        //
        // Initialize device clock and peripherals
        //
        Device_init();
    
        //
        // Disable pin locks and enable internal pull-ups.
        //
        Device_initGPIO();
    
        //
        // Initialize PIE and clear PIE registers. Disables CPU interrupts.
        //
        Interrupt_initModule();
    
        //
        // Initialize the PIE vector table with pointers to the shell Interrupt
        // Service Routines (ISR).
        //
        Interrupt_initVectorTable();
    
        //
        // PinMux and Peripheral Initialization
        //
        Board_init();
    
        //
        // C2000Ware Library initialization
        //
        C2000Ware_libraries_init();
    
        //
        // Enable Global Interrupt (INTM) and real time interrupt (DBGM)
        //
        EINT;
        ERTM;
    
        //
        // Loop Forever
        //
        for(;;)
        {
            //
            // Turn on LED
            //
            GPIO_writePin(myBoardLED0_GPIO, 0);
    
            //
            // Delay for a bit.
            //
            DEVICE_DELAY_US(500000);
    
            //
            // Turn off LED
            //
            GPIO_writePin(myBoardLED0_GPIO, 1);
    
            //
            // Delay for a bit.
            //
            DEVICE_DELAY_US(500000);
        }
    }
    
    //
    // End of File
    //
    
    

  • There is another variable added in P55x in DXINITDONE when compared to 003x. This is for pievect ram initialization. In the _system_pre_init code in the while loop check for 0x13 instead of 0x3. Note that boot rom does ram initialization only on POR. So when you do an xrsn all the values in Dxinitdone get reset to zero and the code control moves back to _system_pre_init where now application code is triggering initialization of M1 and M0 only. So the while loop matches done value of 0x3

  • Hi Pawan,

    I tested it and it works.

    Thank you for your support.

    // By default RAM is only initialized to zero by power-on reset, but not by warm reset
    // _system_pre_init() is to initialize RAM to zero on all reset including warm reset. TI RTS library will call _system_pre_init() before main().
    int _system_pre_init(void)
    {
        EALLOW;
    
        *(volatile int *)(MEMCFG_BASE + MEMCFG_O_DXINIT)  = 0x0013;               // RAM INIT FOR M0/M1 Memory
        while(!(*(volatile int *) (MEMCFG_BASE + MEMCFG_O_DXINITDONE) == 0x13));   // Wait for InitDone Status
    
        EDIS;
    
        return 1;
    }