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.

[Concerto] Flash code does not run on c28 when ran without JTag

Other Parts Discussed in Thread: CONTROLSUITE
The code loaded in flash on c28 does not run when powered ON without using JTag emulator. But the program running on m3 works fine.
 
H/w: Control Card f28m35h52c1 (bought when alpha version was released).
Control Suite: Upgraded to 2.6.0 (v100)
 
Case 1:
I have followed all the instructions given in the Flash samples for both m3 and c28 programs. Both the programs run well if run using JTag. I can debug and test. But if I switch the hardware to run independently without JTag then only m3 program runs; no output is observed from c28 ?
 
Case 2:
I thought I must call “IPCMtoCBootControlSystem(CBROM_MTOC_BOOTMODE_BOOT_FROM_FLASH);” function from m3 to make c28 boot from flash.
In this case with JTag also, it waits indefinitely at this function call. But if I reset the system and  restart c28 and m3 then it starts working.
But again, if I Power ON hardware without JTag, only m3 code runs and it hangs at first while loop in IPCMtoCBootControlSystem.
 
Case 3:
I have made call to both following APIs through m3,
SysCtlReleaseSubSystemFromReset(SYSCTL_CONTROL_SYSTEM_RES_CNF | SYSCTL_ANALOG_SYSTEM_RES_CNF);
IPCMtoCBootControlSystem(CBROM_MTOC_BOOTMODE_BOOT_FROM_FLASH);
 
Result is same as case 2.
 
