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