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.

TMDSCNCD28379D: System clock and Flash setting

Part Number: TMDSCNCD28379D

Hi, I recently developed a new project using TMDSCNCD28379D Control Card

According to my previous experience of developing F28069, I know that I have to do a few settings first
1. Use external oscillator and ensure its PLL settings are correct
2. To use Get Mode (stand alone with flash), SW1 must be set to 1,1
3. Move some time-critical programs to RAM


First, I have found in F2837xD_SysCtrl.c

#ifdef _LAUNCHXL_F28379D
    InitSysPll(XTAL_OSC,IMULT_40,FMULT_0,PLLCLK_BY_2);
#else
    InitSysPll(XTAL_OSC, IMULT_20, FMULT_0, PLLCLK_BY_2);
#endif // _LAUNCHXL_F28379D

I guess since I'm using Control Card it will run the else part of the code
After calculation, PLLSYSCLK = (XTAL_OSC) * (IMULT + FMULT)/(PLLSYSCLKDIV)=20MHz*20/2=200MHz

Let me know if I've misunderstood anything.

Also how to make sure there is no #define _LAUNCXL_F28379D, in which file it will appear?

Second, I have adjusted SW1 to the correct settings, and also ensured that Build Configuration is set to Flash Build (link to 2837xD_FLASH_lnk_cpu1.cmd and F2837xD_Headers_nonBIOS_cpu1.cmd)

Are other settings required?

Third, also find the following code in F2837xD_SysCtrl.c

#ifdef _FLASH
    //
    // Copy time critical code and Flash setup code to RAM. This includes the
    // following functions: InitFlash()
    //
    // The  RamfuncsLoadStart, RamfuncsLoadSize, and RamfuncsRunStart
    // symbols are created by the linker. Refer to the device .cmd file.
    //
    memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);

    //
    // Call Flash Initialization to setup flash waitstates. This function must
    // reside in RAM.
    //
    InitFlash();
#endif






#ifndef _FLASH
    //
    // Call Device_cal function when run using debugger
    // This function is called as part of the Boot code. The function is called
    // in the InitSysCtrl function since during debug time resets, the boot code
    // will not be executed and the gel script will reinitialize all the
    // registers and the calibrated values will be lost.
    //
    Device_cal();
#endif

I also want to know how to ensure that _FLASH is defined, and which file it will appear in
In addition, when using F28069, I had to define which programs need move into RAM, as follows
#pragma CODE_SECTION(cpu_timer0_isr, "ramfuncs");
#pragma CODE_SECTION(cpu_timer1_isr, "ramfuncs");
#pragma CODE_SECTION(adc_isr, "ramfuncs");
#pragma CODE_SECTION(ecap_isr,"ramfuncs");
#pragma CODE_SECTION(InitAdc, "ramfuncs");
#pragma CODE_SECTION(AdcConversion,"ramfuncs");

Do I need to add it in the program of F28379D? The most similar code I found is in F2837xD_SysCtrl.c

#ifndef __cplusplus
    #ifdef __TI_COMPILER_VERSION__
        #if __TI_COMPILER_VERSION__ >= 15009000
            #pragma CODE_SECTION(InitFlash, ".TI.ramfunc");
            #pragma CODE_SECTION(FlashOff, ".TI.ramfunc");
        #else
            #pragma CODE_SECTION(InitFlash, "ramfuncs");
            #pragma CODE_SECTION(FlashOff, "ramfuncs");
        #endif
    #endif
#endif


If anyone can help me clarify this would be a great help, thanks

  • For the _LAUNCHXL_F28379D and the _FLASH, these would be added to the predefined symbols under the compiler options in the project properties(right click on the project and pick properties, and it will bring up the below dialogue).  When you pick the flash build option, it will populate the _FLASH in the predefined as you see below.  If you wanted to configure for the launchpad, you would add the above to this same list(and you could make a build config to support that as well).

    For the functions that need to get copied/ran from RAM, you have defined the pragma CODE_SECTION correctly, but you also need to define what flash/ram is used in the .cmd file.

    Below is an example for the .cmd implementation.  This is loading to the FLASHE memory but will run from RAML1.  You can change this to match the memory on the F2837x you want to use.  The binit lines take care of copying the code from flash to RAM as part of the boot initialization, so you don't have to call memcopy in your main.c

    ramfuncs      :  LOAD = FLASHE,
                               RUN >> RAML1 
                               table(BINIT)
                               PAGE = 0
    .binit > FLASHE

    Best,

    Matthew