I am unable to understand why c28 is not running when Powered ON without JTag? Please help.
  • Hi Vijay

    Please refer to section 5.7.1 and 5.7.2 of Concerto Technical Reference Manual (http://www.ti.com/general/docs/lit/getliterature.tsp?literatureNumber=spruh22&fileType=pdf)

    Master subsytem should send IPC commands to initialize control subsystem RAM(s) before sending boot IPC command. When you have JTAG connected this is taken care of by the GEL script functions, but on a stand alone system, the master subsytem application should do it, for this you can use the code/functions shown in the reference manual.

    please let us know if you have any more questions.

    Best Regards

    Santosh

  • Hi Vijay,

    I got the same issue like you.

    Did you follow the proposal from Santosh and add the function 'master_ram_init_control_m1_msgram_memories();' and 'master_ram_init_control_L0_L3_memories();'.

    I got still the same issue with or without this functions.

    TI, can you pls propose a piece of (real, verbal or tutorial) code how to handle this issue on m3 and c23.

    So the examples in 'controlSUITE' are obviously not sufficient enough to build a 'basic' SW for m3 and c23.

     

    Thanks.

    Best regards

    Werner

     

  • I have similar issues, but just with the M3. I'm running the blinky.c example when is running with JATG attached all works fine. When the I do a Power on Reset without the JTAG connected the blink rate drecrease, like if the PLL clock fails and enter the 10MHZ emergency clock.

    The User's guide within the controlSUITE isn't enough. 

     

    This is the code within blinky.c example for M3:

     

    //###########################################################################

    // FILE:   blinky.c

    // TITLE:  blinky example.

    //###########################################################################

    // $TI Release: F28M35x Driver Library v100 $

    // $Release Date: October 12, 2011 $

    //###########################################################################

     

    #include "inc/hw_ints.h"

    #include "inc/hw_memmap.h"

    #include "inc/hw_nvic.h"

    #include "inc/hw_gpio.h"

    #include "inc/hw_types.h"

    #include "inc/hw_sysctl.h"

    #include "driverlib/debug.h"

    #include "driverlib/interrupt.h"

    #include "driverlib/sysctl.h"

    #include "driverlib/gpio.h"

     

    //*****************************************************************************

    //

    //! \addtogroup example_list

    //! <h1>Blinky (blinky)</h1>

    //!

    //! A very simple example that blinks the on-board LED3.

    //

    //*****************************************************************************

     

    //*****************************************************************************

    // The error routine that is called if the driver library encounters an error.

    //*****************************************************************************

    #ifdef DEBUG

    void

    __error__(char *pcFilename, unsigned long ulLine)

    {

    }

     

    #endif

     

    //*****************************************************************************

    // 

    // Blink LED3

    //*****************************************************************************

    int

    main(void)

    {

     

        volatile unsigned long ulLoop;

     

        // Disable Protection

        HWREG(SYSCTL_MWRALLOW) =  0xA5A5A5A5;

     

        // Sets up PLL, M3 running at 100MHz and C28 running at 100MHz

        SysCtlClockConfigSet(SYSCTL_USE_PLL | (SYSCTL_SPLLIMULT_M & 0xA) |

                             SYSCTL_SYSDIV_1 | SYSCTL_M3SSDIV_1 |

                             SYSCTL_XCLKDIV_4);

     

        // Enable clock supply for GPIOC

        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);

        // Disable clock supply for the watchdog modules

        SysCtlPeripheralDisable(SYSCTL_PERIPH_WDOG1);

        SysCtlPeripheralDisable(SYSCTL_PERIPH_WDOG0);

     

        // Enable processor interrupts.

        IntMasterEnable();

     

        // Set up the Pin for LED3 

        GPIOPinTypeGPIOOutput(GPIO_PORTC_BASE, GPIO_PIN_7);

        GPIOPinWrite(GPIO_PORTC_BASE, GPIO_PIN_7, ~0);

     

        // Loop forever while the timers run.

        while(1)

        {

            //

            // Turn on the LED.

            //

            GPIOPinWrite(GPIO_PORTC_BASE, GPIO_PIN_7, 0);

            //

            // Delay for a bit.

            //

            for(ulLoop = 0; ulLoop < 2000000; ulLoop++)

            {

            }

            //

            // Turn off the LED.

            //

            GPIOPinWrite(GPIO_PORTC_BASE, GPIO_PIN_7, ~0);

            //

            // Delay for a bit.

            //

            for(ulLoop = 0; ulLoop < 2000000; ulLoop++)

            {

            }

     

        }

    }

     

     

     

  • Hi Werner

    can you check if your code is waiting for proper boot status from C-Boot ROM, as shown in figure 5.33 flow diagram, before calling the RAM-INIT function? Allways please make sure before sending the first IPC command to C-Boot ROM, that C-Boot ROM is actually ready to accept the IPC commands, you will have to do this for the first IPC command.

    you should have a successful stand-alone boot if you follow the flow diagram 5.33 properly, we are in the process of improving our controlSuite examples for boot.

    Please let me know how it goes after you add the loop to check for C_BOOTROM_BOOTSTS_CTOM_CONTROL_SYSTEM_READY.

     

    Best Regards

    Santosh

     

  • Hi Jorge,

    can you check if your device is getting the missing clock NMI, when booting in stand-alone mode?

    Before starting your application (configuring PLL) can you check M-Boot ROM status (sec 5.5.11 in the TRM) and if Missing clock was detected and toggle a GPIO?

    also I don't see NVIC BASE being re-mapped to your application NVIC table in the applciation main(), so your device might still be using boot ROM installed NVIC table at 0x00000000. This should be fine as long as your application is not using any interrupts.

    in the for loop towards the end of your main can you check if there was a missing clock detected - the best way to do this is to read MCLKSTS register (section 1.13.6.3 of TRM) and toggle a GPIO if detected.

    Best Regards

    Santosh

     

  • Hi Santosh,

    I ran the following test code and all seems to be ok.

    No missing clock detected. (None LED toggle).

    The device I'm using is the: F28M35H52C1.

    Running on CCS Version: 4.2.4.00034

    The controlCARD for Concerto is plugged on the docking station.

    We need to clarify this issue with the missing clock. Hope you can help me.

    //###########################################################################
    // FILE:   blinky.c
    // TITLE:  blinky example.
    //###########################################################################
    // $TI Release: F28M35x Driver Library v100 $
    // $Release Date: October 12, 2011 $
    //###########################################################################

    #include "inc/hw_ints.h"
    #include "inc/hw_memmap.h"
    #include "inc/hw_nvic.h"
    #include "inc/hw_gpio.h"
    #include "inc/hw_types.h"
    #include "inc/hw_sysctl.h"
    #include "driverlib/debug.h"
    #include "driverlib/interrupt.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/gpio.h"

    //*****************************************************************************
    //! A very simple example that blinks the on-board LED3.
    //
    //*****************************************************************************

    //*****************************************************************************
    // The error routine that is called if the driver library encounters an error.
    //*****************************************************************************
    #ifdef DEBUG
    void
    __error__(char *pcFilename, unsigned long ulLine)
    {
    }

    #endif

    //*****************************************************************************
    //
    // Blink LED3
    //*****************************************************************************
    void main(void)
    {
        volatile unsigned long *uTestMbootFlags=0x20004000; //Addres for t
        volatile unsigned long MCLKSTAT;
        volatile unsigned long ulLoop;

        // Disable Protection
        HWREG(SYSCTL_MWRALLOW) =  0xA5A5A5A5; 
       
        // Sets up PLL, M3 running at 100MHz and C28 running at 100MHz
        SysCtlClockConfigSet(SYSCTL_USE_PLL | (SYSCTL_SPLLIMULT_M & 0xA) |
                             SYSCTL_SYSDIV_1 | SYSCTL_M3SSDIV_1);

        // Enable clock supply for GPIOC
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);

        // Disable clock supply for the watchdog modules
        SysCtlPeripheralDisable(SYSCTL_PERIPH_WDOG1);
        SysCtlPeripheralDisable(SYSCTL_PERIPH_WDOG0);
       
        // Enable processor interrupts.
        IntMasterEnable();

        // Set up the Pin for LED3
        GPIOPinTypeGPIOOutput(GPIO_PORTC_BASE, GPIO_PIN_7);
        GPIOPinWrite(GPIO_PORTC_BASE, GPIO_PIN_7, ~0);
       
        GPIOPinTypeGPIOOutput(GPIO_PORTC_BASE, GPIO_PIN_6);
        GPIOPinWrite(GPIO_PORTC_BASE, GPIO_PIN_6, ~0);
       
        // Loop forever while the timers run.
        while(1)
        {
           
           
            if((*uTestMbootFlags & 0x80000000)== 0x80000000)
            {
                    // Turn on the LED.
            //
             GPIOPinWrite(GPIO_PORTC_BASE, GPIO_PIN_7, 0);
            //
            // Delay for a bit.
            //
             SysCtlDelay(SysCtlClockGet(SYSTEM_CLOCK_SPEED)/100);
            //
            // Turn off the LED.
            //
             GPIOPinWrite(GPIO_PORTC_BASE, GPIO_PIN_7, ~0);
            //
            // Delay for a bit.
            //
             SysCtlDelay(SysCtlClockGet(SYSTEM_CLOCK_SPEED)/100);   
            }
           
           MCLKSTAT= HWREG(SYSCTL_MCLKSTS);
            if((MCLKSTAT & 0x00008000)==0x00008000)
            {
             GPIOPinWrite(GPIO_PORTC_BASE, GPIO_PIN_6, 0);
            //
            // Delay for a bit.
            //
             SysCtlDelay(SysCtlClockGet(SYSTEM_CLOCK_SPEED)/100);
            //
            // Turn off the LED.
            //
             GPIOPinWrite(GPIO_PORTC_BASE, GPIO_PIN_6, ~0);
            //
            // Delay for a bit.
            //
             SysCtlDelay(SysCtlClockGet(SYSTEM_CLOCK_SPEED)/100);   
            }
        }
    }

  • Hi Jorge,

    thanks for checking this. Looks like it is not missing clock then.

    other reason why your code from flash is running slow in stand-alone mode as compared to when run using emulator is flash wait state settings. The Gel script must be setting it to a different value - can you check this and put the same in your main() code?

    Also, please attach your Gel script, so that I can take a look at it.

    Best Regards

    Santosh

  • Also make sure that you are aware of the Rev0 Errata, if you are running through C-Boot ROM when CCS is connected with GEL scripts - there is a bug in C-Boot ROM that will cause it to iTRAP.

    so if you want to run through C-Boot ROM with CCS connected, then make sure you remove GEL script and have no memory window open to flash and no watch window expression reading any flash location.

     

    Best Regards

    santosh

  • Hi Santosh,

     

    I'm using the default GEL file which is put it by the debugger, here is the script:

     

    /********************************************************************/
    /* f28m35h52c1_m3.gel                                               */
    /* Version 4.00.0                                                   */
    /*                                                                  */
    /* This GEL file is to be used with the F28M35H52C1 M3 Device.      */
    /* Changes may be required to support specific hardware designs.    */
    /*                                                                  */
    /* Code Composer Studio supports six reserved GEL functions that    */
    /* automatically get executed if they are defined. They are:        */
    /*                                                                  */
    /* StartUp()              - Executed whenever CCS is invoked        */
    /* OnReset()              - Executed after Debug->Reset CPU         */
    /* OnRestart()            - Executed after Debug->Restart           */
    /* OnPreFileLoaded()      - Executed before File->Load Program      */
    /* OnFileLoaded()         - Executed after File->Load Program       */
    /* OnTargetConnect()      - Executed after Debug->Connect           */
    /*                                                                  */
    /********************************************************************/

    menuitem "StartUp"

    hotmenu StartUp()
    {
        /* Load the CortexM3_util.gel file */
        GEL_LoadGel("$(GEL_file_dir)/CortexM3_util.gel");

        GEL_MapOff();
        GEL_MapReset();
        GEL_MapOn();
        F28M35H52C1_Memory_Map();
    }

    OnTargetConnect()
    {
        M3_Disable_Flash_ECC();
        M3_Ram_Init();
        watchdog_enable();

        uart_enable();
    }

    OnReset(int nErrorCode)
    {
        /* If XRSn Reset occurred previously, re-activate Flash prior to accessing Flash */
        if ((*(unsigned long *)0x400FE05C & 0x1) == 1)
        {
              Flash_Activate();
        }
        Read_OTPSECLOCK();
        Unlock_CSMZ1();
        Unlock_CSMZ2();
        Unlock_ECSLZ1();
        Unlock_ECSLZ2();
        M3_Disable_Flash_ECC();
        ReadFlashEXEZ1();
        ReadFlashEXEZ2();
        Grab_Sectors();
        Device_Config();
    }

    OnRestart ()
    {
        Device_Config();
    }

    OnPreFileLoaded()
    {
        GEL_Reset();

    }

    menuitem "Initialize F28M35H52C1 Memory Map"

    hotmenu F28M35H52C1_Memory_Map()
    {
         /*
         * Syntax for GEL_MapAddStr.
         * GEL_MapAddStr(address, page, length, "attribute", waitstate);

        Basic Attribute Types           Derived Attribute Types
        String      Description         String      Description
        R           Read                NONE        No memory/protected
        W           Write               RAM         Read and write
        P           Port                ROM         Read only
        EX          External            WOM         Write only
        EM          Emulator            INPORT      Port read only
        PR          Programmable        OUTPORT     Port write only
        ER          Erasable            IOPORT      Port read and write
        DA          Dual access         SARAM       Single access RAM
        ASn         Access size         DARAM       Dual access RAM
        SHnC        Shared              FLASH       Flash ROM
        CACHE       Cache               EXRAM       External RAM
        TX          Text                EXROM       External ROM
        MN          Monitor             EPROM       Erasable write-able EPROM
        SA          Single access       MONITOR     Monitor ROM
        FL          Flash               PRAM        Program RAM
        MR          Memory mapped       PROM        Program ROM
        NULL        NULL                NULL        NULL
       
        */

        GEL_MapAddStr(0x0,        0, 0x10000,   "R", 0);      /* M3 BOOT ROM                         */
        GEL_MapAddStr(0x200000,   0, 0x80000,    "R",   0);      /* FLASH BANK 1                        */
        GEL_MapAddStr(0x600000,      0, 0x10000,    "R",   0);        /* FLASH BANK 1 ECC Bits            */
        GEL_MapAddStr(0x680000,   0, 0x00800,   "R",   0);      /* OTP BANK 1                          */
        GEL_MapAddStr(0x680800,   0, 0x00004,   "R",   0);      /* OTP BANK 1 Application 1            */
        GEL_MapAddStr(0x68080C,      0, 0x0000C,    "R",   0);        /* OTP BANK 1 Application 2            */
        GEL_MapAddStr(0x700000,      0, 0x00100,    "R",   0);        /* OTP BANK 1 ECC Bits                */
        GEL_MapAddStr(0x700100,   0, 0x00003,    "R",   0);        /* OTP BANK 1 Application ECC Bits    */
        GEL_MapAddStr(0x1000000,  0, 0x10000,   "R",   0);        /* M3 BOOT ROM (Dual Mapped)        */
        GEL_MapAddStr(0x4000000,  0, 0x4000000, "R",   0);        /* uCRC (Mirror 1 Space)            */
       
        GEL_MapAddStr(0x20000000, 0, 0x8000,    "R|W", 0);      /* C0-C4 SARAM                        */
        GEL_MapAddStr(0x20008000, 0, 0x10000,   "R|W", 0);        /* S0-S7 SRAM                        */
        GEL_MapAddStr(0x2007f000, 0, 0x1000,    "R|W", 0);        /* CtoM and MtoC MSGRAM              */
        GEL_MapAddStr(0x20080000, 0, 0x4000,    "R",   0);        /* C0,C1 SRAM ECC Bits                */
        GEL_MapAddStr(0x20084000, 0, 0x4000,    "R",   0);        /* C2,C3 SARAM Parity Bits            */
        GEL_MapAddStr(0x20088000, 0, 0x10000,   "R",   0);        /* S0-S7 SRAM Parity Bits            */
        GEL_MapAddStr(0x200ff000, 0, 0x1000,    "R",   0);        /* CtoM and MtoC MSGRAM Parity Bits    */
       
        GEL_MapAddStr(0x22000000, 0, 0x2000000, "R|W", 0);        /* Bit-Banded RAM                      */
        GEL_MapAddStr(0x24000000, 0, 0x4000000, "R",   0);      /* uCRC (Mirror 2 Space)            */
       
        GEL_MapAddStr(0x40000000, 0, 0x1000,    "R|W", 0);      /* Watchdog Timer 0                 */
        GEL_MapAddStr(0x40001000, 0, 0x1000,    "R|W", 0);      /* Watchdog Timer 1                 */
        GEL_MapAddStr(0x40004000, 0, 0x1000,    "R|W", 0);      /* GPIO Port A                         */
        GEL_MapAddStr(0x40005000, 0, 0x1000,    "R|W", 0);      /* GPIO Port B                         */
        GEL_MapAddStr(0x40006000, 0, 0x1000,    "R|W", 0);      /* GPIO Port C                         */
        GEL_MapAddStr(0x40007000, 0, 0x1000,    "R|W", 0);      /* GPIO Port D                         */
        GEL_MapAddStr(0x40008000, 0, 0x1000,    "R|W", 0);      /* SSI0                             */
        GEL_MapAddStr(0x40009000, 0, 0x1000,    "R|W", 0);      /* SSI1                             */
        GEL_MapAddStr(0x4000a000, 0, 0x1000,    "R|W", 0);      /* SSI2                             */
        GEL_MapAddStr(0x4000b000, 0, 0x1000,    "R|W", 0);      /* SSI3                             */
        GEL_MapAddStr(0x4000c000, 0, 0x1000,    "R|W", 0);      /* UART0                             */
        GEL_MapAddStr(0x4000d000, 0, 0x1000,    "R|W", 0);      /* UART1                             */
        GEL_MapAddStr(0x4000e000, 0, 0x1000,    "R|W", 0);      /* UART2                             */
        GEL_MapAddStr(0x4000f000, 0, 0x1000,    "R|W", 0);      /* UART3                             */
        GEL_MapAddStr(0x40010000, 0, 0x1000,    "R|W", 0);      /* UART4                             */
       
        GEL_MapAddStr(0x40020000, 0, 0x800,     "R|W", 0);      /* I2C Master 0                     */
        GEL_MapAddStr(0x40020800, 0, 0x800,     "R|W", 0);      /* I2C Slave 0                         */
        GEL_MapAddStr(0x40021000, 0, 0x800,     "R|W", 0);      /* I2C Master 1                     */
        GEL_MapAddStr(0x40021800, 0, 0x800,     "R|W", 0);      /* I2C Slave 1                         */
        GEL_MapAddStr(0x40024000, 0, 0x1000,    "R|W", 0);      /* GPIO Port E                         */
        GEL_MapAddStr(0x40025000, 0, 0x1000,    "R|W", 0);      /* GPIO Port F                         */
        GEL_MapAddStr(0x40026000, 0, 0x1000,    "R|W", 0);      /* GPIO Port G                         */
        GEL_MapAddStr(0x40027000, 0, 0x1000,    "R|W", 0);      /* GPIO Port H                         */
        GEL_MapAddStr(0x40030000, 0, 0x1000,    "R|W", 0);      /* Timer0                             */
        GEL_MapAddStr(0x40031000, 0, 0x1000,    "R|W", 0);      /* Timer1                             */
        GEL_MapAddStr(0x40032000, 0, 0x1000,    "R|W", 0);      /* Timer2                             */
        GEL_MapAddStr(0x40033000, 0, 0x1000,    "R|W", 0);      /* Timer3                             */
        GEL_MapAddStr(0x4003d000, 0, 0x1000,    "R|W", 0);      /* GPIO Port J                         */
        GEL_MapAddStr(0x40048000, 0, 0x1000,    "R|W", 0);      /* Ethernet Controller                 */
        GEL_MapAddStr(0x40050000, 0, 0x1000,    "R|W", 0);      /* USB Controller                     */
        GEL_MapAddStr(0x40058000, 0, 0x1000,    "R|W", 0);      /* GPIO Port A (AHB aperture)        */
        GEL_MapAddStr(0x40059000, 0, 0x1000,    "R|W", 0);      /* GPIO Port B (AHB aperture)        */
        GEL_MapAddStr(0x4005a000, 0, 0x1000,    "R|W", 0);      /* GPIO Port C (AHB aperture)        */
        GEL_MapAddStr(0x4005b000, 0, 0x1000,    "R|W", 0);      /* GPIO Port D (AHB aperture)        */
        GEL_MapAddStr(0x4005c000, 0, 0x1000,    "R|W", 0);      /* GPIO Port E (AHB aperture)        */
        GEL_MapAddStr(0x4005d000, 0, 0x1000,    "R|W", 0);      /* GPIO Port F (AHB aperture)        */
        GEL_MapAddStr(0x4005e000, 0, 0x1000,    "R|W", 0);      /* GPIO Port G (AHB aperture)        */
        GEL_MapAddStr(0x4005f000, 0, 0x1000,    "R|W", 0);      /* GPIO Port H (AHB aperture)        */
        GEL_MapAddStr(0x40060000, 0, 0x1000,    "R|W", 0);      /* GPIO Port J (AHB aperture)        */
        GEL_MapAddStr(0x40070000, 0, 0x2000,    "R|W", 0);      /* CAN0                            */
        GEL_MapAddStr(0x40072000, 0, 0x2000,    "R|W", 0);      /* CAN0 Message RAM                 */
        GEL_MapAddStr(0x40074000, 0, 0x2000,    "R|W", 0);      /* CAN1                            */
        GEL_MapAddStr(0x40076000, 0, 0x2000,    "R|W", 0);      /* CAN1 Message RAM                 */
        GEL_MapAddStr(0x400d0000, 0, 0x1000,    "R|W", 0);      /* EPI0                             */
        GEL_MapAddStr(0x400fa000, 0, 0x600,     "R|W", 0);         /* Flash Control                     */
        GEL_MapAddStr(0x400fa600, 0, 0x080,     "R|W", 0);         /* Flash ECC Error                    */
        GEL_MapAddStr(0x400fb200, 0, 0x100,     "R|W", 0);     /* RAM Configuration        */
        GEL_MapAddStr(0x400fb300, 0, 0x100,     "R|W", 0);     /* RAM Parity/ECC        */
        GEL_MapAddStr(0x400fb400, 0, 0x200,     "R|W", 0);        /* CSM                                 */
        GEL_MapAddStr(0x400fb600, 0, 0x80,      "R|W", 0);        /* uCRC                             */
        GEL_MapAddStr(0x400fb700, 0, 0x80,      "R|W", 0);        /* CtoM and MtoC IPC                */
        GEL_MapAddStr(0x400fb800, 0, 0x100,     "R|W", 0);        /* Clock/LPM/Reset Control            */
        GEL_MapAddStr(0x400fb900, 0, 0x100,         "R|W", 0);        /* Device Configuration and Write Protect Registers        */
        GEL_MapAddStr(0x400fba00, 0, 0x80,         "R|W", 0);        /* NMI Configuration                */
        GEL_MapAddStr(0x400fe000, 0, 0x1000,    "R|W", 0);        /* System Control                    */
        GEL_MapAddStr(0x400ff000, 0, 0x1000,    "R|W", 0);      /* uDMA Control                        */
       
        /* ************ BIT BANDED COPY OF 0x40000000-0x400FFFFF ********************************** */
        GEL_MapAddStr(0x42000000, 0, 0x2000000, "R|W", 0);    /* Bit-Banded Peripheral Space    */
       
        GEL_MapAddStr(0x50001600, 0, 0x200,       "R|W", 0);         /* ADC1 and ADC2 Result Registers     */

        GEL_MapAddStr(0xE000E000, 0, 0x1000,     "R|W", 0);

        GEL_TextOut("Memory Map Initialization Complete\n");
    }

    hotmenu M3_Ram_Init()
    {
        *(unsigned long *)0x400FB240 |= 0x00000055; /* Initialize C0, C1, C2, C3 RAM's */    
        *(unsigned long *)0x400FB260 |= 0x00000001; /* Initialize MtoC MSG RAM's */
        while(*(unsigned long *)0x400FB270 != 0x55);
        while(*(unsigned long *)0x400FB288 != 0x01);
    }

    hotmenu Flash_Activate()
    {
        int i;
        *(unsigned long *)0x400FA048 = 0x1;
        *(unsigned long *)0x400FA040 = 0x3;
        for (i=0; i<10; i++)
        {
            R1 = 0x00000000;
        }
    }
    hotmenu M3_Disable_Flash_ECC()
    {
        *(unsigned short *)0x400FA600 = 0x0; /* Disable Flash ECC */
    }

    hotmenu M3_Enable_Flash_ECC()
    {
        *(unsigned short *)0x400FA600 |= 0xA; /* Enable Flash ECC */
    }

    menuitem "Peripherals"
    hotmenu watchdog_enable()
    {
        *(unsigned long*)0x400FE100 |= 0x10000008;
        GEL_TextOut("Watchdog Timers Enabled\n");
    }

    hotmenu uart_enable()
    {
        *(unsigned long*)0x400FE104 |= 0xF;
        GEL_TextOut("UARTs Enabled\n");
    }

    menuitem "Security"
    hotmenu Unlock_CSMZ1()
    {
        /* Perform dummy reads of the password locations */
        R1 = *0x200000;
        R1 = *0x200004;
        R1 = *0x200008;
        R1 = *0x20000C;
       
        /* Write passwords to the KEY registers.  0xFFFFFFFF's are dummy passwords.
           User should replace them with the correct password for their DSP */
        *0x400FB400 = 0xFFFFFFFF;
        *0x400FB404 = 0xFFFFFFFF;
        *0x400FB408 = 0xFFFFFFFF;
        *0x400FB40C = 0xFFFFFFFF;
    }

    hotmenu Unlock_CSMZ2()
    {
        /* Perform dummy reads of the password locations */
        R1 = *0x27FFF0;
        R1 = *0x27FFF4;
        R1 = *0x27FFF8;
        R1 = *0x27FFFC;
       
        /* Write passwords to the KEY registers.  0xFFFFFFFF's are dummy passwords.
           User should replace them with the correct password for their DSP */
        *0x400FB418 = 0xFFFFFFFF;
        *0x400FB41C = 0xFFFFFFFF;
        *0x400FB420 = 0xFFFFFFFF;
        *0x400FB424 = 0xFFFFFFFF;
    }

    hotmenu Unlock_ECSLZ1()
    {
        /* Perform dummy reads of the password locations */
        R1 = *0x200010;
        R1 = *0x200014;
       
        /* Write passwords to the KEY registers.  0xFFFFFFFF's are dummy passwords.
           User should replace them with the correct password for their DSP */
        *0x400FB410 = 0xFFFFFFFF;
        *0x400FB414 = 0xFFFFFFFF;
    }

    hotmenu Unlock_ECSLZ2()
    {
        /* Perform dummy reads of the password locations */
        R1 = *0x27FFE8;
        R1 = *0x27FFEC;
       
        /* Write passwords to the KEY registers.  0xFFFFFFFF's are dummy passwords.
           User should replace them with the correct password for their DSP */
        *0x400FB428 = 0xFFFFFFFF;
        *0x400FB42C = 0xFFFFFFFF;
    }

    hotmenu ReadFlashEXEZ1()
    {
        /* Perform dummy reads of the password locations */
        R1 = *0x200020;
    }

    hotmenu ReadFlashEXEZ2()
    {
        /* Perform dummy reads of the password locations */
        R1 = *0x27FFDC;
    }

    hotmenu Grab_Sectors()
    {
       R1 = *0x200018; // Read Z1_GRABSECT
       R1 = *0x20001C; // Read Z1_GRABRAM
       R1 = *0x27FFE4; // Read Z2_GRABSECT
       R1 = *0x27FFE0; // Read Z2_GRABRAM
    }

    hotmenu Read_OTPSECLOCK()
    {
        R1 = *0x680800;
    }
    /* The below is usually performed in the boot ROM, but if during debug,
       Boot ROM execution is bypassed, then the following must be executed
       OnReset() or OnRestart()
    */

    menuitem "Device Configuration"
    hotmenu Device_Config()
    {
        *(unsigned long *)0x400FE004   = *(unsigned long *)0x00680430;
        *(unsigned long *)0x400FB900   = *(unsigned long *)0x00680410;
        *(unsigned long *)0x400FB904   = *(unsigned long *)0x00680414;
        *(unsigned long *)0x400FB930   = *(unsigned long *)0x0068042C;
                                        
        *(unsigned long *)0x400FE014   = *(unsigned long *)0x00680400;
        *(unsigned long *)0x400FE01C   = *(unsigned long *)0x00680404;
        *(unsigned long *)0x400FE024   = *(unsigned long *)0x00680408;
        *(unsigned long *)0x400FE194   = *(unsigned long *)0x0068040C;
        *(unsigned long *)0x400FB910   = *(unsigned long *)0x00680418;
        *(unsigned long *)0x400FB914   = *(unsigned long *)0x0068041C;
        *(unsigned long *)0x400FB918   = *(unsigned long *)0x00680420;
        *(unsigned long *)0x400FB91C   = *(unsigned long *)0x00680424;
        *(unsigned long *)0x400FB920   = *(unsigned long *)0x00680428;
       
        *(unsigned long *)0x400FB8C0 |= 0x00030001; /* Release C28 from Reset*/   
    }

     

    Please let me know if I have to modify something.

    We are class on a University, all of us we are having the same trouble.

    Regards

  • Hi Jorge,

    thanks for the GEL script , I don;t see anything unusual in it. your GEL script looks good and there is no flash wait state settings being done seperately.

    just to reconfirm-> the problem you are seeing is that when you run LED Blinking example with CCS connected you see that LEDs are blinking faster as compared to when running the same code in stand alone mode.

    Questions> please clarify below to help you correctly:

    1.> are you running code from flash or RAM?

    2.> the blinky.c examples you got from controlSuite is made to run from RAM, did you change the linker scripts to execute it from flash?

    3.> if you are not running from flash - but instead loading code to RAM and are youexpecting the code to be RUN from RAM after a power of reset? Did you configure it to boot to RAM and are you sure you are giving a Power on Reset?

    because in your original question you mentioned that LEDs are blinking slow after a POR (power on reset), I was assumig that you are running from flash.

    4.> if you intend to modify the blinky example and link/execute it from flash and set boot mode IOs to boot from flash, then please follow all the set up done in flash_m3.c example under *_Dual/flash/m3/* directory.

    5.> are you running the examples on Concerto control card or some other target board you made yourself?

    6.> can you attach your linker command file (please use insert file option instead of copy-pasting whole file - the button left to the html button in the message post window)

     

    I'm sure we can help you in getting your code up and running, please let us know about the above. The team has tested these examples, so you can be confident on that.

    Best Regards

    santosh

     

  • Hi Santosh,

    Confirmed, that's exactly the problem. With CCS the LEDs blink faster, when is in stand alone the blink rate is slower.

    1.- I don't know, I'm not very familiar with the CCS. How do I know where my code is running?

    2.- As I didn't modify the blinky example from controlSUITE I'm running from RAM. I didn't change the linker script to execute from flash. Where I can find more information in order to be able to modify by my own the linker script?

    3.- The GPIO DIP switch are set to boot from Flash (all to "1"). Yes I'm sure I'm doing a POR.

    4.- I'll do this step, I'll do all the set up from the flash_m3.c example and I'll let you know the results.

    5.- I'm using the controlCARD.

    6.- I'm attaching the CMD (linker script). As I said I'm using the default script without modification.

    1323.CMD.zip

     

    I really appreciate your help. 

     

    Regards.

  • Hi Jorge,

    It looks like the linker cmd file you posted is linking your code in Flash.  One quick way to make sure you are programming Flash is to look for 'Erasing Flash' and 'Programming Flash' in the status window that pops up when you load your code using the CCS debugger.

    A good starting point for Flash projects is the flash example in C:\TI\controlSUITE\device_support\f28m35x\v100\F28M35x_examples_Dual\flash\m3.  The main() function in flash_m3.c shows the steps needed to setup the system clock tree and Flash waitstates.

    If you are still having problems, please post your entire project (or at least the part of code related to initialization).

    Regards,
    Harrison

  • Hi Harrison/Santosh,

    I finally can run the Concerto as stand alone. The problem seems to be with the FlashInit().

    I follow the steps under the C:\TI\controlSUITE\device_support\f28m35x\v100\F28M35x_examples_Dual\flash\m3\flash_m3.c

    I'll write an a how's to guide to share with you. Another classmate will make an a video to upload later to youtube.

    Thanks so much for your help.

    Kind regards,

    Jorge Macias

  • Hi Jorge

    awesome. Please let us know if you have any more questions on other peripherals on Master and/or control subsytems - feel free to experiment and post any questions.

    yes, please share your guide with us, it would be helpful to many and post the link to your youtube video.

     

    good luck

    Best Regards

    Santosh

  • Hi again Santosh,

    After flashing the Concerto as the flash_m3.c said.

    Now when I try to debug the device again the following pop-up message appear:

     

     

    Do you know why is this happening?

    I do a POR and click "Retry" that's works fine and I able to debug again.

    Regards

  • Hi Jorge,

    after programming flash, do you do a debug reset and run through your code? do you see the error even after a debug reset?

    I will also check this with Harrison and team here.

     

    Best Regards

    Santosh

  • Jorge,

    Please follow the following sequence while debugging a system in which both the code is in flash and also the M3 instructs a boot from flash for the C28x,

    {flash the code on M3 and the C28x} Now

    Reset the C28x,

    Reset the M3,

    Restart the M3,

    Run the M3 , {at this instance the M3 will be stuck at the IPC command to check the memory }

    Now Run the C28x,

    I will advice setting up a hardware breakpoint at the beginning of the main file for the C28x, so that you can enable real time mode on the C28x if need be,

    Any other sequence of events/debug may need to undesired results,

    Also it is necessary to follow this sequence each time you reflash the device whether it be on C28x or the M3 side.

    I have also sent you some files for that i have used for a system running out of flash on the concerto device, you may find those useful.

  • Hi Manish,

    I've been doing the things in your example. It was very helpful, now we can easily debug and Flash the Concerto. Like I say before I'm student from a microcontroller class, so the next year will be working with more peripheral of the Concerto device.

     

     

    Regards,

    Jorge