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.

LAUNCHXL-F28379D: No source available and Linker File Issues

Part Number: LAUNCHXL-F28379D
Other Parts Discussed in Thread: C2000WARE

Hello experts,

I am having a problem when I debug my program. When I run the program I get the following error:

It says there is no source available for _system_post_cint(). What is that?

The program counter is halted at address 0x3FE493 as shown here:

The address 0x3FE493 is part of the CPU1 to CPU2 MSGRAM according to the Memory Map shown here:

I have also updated the linker .cmd file because my program didn't fit in available memory. I have also increased the heap size from the default 0x400 to 0x800 and the stack size from the default 0x400 to 0x800 as shown here because I was getting warnings saying to increase them:

But my program has been crashing recently and I don't know why. I know which C function makes it crash. Actually, when I comment out a certain function, the program crashes. But if I leave that function in the code, it runs successfully. Did I corrupt something accidentally by adjusting the linker .cmd file? I am also using the Flash API to store variables to non-volatile memory. I really need some advice on this.

Here is my linker file:

MEMORY
{
PAGE 0 :  /* Program Memory */
          /* Memory (RAM/FLASH) blocks can be moved to PAGE1 for data allocation */
          /* BEGIN is used for the "boot to Flash" bootloader mode   */

   BEGIN           	: origin = 0x080000, length = 0x000002
   RAMLS0          	: origin = 0x008000, length = 0x000800


   RAMLS3      		: origin = 0x009800, length = 0x000800
   RAMLS4      		: origin = 0x00A000, length = 0x000800
   RAMGS14          : origin = 0x01A000, length = 0x001000     /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */
   RAMGS15          : origin = 0x01B000, length = 0x000FF8     /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */

//   RAMGS15_RSVD     : origin = 0x01BFF8, length = 0x000008    /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */

   RESET           	: origin = 0x3FFFC0, length = 0x000002

   /* Flash sectors */
   FLASHA           : origin = 0x080002, length = 0x001FFE	/* on-chip Flash */
   FLASHB           : origin = 0x082000, length = 0x002000	/* on-chip Flash */
   FLASHC           : origin = 0x084000, length = 0x002000	/* on-chip Flash */
   FLASHD           : origin = 0x086000, length = 0x002000	/* on-chip Flash */
   FLASHE           : origin = 0x088000, length = 0x008000	/* on-chip Flash */
   FLASHF           : origin = 0x090000, length = 0x008000	/* on-chip Flash */
   FLASHG           : origin = 0x098000, length = 0x008000	/* on-chip Flash */
   FLASHH           : origin = 0x0A0000, length = 0x008000	/* on-chip Flash */
   FLASHI           : origin = 0x0A8000, length = 0x008000	/* on-chip Flash */
   FLASHJ           : origin = 0x0B0000, length = 0x008000	/* on-chip Flash */
   FLASHK           : origin = 0x0B8000, length = 0x002000	/* on-chip Flash */
   FLASHL           : origin = 0x0BA000, length = 0x002000	/* on-chip Flash */
   FLASHM           : origin = 0x0BC000, length = 0x002000	/* on-chip Flash */
   FLASHN           : origin = 0x0BE000, length = 0x001FF0	/* on-chip Flash */

//   FLASHN_RSVD     : origin = 0x0BFFF0, length = 0x000010    /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */

PAGE 1 : /* Data Memory */
         /* Memory (RAM/FLASH) blocks can be moved to PAGE0 for program allocation */

   BOOT_RSVD       : origin = 0x000002, length = 0x000121     /* Part of M0, BOOT rom will use this for stack */
   RAMM0           : origin = 0x000123, length = 0x0002DD
   RAMM1           : origin = 0x000400, length = 0x0003F8     /* on-chip RAM block M1 */
//   RAMM1_RSVD      : origin = 0x0007F8, length = 0x000008     /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */
   RAMD0           : origin = 0x00B000, length = 0x000800
   RAMD1           : origin = 0x00B800, length = 0x000800

   RAMLS1      	   : origin = 0x008800, length = 0x000800
   RAMLS2     	   : origin = 0x009000, length = 0x000800
   RAMLS5      	   : origin = 0x00A800, length = 0x000800

   RAMGS0      : origin = 0x00C000, length = 0x001000
   RAMGS1      : origin = 0x00D000, length = 0x001000
   RAMGS2      : origin = 0x00E000, length = 0x001000
   RAMGS3      : origin = 0x00F000, length = 0x001000
   RAMGS4      : origin = 0x010000, length = 0x001000
   RAMGS5      : origin = 0x011000, length = 0x001000
   RAMGS6      : origin = 0x012000, length = 0x001000
   RAMGS7      : origin = 0x013000, length = 0x001000
   RAMGS8      : origin = 0x014000, length = 0x001000
   RAMGS9      : origin = 0x015000, length = 0x001000
   RAMGS10     : origin = 0x016000, length = 0x001000

//   RAMGS11     : origin = 0x017000, length = 0x000FF8   /* Uncomment for F28374D, F28376D devices */

//   RAMGS11_RSVD : origin = 0x017FF8, length = 0x000008    /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */

   RAMGS11     : origin = 0x017000, length = 0x001000     /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */
   RAMGS12     : origin = 0x018000, length = 0x001000     /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */
   RAMGS13     : origin = 0x019000, length = 0x001000     /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */

   CPU2TOCPU1RAM   : origin = 0x03F800, length = 0x000400
   CPU1TOCPU2RAM   : origin = 0x03FC00, length = 0x000400
}

SECTIONS
{
   /* Allocate program areas: */
   .cinit              : > FLASHB | FLASHG     PAGE = 0, ALIGN(8) // Added by MJT 6/16/2022
// .cinit              : > FLASHB     PAGE = 0, ALIGN(8)
   .text               : >> FLASHB | FLASHC | FLASHD | FLASHE      PAGE = 0, ALIGN(8)
   codestart           : > BEGIN       PAGE = 0, ALIGN(8)
   /* Allocate uninitalized data sections: */
   .stack              : > RAMM1 | RAMM0 | RAMD0       PAGE = 1
   .switch             : > FLASHB      PAGE = 0, ALIGN(8)
   .reset              : > RESET,      PAGE = 0, TYPE = DSECT /* not used, */

#if defined(__TI_EABI__)
   .init_array         : > FLASHB,       PAGE = 0,       ALIGN(8)
//   .bss                : > RAMLS5,       PAGE = 1
   .bss                : >> RAMLS5 | RAMLS1,       PAGE = 1 // Added by MJT 8/11/2022
   .bss:output         : > RAMLS3,       PAGE = 0
   .bss:cio            : > RAMLS5,       PAGE = 1
   .data               : > RAMLS5 | RAMLS1 | RAMLS2,       PAGE = 1
   .sysmem             : > RAMLS5,       PAGE = 1
   /* Initalized sections go in Flash */
   .const              : > FLASHF,       PAGE = 0,       ALIGN(8)
#else
   .pinit              : > FLASHB,       PAGE = 0,       ALIGN(8)
   .ebss               : >> RAMLS5 | RAMLS1,    PAGE = 1
   .esysmem            : > RAMLS5,       PAGE = 1
   .cio                : > RAMLS5,       PAGE = 1
   /* Initalized sections go in Flash */
   .econst             : >> FLASHF      PAGE = 0, ALIGN(8)
#endif

   Filter_RegsFile     : > RAMGS0,	   PAGE = 1

   SHARERAMGS0		: > RAMGS0,		PAGE = 1
   SHARERAMGS1		: > RAMGS1,		PAGE = 1
   SHARERAMGS2		: > RAMGS2,		PAGE = 1
   ramgs0           : > RAMGS0,     PAGE = 1
   ramgs1           : > RAMGS1,     PAGE = 1

#ifdef __TI_COMPILER_VERSION__
    #if __TI_COMPILER_VERSION__ >= 15009000
        #if defined(__TI_EABI__)
            .TI.ramfunc : {} LOAD = FLASHD,
                                 RUN = RAMLS0,
                                 LOAD_START(RamfuncsLoadStart),
                                 LOAD_SIZE(RamfuncsLoadSize),
                                 LOAD_END(RamfuncsLoadEnd),
                                 RUN_START(RamfuncsRunStart),
                                 RUN_SIZE(RamfuncsRunSize),
                                 RUN_END(RamfuncsRunEnd),
                                 PAGE = 0, ALIGN(8)
        #else
            .TI.ramfunc : {} LOAD = FLASHD,
                             RUN = RAMLS0,
                             LOAD_START(_RamfuncsLoadStart),
                             LOAD_SIZE(_RamfuncsLoadSize),
                             LOAD_END(_RamfuncsLoadEnd),
                             RUN_START(_RamfuncsRunStart),
                             RUN_SIZE(_RamfuncsRunSize),
                             RUN_END(_RamfuncsRunEnd),
                             PAGE = 0, ALIGN(8)
        #endif
    #else
   ramfuncs            : LOAD = FLASHD,
                         RUN = RAMLS0,
                         LOAD_START(_RamfuncsLoadStart),
                         LOAD_SIZE(_RamfuncsLoadSize),
                         LOAD_END(_RamfuncsLoadEnd),
                         RUN_START(_RamfuncsRunStart),
                         RUN_SIZE(_RamfuncsRunSize),
                         RUN_END(_RamfuncsRunEnd),
                         PAGE = 0, ALIGN(8)
    #endif

#endif

   /* Flash Programming Buffer */
   BufferDataSection : > RAMD1, PAGE = 1, ALIGN(8)
   /* The following section definitions are required when using the IPC API Drivers */
    GROUP : > CPU1TOCPU2RAM, PAGE = 1
    {
        PUTBUFFER
        PUTWRITEIDX
        GETREADIDX
    }

    GROUP : > CPU2TOCPU1RAM, PAGE = 1
    {
        GETBUFFER :    TYPE = DSECT
        GETWRITEIDX :  TYPE = DSECT
        PUTREADIDX :   TYPE = DSECT
    }

   /* The following section definition are for SDFM examples */
//   Filter1_RegsFile : > RAMGS1,	PAGE = 1, fill=0x1111
//   Filter2_RegsFile : > RAMGS2,	PAGE = 1, fill=0x2222
//   Filter3_RegsFile : > RAMGS3,	PAGE = 1, fill=0x3333
//   Filter4_RegsFile : > RAMGS4,	PAGE = 1, fill=0x4444
//   Difference_RegsFile : > RAMGS5, 	PAGE = 1, fill=0x3333
// Commented out by MJT 8/11/2022

   // Added by MJT 8/11/2022
   AnalogSubsysRegsFile : > RAMGS0, PAGE = 1, fill=0x1111
   ClkCfgRegsFile : > RAMGS0 | RAMGS3, PAGE = 1, fill=0x1111
   CpuSysRegsFile : > RAMGS0 | RAMGS3, PAGE = 1, fill=0x1111
   CpuTimer0RegsFile : > RAMGS0, PAGE = 1, fill=0x1111
   CpuTimer1RegsFile : > RAMGS0 | RAMGS3, PAGE = 1, fill=0x1111
   CpuTimer2RegsFile : > RAMGS0 | RAMGS3, PAGE = 1, fill=0x1111
   DcsmZ1RegsFile : > RAMGS1, PAGE = 1, fill=0x1111
   DcsmZ2RegsFile : > RAMGS1, PAGE = 1, fill=0x1111
   DevCfgRegsFile : > RAMGS0 | RAMGS3, PAGE = 1, fill=0x1111
   Flash0CtrlRegsFile : > RAMGS0 | RAMGS3, PAGE = 1, fill=0x1111
   Flash0EccRegsFile : > RAMGS0 | RAMGS3, PAGE = 1, fill=0x1111
   FlashPumpSemaphoreRegsFile : > RAMGS0 | RAMGS3, PAGE = 1, fill=0x1111
   GpioCtrlRegsFile : > RAMGS0 | RAMGS3, PAGE = 1, fill=0x1111
   GpioDataRegsFile : > RAMGS0 | RAMGS3, PAGE = 1, fill=0x1111
   InputXbarRegsFile : > RAMGS1, PAGE = 1, fill=0x1111
   PieCtrlRegsFile : > RAMGS1, PAGE = 1, fill=0x1111
   PieVectTableFile : > RAMGS0, PAGE = 1, fill=0x1111
   SpibRegsFile : > RAMGS0, PAGE = 1, fill=0x1111
   WdRegsFile : > RAMGS0 | RAMGS3, PAGE = 1, fill=0x1111
}

/*
//===========================================================================
// End of file.
//===========================================================================
*/

Thanks,

- Matthew

  • Hi Matthew,

    Why do you have the peripheral RegsFile mapped to RAM memory. These contain actual peipheral registers and should be mapped to the corresponding perioheral memory space.

    You may use the F2837xD_Headers_nonBIOS_cpu1.cmd file from device_support/headers/cmd folder

    Regards,

    Veena

  • Thanks for your response.

    I excluded my .cmd file from build and added the one you suggested. But now I get several alarms! See below:

    - Matthew

  • Okay so I updated my original .cmd file with the RegsFile entries from F2837xD_Headers_nonBIOS_cpu1.cmd.

    My updated .cmd file is included below. Is there anything else I should adjust? Does it look correct now?

    MEMORY
    {
    PAGE 0 :  /* Program Memory */
              /* Memory (RAM/FLASH) blocks can be moved to PAGE1 for data allocation */
              /* BEGIN is used for the "boot to Flash" bootloader mode   */
    
       BEGIN           	: origin = 0x080000, length = 0x000002
       RAMLS0          	: origin = 0x008000, length = 0x000800
    
    
       RAMLS3      		: origin = 0x009800, length = 0x000800
       RAMLS4      		: origin = 0x00A000, length = 0x000800
       RAMGS14          : origin = 0x01A000, length = 0x001000     /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */
       RAMGS15          : origin = 0x01B000, length = 0x000FF8     /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */
    
    //   RAMGS15_RSVD     : origin = 0x01BFF8, length = 0x000008    /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */
    
       RESET           	: origin = 0x3FFFC0, length = 0x000002
    
       /* Flash sectors */
       FLASHA           : origin = 0x080002, length = 0x001FFE	/* on-chip Flash */
       FLASHB           : origin = 0x082000, length = 0x002000	/* on-chip Flash */
       FLASHC           : origin = 0x084000, length = 0x002000	/* on-chip Flash */
       FLASHD           : origin = 0x086000, length = 0x002000	/* on-chip Flash */
       FLASHE           : origin = 0x088000, length = 0x008000	/* on-chip Flash */
       FLASHF           : origin = 0x090000, length = 0x008000	/* on-chip Flash */
       FLASHG           : origin = 0x098000, length = 0x008000	/* on-chip Flash */
       FLASHH           : origin = 0x0A0000, length = 0x008000	/* on-chip Flash */
       FLASHI           : origin = 0x0A8000, length = 0x008000	/* on-chip Flash */
       FLASHJ           : origin = 0x0B0000, length = 0x008000	/* on-chip Flash */
       FLASHK           : origin = 0x0B8000, length = 0x002000	/* on-chip Flash */
       FLASHL           : origin = 0x0BA000, length = 0x002000	/* on-chip Flash */
       FLASHM           : origin = 0x0BC000, length = 0x002000	/* on-chip Flash */
       FLASHN           : origin = 0x0BE000, length = 0x001FF0	/* on-chip Flash */
    
    //   FLASHN_RSVD     : origin = 0x0BFFF0, length = 0x000010    /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */
    
    PAGE 1 : /* Data Memory */
             /* Memory (RAM/FLASH) blocks can be moved to PAGE0 for program allocation */
    
       ACCESSPROTECTION           : origin = 0x0005F4C0, length = 0x00000040
       ADCA                       : origin = 0x00007400, length = 0x00000080
       ADCB                       : origin = 0x00007480, length = 0x00000080
       ADCC                       : origin = 0x00007500, length = 0x00000080
       ADCD                       : origin = 0x00007580, length = 0x00000080
       ADCARESULT                 : origin = 0x00000B00, length = 0x00000018
       ADCBRESULT                 : origin = 0x00000B20, length = 0x00000018
       ADCCRESULT                 : origin = 0x00000B40, length = 0x00000018
       ADCDRESULT                 : origin = 0x00000B60, length = 0x00000018
       ANALOGSUBSYS               : origin = 0x0005D180, length = 0x00000048
       CANA                       : origin = 0x00048000, length = 0x00000200
       CANB                       : origin = 0x0004A000, length = 0x00000200
       CLA1                       : origin = 0x00001400, length = 0x00000080
       CLB1DATAEXCH               : origin = 0x00003200, length = 0x00000200
       CLB2DATAEXCH               : origin = 0x00003600, length = 0x00000200
       CLB3DATAEXCH               : origin = 0x00003A00, length = 0x00000200
       CLB4DATAEXCH               : origin = 0x00003E00, length = 0x00000200
       CLB1LOGICCFG               : origin = 0x00003000, length = 0x00000052
       CLB2LOGICCFG               : origin = 0x00003400, length = 0x00000052
       CLB3LOGICCFG               : origin = 0x00003800, length = 0x00000052
       CLB4LOGICCFG               : origin = 0x00003C00, length = 0x00000052
       CLB1LOGICCTRL              : origin = 0x00003100, length = 0x00000040
       CLB2LOGICCTRL              : origin = 0x00003500, length = 0x00000040
       CLB3LOGICCTRL              : origin = 0x00003900, length = 0x00000040
       CLB4LOGICCTRL              : origin = 0x00003D00, length = 0x00000040
       CLBXBAR                    : origin = 0x00007A40, length = 0x00000040
       CLKCFG                     : origin = 0x0005D200, length = 0x00000032
       CMPSS1                     : origin = 0x00005C80, length = 0x00000020
       CMPSS2                     : origin = 0x00005CA0, length = 0x00000020
       CMPSS3                     : origin = 0x00005CC0, length = 0x00000020
       CMPSS4                     : origin = 0x00005CE0, length = 0x00000020
       CMPSS5                     : origin = 0x00005D00, length = 0x00000020
       CMPSS6                     : origin = 0x00005D20, length = 0x00000020
       CMPSS7                     : origin = 0x00005D40, length = 0x00000020
       CMPSS8                     : origin = 0x00005D60, length = 0x00000020
       CPUTIMER0                  : origin = 0x00000C00, length = 0x00000008
       CPUTIMER1                  : origin = 0x00000C08, length = 0x00000008
       CPUTIMER2                  : origin = 0x00000C10, length = 0x00000008
       CPUSYS                     : origin = 0x0005D300, length = 0x00000082
       DACA                       : origin = 0x00005C00, length = 0x00000008
       DACB                       : origin = 0x00005C10, length = 0x00000008
       DACC                       : origin = 0x00005C20, length = 0x00000008
       DCSMCOMMON                 : origin = 0x0005F070, length = 0x00000008
       DCSMZ1                     : origin = 0x0005F000, length = 0x00000024
       DCSMZ2                     : origin = 0x0005F040, length = 0x00000024
       DEVCFG                     : origin = 0x0005D000, length = 0x0000012E
       DMACLASRCSEL               : origin = 0x00007980, length = 0x0000001A
       DMA                        : origin = 0x00001000, length = 0x00000200
       ECAP1                      : origin = 0x00005000, length = 0x00000020
       ECAP2                      : origin = 0x00005020, length = 0x00000020
       ECAP3                      : origin = 0x00005040, length = 0x00000020
       ECAP4                      : origin = 0x00005060, length = 0x00000020
       ECAP5                      : origin = 0x00005080, length = 0x00000020
       ECAP6                      : origin = 0x000050A0, length = 0x00000020
       EMIF1CONFIG                : origin = 0x0005F480, length = 0x00000020
       EMIF2CONFIG                : origin = 0x0005F4A0, length = 0x00000020
       EMIF1                      : origin = 0x00047000, length = 0x00000070
       EMIF2                      : origin = 0x00047800, length = 0x00000070
       EPWM1                      : origin = 0x00004000, length = 0x00000100
       EPWM2                      : origin = 0x00004100, length = 0x00000100
       EPWM3                      : origin = 0x00004200, length = 0x00000100
       EPWM4                      : origin = 0x00004300, length = 0x00000100
       EPWM5                      : origin = 0x00004400, length = 0x00000100
       EPWM6                      : origin = 0x00004500, length = 0x00000100
       EPWM7                      : origin = 0x00004600, length = 0x00000100
       EPWM8                      : origin = 0x00004700, length = 0x00000100
       EPWM9                      : origin = 0x00004800, length = 0x00000100
       EPWM10                     : origin = 0x00004900, length = 0x00000100
       EPWM11                     : origin = 0x00004A00, length = 0x00000100
       EPWM12                     : origin = 0x00004B00, length = 0x00000100
       EPWMXBAR                   : origin = 0x00007A00, length = 0x00000040
       EQEP1                      : origin = 0x00005100, length = 0x00000022
       EQEP2                      : origin = 0x00005140, length = 0x00000022
       EQEP3                      : origin = 0x00005180, length = 0x00000022
       FLASH0CTRL                 : origin = 0x0005F800, length = 0x00000182
       FLASH0ECC                  : origin = 0x0005FB00, length = 0x00000028
       FLASHPUMPSEMAPHORE         : origin = 0x00050024, length = 0x00000002
       GPIOCTRL                   : origin = 0x00007C00, length = 0x00000180
       GPIODATA                   : origin = 0x00007F00, length = 0x00000030
       I2CA                       : origin = 0x00007300, length = 0x00000022
       I2CB                       : origin = 0x00007340, length = 0x00000022
       INPUTXBAR                  : origin = 0x00007900, length = 0x00000020
       IPC                        : origin = 0x00050000, length = 0x00000024
       MEMORYERROR                : origin = 0x0005F500, length = 0x00000040
       MEMCFG                     : origin = 0x0005F400, length = 0x00000080
       MCBSPA                     : origin = 0x00006000, length = 0x00000024
       MCBSPB                     : origin = 0x00006040, length = 0x00000024
       NMIINTRUPT                 : origin = 0x00007060, length = 0x00000007
       OUTPUTXBAR                 : origin = 0x00007A80, length = 0x00000040
       PIECTRL                    : origin = 0x00000CE0, length = 0x0000001A
       PIEVECTTABLE               : origin = 0x00000D00, length = 0x00000200
       ROMPREFETCH                : origin = 0x0005E608, length = 0x00000002
       ROMWAITSTATE               : origin = 0x0005F540, length = 0x00000002
       SCIA                       : origin = 0x00007200, length = 0x00000010
       SCIB                       : origin = 0x00007210, length = 0x00000010
       SCIC                       : origin = 0x00007220, length = 0x00000010
       SCID                       : origin = 0x00007230, length = 0x00000010
       SDFM1                      : origin = 0x00005E00, length = 0x00000080
       SDFM2                      : origin = 0x00005E80, length = 0x00000080
       SPIA                       : origin = 0x00006100, length = 0x00000010
       SPIB                       : origin = 0x00006110, length = 0x00000010
       SPIC                       : origin = 0x00006120, length = 0x00000010
       SYNCSOC                    : origin = 0x00007940, length = 0x00000006
       UPP                        : origin = 0x00006200, length = 0x00000048
       WD                         : origin = 0x00007000, length = 0x0000002B
       XBAR                       : origin = 0x00007920, length = 0x00000020
       XINT                       : origin = 0x00007070, length = 0x0000000B
    
    
    
       BOOT_RSVD       : origin = 0x000002, length = 0x000121     /* Part of M0, BOOT rom will use this for stack */
       RAMM0           : origin = 0x000123, length = 0x0002DD
       RAMM1           : origin = 0x000400, length = 0x0003F8     /* on-chip RAM block M1 */
    //   RAMM1_RSVD      : origin = 0x0007F8, length = 0x000008     /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */
       RAMD0           : origin = 0x00B000, length = 0x000800
       RAMD1           : origin = 0x00B800, length = 0x000800
    
       RAMLS1      	   : origin = 0x008800, length = 0x000800
       RAMLS2     	   : origin = 0x009000, length = 0x000800
       RAMLS5      	   : origin = 0x00A800, length = 0x000800
    
       RAMGS0      : origin = 0x00C000, length = 0x001000
       RAMGS1      : origin = 0x00D000, length = 0x001000
       RAMGS2      : origin = 0x00E000, length = 0x001000
       RAMGS3      : origin = 0x00F000, length = 0x001000
       RAMGS4      : origin = 0x010000, length = 0x001000
       RAMGS5      : origin = 0x011000, length = 0x001000
       RAMGS6      : origin = 0x012000, length = 0x001000
       RAMGS7      : origin = 0x013000, length = 0x001000
       RAMGS8      : origin = 0x014000, length = 0x001000
       RAMGS9      : origin = 0x015000, length = 0x001000
       RAMGS10     : origin = 0x016000, length = 0x001000
    
    //   RAMGS11     : origin = 0x017000, length = 0x000FF8   /* Uncomment for F28374D, F28376D devices */
    
    //   RAMGS11_RSVD : origin = 0x017FF8, length = 0x000008    /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */
    
       RAMGS11     : origin = 0x017000, length = 0x001000     /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */
       RAMGS12     : origin = 0x018000, length = 0x001000     /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */
       RAMGS13     : origin = 0x019000, length = 0x001000     /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */
    
       CPU2TOCPU1RAM   : origin = 0x03F800, length = 0x000400
       CPU1TOCPU2RAM   : origin = 0x03FC00, length = 0x000400
    }
    
    SECTIONS
    {
       /* Allocate program areas: */
       .cinit              : > FLASHB | FLASHG     PAGE = 0, ALIGN(8) // Added by MJT 6/16/2022
    // .cinit              : > FLASHB     PAGE = 0, ALIGN(8)
       .text               : >> FLASHB | FLASHC | FLASHD | FLASHE      PAGE = 0, ALIGN(8)
       codestart           : > BEGIN       PAGE = 0, ALIGN(8)
       /* Allocate uninitalized data sections: */
       .stack              : > RAMM1 | RAMM0 | RAMD0       PAGE = 1
       .switch             : > FLASHB      PAGE = 0, ALIGN(8)
       .reset              : > RESET,      PAGE = 0, TYPE = DSECT /* not used, */
    
    #if defined(__TI_EABI__)
       .init_array         : > FLASHB,       PAGE = 0,       ALIGN(8)
    //   .bss                : > RAMLS5,       PAGE = 1
       .bss                : >> RAMLS5 | RAMLS1,       PAGE = 1 // Added by MJT 8/11/2022
       .bss:output         : > RAMLS3,       PAGE = 0
       .bss:cio            : > RAMLS5,       PAGE = 1
       .data               : > RAMLS5 | RAMLS1 | RAMLS2,       PAGE = 1
       .sysmem             : > RAMLS5,       PAGE = 1
       /* Initalized sections go in Flash */
       .const              : > FLASHF,       PAGE = 0,       ALIGN(8)
    #else
       .pinit              : > FLASHB,       PAGE = 0,       ALIGN(8)
       .ebss               : >> RAMLS5 | RAMLS1,    PAGE = 1
       .esysmem            : > RAMLS5,       PAGE = 1
       .cio                : > RAMLS5,       PAGE = 1
       /* Initalized sections go in Flash */
       .econst             : >> FLASHF      PAGE = 0, ALIGN(8)
    #endif
    
       Filter_RegsFile     : > RAMGS0,	   PAGE = 1
    
       SHARERAMGS0		: > RAMGS0,		PAGE = 1
       SHARERAMGS1		: > RAMGS1,		PAGE = 1
       SHARERAMGS2		: > RAMGS2,		PAGE = 1
       ramgs0           : > RAMGS0,     PAGE = 1
       ramgs1           : > RAMGS1,     PAGE = 1
    
    #ifdef __TI_COMPILER_VERSION__
        #if __TI_COMPILER_VERSION__ >= 15009000
            #if defined(__TI_EABI__)
                .TI.ramfunc : {} LOAD = FLASHD,
                                     RUN = RAMLS0,
                                     LOAD_START(RamfuncsLoadStart),
                                     LOAD_SIZE(RamfuncsLoadSize),
                                     LOAD_END(RamfuncsLoadEnd),
                                     RUN_START(RamfuncsRunStart),
                                     RUN_SIZE(RamfuncsRunSize),
                                     RUN_END(RamfuncsRunEnd),
                                     PAGE = 0, ALIGN(8)
            #else
                .TI.ramfunc : {} LOAD = FLASHD,
                                 RUN = RAMLS0,
                                 LOAD_START(_RamfuncsLoadStart),
                                 LOAD_SIZE(_RamfuncsLoadSize),
                                 LOAD_END(_RamfuncsLoadEnd),
                                 RUN_START(_RamfuncsRunStart),
                                 RUN_SIZE(_RamfuncsRunSize),
                                 RUN_END(_RamfuncsRunEnd),
                                 PAGE = 0, ALIGN(8)
            #endif
        #else
       ramfuncs            : LOAD = FLASHD,
                             RUN = RAMLS0,
                             LOAD_START(_RamfuncsLoadStart),
                             LOAD_SIZE(_RamfuncsLoadSize),
                             LOAD_END(_RamfuncsLoadEnd),
                             RUN_START(_RamfuncsRunStart),
                             RUN_SIZE(_RamfuncsRunSize),
                             RUN_END(_RamfuncsRunEnd),
                             PAGE = 0, ALIGN(8)
        #endif
    
    #endif
    
       /* Flash Programming Buffer */
       BufferDataSection : > RAMD1, PAGE = 1, ALIGN(8)
       /* The following section definitions are required when using the IPC API Drivers */
        GROUP : > CPU1TOCPU2RAM, PAGE = 1
        {
            PUTBUFFER
            PUTWRITEIDX
            GETREADIDX
        }
    
        GROUP : > CPU2TOCPU1RAM, PAGE = 1
        {
            GETBUFFER :    TYPE = DSECT
            GETWRITEIDX :  TYPE = DSECT
            PUTREADIDX :   TYPE = DSECT
        }
    
       /* The following section definition are for SDFM examples */
    //   Filter1_RegsFile : > RAMGS1,	PAGE = 1, fill=0x1111
    //   Filter2_RegsFile : > RAMGS2,	PAGE = 1, fill=0x2222
    //   Filter3_RegsFile : > RAMGS3,	PAGE = 1, fill=0x3333
    //   Filter4_RegsFile : > RAMGS4,	PAGE = 1, fill=0x4444
    //   Difference_RegsFile : > RAMGS5, 	PAGE = 1, fill=0x3333
    // Commented out by MJT 8/11/2022
    
    
    /*
       // Added by MJT 8/11/2022
       AnalogSubsysRegsFile : > RAMGS0, PAGE = 1, fill=0x1111
       ClkCfgRegsFile : > RAMGS0 | RAMGS3, PAGE = 1, fill=0x1111
       CpuSysRegsFile : > RAMGS0 | RAMGS3, PAGE = 1, fill=0x1111
       CpuTimer0RegsFile : > RAMGS0, PAGE = 1, fill=0x1111
       CpuTimer1RegsFile : > RAMGS0 | RAMGS3, PAGE = 1, fill=0x1111
       CpuTimer2RegsFile : > RAMGS0 | RAMGS3, PAGE = 1, fill=0x1111
       DcsmZ1RegsFile : > RAMGS1, PAGE = 1, fill=0x1111
       DcsmZ2RegsFile : > RAMGS1, PAGE = 1, fill=0x1111
       DevCfgRegsFile : > RAMGS0 | RAMGS3, PAGE = 1, fill=0x1111
       Flash0CtrlRegsFile : > RAMGS0 | RAMGS3, PAGE = 1, fill=0x1111
       Flash0EccRegsFile : > RAMGS0 | RAMGS3, PAGE = 1, fill=0x1111
       FlashPumpSemaphoreRegsFile : > RAMGS0 | RAMGS3, PAGE = 1, fill=0x1111
       GpioCtrlRegsFile : > RAMGS0 | RAMGS3, PAGE = 1, fill=0x1111
       GpioDataRegsFile : > RAMGS0 | RAMGS3, PAGE = 1, fill=0x1111
       InputXbarRegsFile : > RAMGS1, PAGE = 1, fill=0x1111
       PieCtrlRegsFile : > RAMGS1, PAGE = 1, fill=0x1111
       PieVectTableFile : > RAMGS0, PAGE = 1, fill=0x1111
       SpibRegsFile : > RAMGS0, PAGE = 1, fill=0x1111
       WdRegsFile : > RAMGS0 | RAMGS3, PAGE = 1, fill=0x1111
    */
    
       AccessProtectionRegsFile   : > ACCESSPROTECTION, type=NOINIT
       AdcaRegsFile               : > ADCA, type=NOINIT
       AdcbRegsFile               : > ADCB, type=NOINIT
       AdccRegsFile               : > ADCC, type=NOINIT
       AdcdRegsFile               : > ADCD, type=NOINIT
       AdcaResultRegsFile         : > ADCARESULT, type=NOINIT
       AdcbResultRegsFile         : > ADCBRESULT, type=NOINIT
       AdccResultRegsFile         : > ADCCRESULT, type=NOINIT
       AdcdResultRegsFile         : > ADCDRESULT, type=NOINIT
       AnalogSubsysRegsFile       : > ANALOGSUBSYS, type=NOINIT
       CanaRegsFile               : > CANA, type=NOINIT
       CanbRegsFile               : > CANB, type=NOINIT
       Cla1RegsFile               : > CLA1, type=NOINIT
       Clb1DataExchRegsFile       : > CLB1DATAEXCH, type=NOINIT
       Clb2DataExchRegsFile       : > CLB2DATAEXCH, type=NOINIT
       Clb3DataExchRegsFile       : > CLB3DATAEXCH, type=NOINIT
       Clb4DataExchRegsFile       : > CLB4DATAEXCH, type=NOINIT
       Clb1LogicCfgRegsFile       : > CLB1LOGICCFG, type=NOINIT
       Clb2LogicCfgRegsFile       : > CLB2LOGICCFG, type=NOINIT
       Clb3LogicCfgRegsFile       : > CLB3LOGICCFG, type=NOINIT
       Clb4LogicCfgRegsFile       : > CLB4LOGICCFG, type=NOINIT
       Clb1LogicCtrlRegsFile      : > CLB1LOGICCTRL, type=NOINIT
       Clb2LogicCtrlRegsFile      : > CLB2LOGICCTRL, type=NOINIT
       Clb3LogicCtrlRegsFile      : > CLB3LOGICCTRL, type=NOINIT
       Clb4LogicCtrlRegsFile      : > CLB4LOGICCTRL, type=NOINIT
       ClbXbarRegsFile            : > CLBXBAR, type=NOINIT
       ClkCfgRegsFile             : > CLKCFG, type=NOINIT
       Cmpss1RegsFile             : > CMPSS1, type=NOINIT
       Cmpss2RegsFile             : > CMPSS2, type=NOINIT
       Cmpss3RegsFile             : > CMPSS3, type=NOINIT
       Cmpss4RegsFile             : > CMPSS4, type=NOINIT
       Cmpss5RegsFile             : > CMPSS5, type=NOINIT
       Cmpss6RegsFile             : > CMPSS6, type=NOINIT
       Cmpss7RegsFile             : > CMPSS7, type=NOINIT
       Cmpss8RegsFile             : > CMPSS8, type=NOINIT
       CpuTimer0RegsFile          : > CPUTIMER0, type=NOINIT
       CpuTimer1RegsFile          : > CPUTIMER1, type=NOINIT
       CpuTimer2RegsFile          : > CPUTIMER2, type=NOINIT
       CpuSysRegsFile             : > CPUSYS, type=NOINIT
       DacaRegsFile               : > DACA, type=NOINIT
       DacbRegsFile               : > DACB, type=NOINIT
       DaccRegsFile               : > DACC, type=NOINIT
       DcsmCommonRegsFile         : > DCSMCOMMON, type=NOINIT
       DcsmZ1RegsFile             : > DCSMZ1, type=NOINIT
       DcsmZ2RegsFile             : > DCSMZ2, type=NOINIT
       DevCfgRegsFile             : > DEVCFG, type=NOINIT
       DmaClaSrcSelRegsFile       : > DMACLASRCSEL, type=NOINIT
       DmaRegsFile                : > DMA, type=NOINIT
       ECap1RegsFile              : > ECAP1, type=NOINIT
       ECap2RegsFile              : > ECAP2, type=NOINIT
       ECap3RegsFile              : > ECAP3, type=NOINIT
       ECap4RegsFile              : > ECAP4, type=NOINIT
       ECap5RegsFile              : > ECAP5, type=NOINIT
       ECap6RegsFile              : > ECAP6, type=NOINIT
       Emif1ConfigRegsFile        : > EMIF1CONFIG, type=NOINIT
       Emif2ConfigRegsFile        : > EMIF2CONFIG, type=NOINIT
       Emif1RegsFile              : > EMIF1, type=NOINIT
       Emif2RegsFile              : > EMIF2, type=NOINIT
       EPwm1RegsFile              : > EPWM1, type=NOINIT
       EPwm2RegsFile              : > EPWM2, type=NOINIT
       EPwm3RegsFile              : > EPWM3, type=NOINIT
       EPwm4RegsFile              : > EPWM4, type=NOINIT
       EPwm5RegsFile              : > EPWM5, type=NOINIT
       EPwm6RegsFile              : > EPWM6, type=NOINIT
       EPwm7RegsFile              : > EPWM7, type=NOINIT
       EPwm8RegsFile              : > EPWM8, type=NOINIT
       EPwm9RegsFile              : > EPWM9, type=NOINIT
       EPwm10RegsFile             : > EPWM10, type=NOINIT
       EPwm11RegsFile             : > EPWM11, type=NOINIT
       EPwm12RegsFile             : > EPWM12, type=NOINIT
       EPwmXbarRegsFile           : > EPWMXBAR, type=NOINIT
       EQep1RegsFile              : > EQEP1, type=NOINIT
       EQep2RegsFile              : > EQEP2, type=NOINIT
       EQep3RegsFile              : > EQEP3, type=NOINIT
       Flash0CtrlRegsFile         : > FLASH0CTRL, type=NOINIT
       Flash0EccRegsFile          : > FLASH0ECC, type=NOINIT
       FlashPumpSemaphoreRegsFile : > FLASHPUMPSEMAPHORE, type=NOINIT
       GpioCtrlRegsFile           : > GPIOCTRL, type=NOINIT
       GpioDataRegsFile           : > GPIODATA, type=NOINIT
       I2caRegsFile               : > I2CA, type=NOINIT
       I2cbRegsFile               : > I2CB, type=NOINIT
       InputXbarRegsFile          : > INPUTXBAR, type=NOINIT
       IpcRegsFile                : > IPC, type=NOINIT
       MemoryErrorRegsFile        : > MEMORYERROR, type=NOINIT
       MemCfgRegsFile             : > MEMCFG, type=NOINIT
       McbspaRegsFile             : > MCBSPA, type=NOINIT
       McbspbRegsFile             : > MCBSPB, type=NOINIT
       NmiIntruptRegsFile         : > NMIINTRUPT, type=NOINIT
       OutputXbarRegsFile         : > OUTPUTXBAR, type=NOINIT
       PieCtrlRegsFile            : > PIECTRL, type=NOINIT
       PieVectTableFile           : > PIEVECTTABLE, type=NOINIT
       RomPrefetchRegsFile        : > ROMPREFETCH, type=NOINIT
       RomWaitStateRegsFile       : > ROMWAITSTATE, type=NOINIT
       SciaRegsFile               : > SCIA, type=NOINIT
       ScibRegsFile               : > SCIB, type=NOINIT
       ScicRegsFile               : > SCIC, type=NOINIT
       ScidRegsFile               : > SCID, type=NOINIT
       Sdfm1RegsFile              : > SDFM1, type=NOINIT
       Sdfm2RegsFile              : > SDFM2, type=NOINIT
       SpiaRegsFile               : > SPIA, type=NOINIT
       SpibRegsFile               : > SPIB, type=NOINIT
       SpicRegsFile               : > SPIC, type=NOINIT
       SyncSocRegsFile            : > SYNCSOC, type=NOINIT
       UppRegsFile                : > UPP, type=NOINIT
       WdRegsFile                 : > WD, type=NOINIT
       XbarRegsFile               : > XBAR, type=NOINIT
       XintRegsFile               : > XINT, type=NOINIT
    
    }
    
    /*
    //===========================================================================
    // End of file.
    //===========================================================================
    */
    

  • You can have 2 cmd files in one project. You can use the F2837xD_Headers_nonBIOS_cpu1.cmd as-is for all the peripheral registers, and the normal lnk cmd with RAM and Flash memories to allocate the code and data sections

    Please refer to the examples provided in C2000ware

    Regards,

    Veena

  • Ok thanks. I have included both cmd files in my project. The program runs, but when I step through the program after hitting a breakpoint It says "No source available for 'SysCtl_delay() at C:/Users\........'" as shown below:

    I get the same message if I pause the debugger.

    Here is my updated cmd file. I removed all instances where a x_RegsFile was mapped to RAM.

    /*
    
    Welcome to the linker command (.cmd) file!
    This file tells the linker how to place the software into the hardware.
    
    Some useful resources about the linker command file can be found here:
    	https://software-dl.ti.com/ccs/esd/documents/sdto_cgt_Linker-Command-File-Primer.html
    	https://software-dl.ti.com/ccs/esd/documents/c2000_c28x-compiler-understanding-linking.html
    
    The linker command file has two basic parts: Memory Map Description, and Sections Description.
    
    The purpose of the MEMORY directive is to assign names to ranges of memory. It tells the linker
    what memory blocks are available. It defines the memory block name, memory block location, and
    size of the memory block. The memory range names are used in the SECTIONS directive.
    
    The SECTIONS directive does several things. It tells the linker which software sections should
    be allocated to which memory regions; allows you to allocate to memory on a per-file basis; allows
    for separate load and run locations; forms output sections from input sections; and allocates those
    output sections to memory.
    
    */
    
    MEMORY
    {
    PAGE 0 :  /* Program Memory */
              /* Memory (RAM/FLASH) blocks can be moved to PAGE1 for data allocation. It is best to
              	 place code and the data it accesses separate blocks. Take care to not define the
              	 same memory address range in both program and data space! Doing so may cause your
              	 data to corrupt program or vice versa. */
    
       /* BEGIN is used for the "boot to Flash" bootloader mode   */
       BEGIN           	: origin = 0x080000, length = 0x000002
       RAMLS0          	: origin = 0x008000, length = 0x000800
    
    
       RAMLS3      		: origin = 0x009800, length = 0x000800
       RAMLS4      		: origin = 0x00A000, length = 0x000800
       RAMGS14          : origin = 0x01A000, length = 0x001000     /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */
       RAMGS15          : origin = 0x01B000, length = 0x000FF8     /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */
    
    //   RAMGS15_RSVD     : origin = 0x01BFF8, length = 0x000008    /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */
    
       RESET           	: origin = 0x3FFFC0, length = 0x000002
    
       /* Flash sectors */
       FLASHA           : origin = 0x080002, length = 0x001FFE	/* on-chip Flash */
       FLASHB           : origin = 0x082000, length = 0x002000	/* on-chip Flash */
       FLASHC           : origin = 0x084000, length = 0x002000	/* on-chip Flash */
       FLASHD           : origin = 0x086000, length = 0x002000	/* on-chip Flash */
       FLASHE           : origin = 0x088000, length = 0x008000	/* on-chip Flash */
       FLASHF           : origin = 0x090000, length = 0x008000	/* on-chip Flash */
       FLASHG           : origin = 0x098000, length = 0x008000	/* on-chip Flash */
       FLASHH           : origin = 0x0A0000, length = 0x008000	/* on-chip Flash */
       FLASHI           : origin = 0x0A8000, length = 0x008000	/* on-chip Flash */
       FLASHJ           : origin = 0x0B0000, length = 0x008000	/* on-chip Flash */
       FLASHK           : origin = 0x0B8000, length = 0x002000	/* on-chip Flash */
       FLASHL           : origin = 0x0BA000, length = 0x002000	/* on-chip Flash */
       FLASHM           : origin = 0x0BC000, length = 0x002000	/* on-chip Flash */
       FLASHN           : origin = 0x0BE000, length = 0x001FF0	/* on-chip Flash */
    
    //   FLASHN_RSVD     : origin = 0x0BFFF0, length = 0x000010    /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */
    
    PAGE 1 : /* Data Memory */
             /* Memory (RAM/FLASH) blocks can be moved to PAGE0 for program allocation. It is best to
              	 place code and the data it accesses separate blocks. Take care to not define the
              	 same memory address range in both program and data space! Doing so may cause your
              	 data to corrupt program or vice versa. */
    
       BOOT_RSVD       : origin = 0x000002, length = 0x000121     /* Part of M0, BOOT rom will use this for stack */
       RAMM0           : origin = 0x000123, length = 0x0002DD
       RAMM1           : origin = 0x000400, length = 0x0003F8     /* on-chip RAM block M1 */
    //   RAMM1_RSVD      : origin = 0x0007F8, length = 0x000008     /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */
       RAMD0           : origin = 0x00B000, length = 0x000800
       RAMD1           : origin = 0x00B800, length = 0x000800
    
       RAMLS1      	   : origin = 0x008800, length = 0x000800
       RAMLS2     	   : origin = 0x009000, length = 0x000800
       RAMLS5      	   : origin = 0x00A800, length = 0x000800
    
       RAMGS0      : origin = 0x00C000, length = 0x001000
       RAMGS1      : origin = 0x00D000, length = 0x001000
       RAMGS2      : origin = 0x00E000, length = 0x001000
       RAMGS3      : origin = 0x00F000, length = 0x001000
       RAMGS4      : origin = 0x010000, length = 0x001000
       RAMGS5      : origin = 0x011000, length = 0x001000
       RAMGS6      : origin = 0x012000, length = 0x001000
       RAMGS7      : origin = 0x013000, length = 0x001000
       RAMGS8      : origin = 0x014000, length = 0x001000
       RAMGS9      : origin = 0x015000, length = 0x001000
       RAMGS10     : origin = 0x016000, length = 0x001000
    
    //   RAMGS11     : origin = 0x017000, length = 0x000FF8   /* Uncomment for F28374D, F28376D devices */
    
    //   RAMGS11_RSVD : origin = 0x017FF8, length = 0x000008    /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */
    
       RAMGS11     : origin = 0x017000, length = 0x001000     /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */
       RAMGS12     : origin = 0x018000, length = 0x001000     /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */
       RAMGS13     : origin = 0x019000, length = 0x001000     /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */
    
       CPU2TOCPU1RAM   : origin = 0x03F800, length = 0x000400
       CPU1TOCPU2RAM   : origin = 0x03FC00, length = 0x000400
    }
    
    /* ============================================================================ */
    
    SECTIONS
    {
       /* Allocate program areas: */
       .cinit              : > FLASHB | FLASHG     PAGE = 0, ALIGN(8) // Added by MJT 6/16/2022
    // .cinit              : > FLASHB     PAGE = 0, ALIGN(8)
       .text               : >> FLASHB | FLASHC | FLASHD | FLASHE      PAGE = 0, ALIGN(8)
       codestart           : > BEGIN       PAGE = 0, ALIGN(8)
       /* Allocate uninitalized data sections: */
       .stack              : > RAMM1 | RAMM0 | RAMD0       PAGE = 1
       .switch             : > FLASHB      PAGE = 0, ALIGN(8)
       .reset              : > RESET,      PAGE = 0, TYPE = DSECT /* not used, */
    
    #if defined(__TI_EABI__)
       .init_array         : > FLASHB,       PAGE = 0,       ALIGN(8)
    //   .bss                : > RAMLS5,       PAGE = 1
       .bss                : >> RAMLS5 | RAMLS1,       PAGE = 1 // Added by MJT 8/11/2022
       .bss:output         : > RAMLS3,       PAGE = 0
       .bss:cio            : > RAMLS5,       PAGE = 1
       .data               : >> RAMLS5 | RAMLS1 | RAMLS2,       PAGE = 1
       /* malloc heap */
       .sysmem             : > RAMLS5,       PAGE = 1
       /* Initalized sections go in Flash */
       .const              : > FLASHF,       PAGE = 0,       ALIGN(8)
    #else
       .pinit              : > FLASHB,       PAGE = 0,       ALIGN(8)
       .ebss               : >> RAMLS5 | RAMLS1,    PAGE = 1
       /* malloc heap */
       .esysmem            : > RAMLS5,       PAGE = 1
       .cio                : > RAMLS5,       PAGE = 1
       /* Initalized sections go in Flash */
       .econst             : > FLASHF      PAGE = 0, ALIGN(8)
    #endif
    
       //Filter_RegsFile     : > RAMGS0,	   PAGE = 1
    
       SHARERAMGS0		   : > RAMGS0,		PAGE = 1
       SHARERAMGS1		   : > RAMGS1,		PAGE = 1
       SHARERAMGS2		   : > RAMGS2,		PAGE = 1
       ramgs0              : > RAMGS0,     PAGE = 1
       ramgs1              : > RAMGS1,     PAGE = 1
    
    /*
    
    This creates an output section named .TI.ramfuncs. It is composed of all the input sections also named .TI.ramfuncs.
    It has two different allocations. It is allocated to FLASHD for loading, and RAMLS0 for running. This output section
    is placed in the output file so that, when the program is loaded (which is probably implemented by programming it into
    flash memory), it is in the FLASHD memory range. Sometime during system execution, before anything in .TI.ramfuncs
    is used, the application copies it from FLASHD to RAMLS0.
    
    This is necessary for Flash API functions since they must reside in RAM.
    
    */
    
    #ifdef __TI_COMPILER_VERSION__
        #if __TI_COMPILER_VERSION__ >= 15009000
            #if defined(__TI_EABI__)
                .TI.ramfunc : {} LOAD = FLASHD,
                                 RUN = RAMLS0,
                                 LOAD_START(RamfuncsLoadStart),
                                 LOAD_SIZE(RamfuncsLoadSize),
                                 LOAD_END(RamfuncsLoadEnd),
                                 RUN_START(RamfuncsRunStart),
                                 RUN_SIZE(RamfuncsRunSize),
                                 RUN_END(RamfuncsRunEnd),
                                 PAGE = 0, ALIGN(8)
            #else
                .TI.ramfunc : {} LOAD = FLASHD,
                                 RUN = RAMLS0,
                                 LOAD_START(_RamfuncsLoadStart),
                                 LOAD_SIZE(_RamfuncsLoadSize),
                                 LOAD_END(_RamfuncsLoadEnd),
                                 RUN_START(_RamfuncsRunStart),
                                 RUN_SIZE(_RamfuncsRunSize),
                                 RUN_END(_RamfuncsRunEnd),
                                 PAGE = 0, ALIGN(8)
            #endif
        #else
       ramfuncs            : LOAD = FLASHD,
                             RUN = RAMLS0,
                             LOAD_START(_RamfuncsLoadStart),
                             LOAD_SIZE(_RamfuncsLoadSize),
                             LOAD_END(_RamfuncsLoadEnd),
                             RUN_START(_RamfuncsRunStart),
                             RUN_SIZE(_RamfuncsRunSize),
                             RUN_END(_RamfuncsRunEnd),
                             PAGE = 0, ALIGN(8)
        #endif
    
    #endif
    
       /* Flash Programming Buffer */
       BufferDataSection   : > RAMD1, PAGE = 1, ALIGN(8)
    
       /* The following section definitions are required when using the IPC API Drivers. */
    
        GROUP : > CPU1TOCPU2RAM, PAGE = 1
        {
        	/* These output sections will be allocated to the CPU1TOCPU2RAM memory range as a group in this exact order. */
            PUTBUFFER
            PUTWRITEIDX
            GETREADIDX
        }
    
        GROUP : > CPU2TOCPU1RAM, PAGE = 1
        {
        	/* The syntax TYPE = DSECT makes this output section a dummy section.
        	A dummy section takes up no space in memory, and is not present in the output file. */
            GETBUFFER :    TYPE = DSECT
            GETWRITEIDX :  TYPE = DSECT
            PUTREADIDX :   TYPE = DSECT
        }
    
       /* The following section definition are for SDFM examples */
    //   Filter1_RegsFile : > RAMGS1,	PAGE = 1, fill=0x1111
    //   Filter2_RegsFile : > RAMGS2,	PAGE = 1, fill=0x2222
    //   Filter3_RegsFile : > RAMGS3,	PAGE = 1, fill=0x3333
    //   Filter4_RegsFile : > RAMGS4,	PAGE = 1, fill=0x4444
    //   Difference_RegsFile : > RAMGS5, 	PAGE = 1, fill=0x3333
    // Commented out by MJT 8/11/2022
    
    }
    
    /*
    //===========================================================================
    // End of file.
    //===========================================================================
    */
    

    Do I need something else?

    Thanks,

    - Matthew

  • Hi Matthew,

    That is okay, The function is written in assembly. You can view it through the disassembly window

    Regards,

    Veena

  • Thanks.

    After implementing your changes my code was running properly until I added the pow() function from math.h into my program. Now when I start the debugger and click run, I get this error:

    The program does not run. This is the same issue that was happening originally, but with a different function. But now, using the pow() function causes the program to crash. If I comment out the line where pow() is used, the program runs successfully.

    Please advise.

    Thanks,

    - Matthew

  • This means your the core has reset, and is stuck somewhere in the BootROM code.

    Do you see this issue before reaching main, or while executing the pow function?

    Regards,

    Veena

  • I think I found the problem. I stepped through main() and I found that the program crashed when executing line 72 (which was not commented out at the time). I accidentally typed 200 for the clock frequency rather than 200 MHz! To fix this user error, I included device.h (which defines DEVICE_SYSCLK_FREQ) and adjusted line 71-72 as shown in the screenshot and the program stopped crashing. 

    Why this issue only surfaced when using the pow() function is a mystery to me. Any thoughts?

    Thanks for your help. The solution is often simpler than it seems!

    - Matthew

  • Hi Matthew,

    I checked with the FlashAPI expert  and he mentioned the parameter should be in MHz. So 200 is the correct value to be used. 

    Also I cant think of any reason why usage of pow() function is affecting FlashAPI function behavior

    Regards,

    Veena

  • Hi Veena,

    Thanks for your continued support. Unfortunately, I am still having issues.

    Here's a summary of my experiences:

    • With a frequency of 200 passed to Fapi_initializeAPI() my program crashes on that line, but if I comment out the pow() function which I'm using elsewhere, the program does not crash.
    • If I leave the pow() function in the program (uncommented) but a frequency of 200000000 passed to Fapi_initializeAPI() the program runs, but the Flash is not written!
    • Similarly, if I use a frequency of 200000000 in Fapi_initializeAPI() with pow() commented, the flash does not write.
    • If I use 200 as a frequency and comment out the pow() function the program runs and Flash writes successfully. What's going on?

    I don't understand why the pow() function would have an effect on the Flash API. I need to use both in my program, so I hope we can find a permanent solution. Are there any known bugs with math.h or pow() that I might be introducing to my program inadvertently? Could this still be a linker command file issue?

    Thank you for your help, and I am looking forward to resolving this,

    - Matthew

  • Hi Matthew,

    The only correlation I can think of is, while using pow() function, there could be additional set of functions are constants that would be allocated to Flash. By any chance is it getting allocated to the same sector where FAPI is writing to?

    I believe you are running Flash API functions from RAM?

    Regards,

    Veena

  • Hi Veena,

    I am writing to sector H in Flash. How can I tell where those constants are being allocated? Is there a way to protect a certain sector from being used by anything other than the Flash API?

    I believe I am running Flash API functions from RAM, but how can I be sure that all the API functions are executing from RAM? I precede all my user-defined functions with 

    #pragma CODE_SECTION(function_name, ".TI.ramfunc");

    I understand that the linker command file puts all the input sections named .TI.ramfunc into RAM, and using the #pragma statement above assigns functions to the .TI.ramfunc section. I see in flash.h that some functions are assigned to .TI.ramfunc as shown here: 

    But I see that most functions in flash.h do not have a #pragma statement before them, such as this function:

    Should those functions also have the #pragma statement before them? How can I know if these functions are getting moved to RAM? Also there are Flash API functions in F021.h for which I cannot find the source file to see if there is a #pragma statement. How can I know if those functions are getting moved to RAM? I think their source file is part of F021_API_F2837xD_FPU32_EABI.lib which is not human readable.

    Thanks for your continued support.

    - Matthew

  • I also discovered something else.

    I added the #pragma statement before the function that calls the pow() function as shown below.

    Now, calculate_duty() (the only function that calls pow() ) is executed from RAM, and the program runs without crashing and the Flash writes successfully. Any thoughts?

    - Matthew

  • Hi Matthew,

    You may need to place the entire FAPI library in RAM. You can do it using this command in linker cmd file - 

    (change the memory blocks as needed)

            GROUP
            {
                .TI.ramfunc
                { -l F021_API_F2837xD_FPU32.lib}
    
            } LOAD = FLASHD,
              RUN  = RAMLS03,
              LOAD_START(_RamfuncsLoadStart),
              LOAD_SIZE(_RamfuncsLoadSize),
              LOAD_END(_RamfuncsLoadEnd),
              RUN_START(_RamfuncsRunStart),
              RUN_SIZE(_RamfuncsRunSize),
              RUN_END(_RamfuncsRunEnd),
              PAGE = 0
     
    In case of Flash driver, those specific functions that need to be run from RAM is placed in ramfunc section using the pragma
    Regards,
    Veena
  • Hi Veena,

    I found another issue with my linker cmd file that I think was causing the problem. I had the following line in my SECTIONS directive:

    .text               : >> FLASHB | FLASHC | FLASHD | FLASHE      PAGE = 0, ALIGN(8)

    Notice that I am using the double arrow ">>" operator to split the .text section across Flash sectors B-E. The reason the Flash API functions were causing the PC to jump to an illegal address is because the Flash API functions are loaded into FLASHD and then run from RAM as shown here:

    .TI.ramfunc : {} LOAD = FLASHD,
                     RUN = RAMLS0,
                     LOAD_START(RamfuncsLoadStart),
                     LOAD_SIZE(RamfuncsLoadSize),
                     LOAD_END(RamfuncsLoadEnd),
                     RUN_START(RamfuncsRunStart),
                     RUN_SIZE(RamfuncsRunSize),
                     RUN_END(RamfuncsRunEnd),
                     PAGE = 0, ALIGN(8)

    Because .text was also using FLASHD, when FLASHD was copied to RAM the .text section became corrupted because its contents were shared across Flash sections. 

    I removed FLASHD from the .text section as shown below and my program has been running smoothly since.

    .text               : >> FLASHB | FLASHC | FLASHE      PAGE = 0, ALIGN(8)

    I will let you know if the problem returns.

    Thanks again,

    - Matthew

  • Hello all,

    Unfortunately, the problem has returned. I added the following code:

    Note, I've had that function in my program for a couple months, but I just changed the equation and added all the floats today and that's when the problem came back.

    I'm getting this error when I try to run my program in debug mode:

    I'm getting frustrated that this problem keeps returning.

    I hope we can get to the bottom of this.

    - Matthew

  • It seems like the device has reset. Can you step through the code and check which line actually caused the reset?

    I hope float_support is set to fpu32 under compiler settings

    Regards,

    Veena

  • Hi Veena,

    When I step through the code, it crashes on line 86:

    Seems like trouble with the Flash API again.

    Also float_support was set to fpu64, and when I changed it to fpu32 I got more errors as shown below:

    I'm not sure what those errors mean, so I reverted back to fpu64.

    I took your advice by moving the entire FAPI library into RAM, and my program runs! But I just have this warning now:

    - Matthew

  • Update, I added the following after GROUP and the warning went away:

    FLASHIJ is my combination of FLASHI and FLASHJ into one big sector.

    Just remember to assign the GROUP to Flash memory. I tried using RAM here, but it caused the program to crash after a power cycle because RAM is volatile. I changed it from RAM to Flash and now it runs correctly.

    - Matthew

  • Hi Matthew,

    Ramfuncs is meant to be run from RAM. The correct setting is as follows -

    GROUP
    {
    .TI.ramfunc
    { -l FAPI_F28003x_EABI_v1.58.10.lib}

    } LOAD = FLASH_BANK0_SEC1,
    RUN = RAMLS03,
    LOAD_START(RamfuncsLoadStart),
    LOAD_SIZE(RamfuncsLoadSize),
    LOAD_END(RamfuncsLoadEnd),
    RUN_START(RamfuncsRunStart),
    RUN_SIZE(RamfuncsRunSize),
    RUN_END(RamfuncsRunEnd),
    ALIGN(8)

    And use those symbols to perform the copy from FLASH to RAM. Alternatively,

    GROUP
    {
    .TI.ramfunc
    { -l FAPI_F28003x_EABI_v1.58.10.lib}

    } LOAD = FLASH_BANK0_SEC1,
    RUN = RAMLS03,
    TABLE(BINIT),
    ALIGN(8)

    With BINIT, the copy is handled by the boot code itself.

    Regards,

    Veena