• PUDN用户
    了解作者
  • C/C++
    开发工具
  • 41KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 355
    下载次数
  • 2005-09-04 18:08
    上传日期
ti dsp lf2407的flash接口程序,可以通过该程序对flash进行在线操作
2407flash.zip
  • FlashAlgos
  • SRC
  • Var.obj
    1.2KB
  • CopyAlgo.asm
    17.5KB
  • VAR.ASM
    2.4KB
  • ERA_ALG.ASM
    33.7KB
  • PGM_ALG.ASM
    24.2KB
  • PGM_ALG.OBJ
    4.3KB
  • ERA_ALG.OBJ
    6KB
  • CLR_ALG.ASM
    28.3KB
  • CLR_ALG.OBJ
    5.1KB
  • CopyAlgo.obj
    4.6KB
  • Include
  • Timings.xls
    24KB
  • CFlash.h
    2.1KB
  • RUNDEFS.H
    3KB
  • Timings.30
    3.8KB
  • VAR.H
    7.5KB
  • Timings.40
    3.8KB
  • www.pudn.com.txt
    218B
  • FLASH.C
    2.7KB
内容介绍
/*************************************************************************************************** * Filename : FLASHMAIN.C * Last Modified : 23 Jan 2002. * Version : 1.3 * Originator : Texas Instruments, DSP Digital Control Systems Group. *************************************************************************************************/ /* Compiler directives to place all the kernel functions in the KER_text section. * This section is handled by the linker command file to have a load address in the * flash memory but a run addres in the SARAM block. This is copied at run time * to the run address by the copyKernel function. */ #pragma CODE_SECTION(kernelControlLoop,"KER_text") #pragma CODE_SECTION(AnotherKernelFunction,"KER_text") /* Function prototypes and constants, registers etc. */ void flashmain(void ); void lf240xInitSys(void); /* Import the function prototypes and variable information from the * flash algorithms */ #include "..\\flashalgos\\include\\CFlash.h" /* Import the function prototypes and variable information from the * flash algorithms */ #include "regs240x.h" /* Buffer to hold data for programming into flash */ int bufferArray[32]; extern int bufferbak[32]; void flashmain() { int i; for(i=0;i<32;i++)bufferarray[i]=bufferbak[i]; /* * Call the system initialization function. * For flash programming at a minimum the Watchdog must be shut down * and the PLL initialized */ lf240xInitSys(); copyKernel(); kernelControlLoop(); } int kernelControlLoop(void) { copyClearAlgo(); flashAlgoVars.SECTOR_CMD=(SECTOR3); /* The code here assumes that clearFlash suceeds, a real app would do error checking.*/ clearFlash(&flashAlgoVars); copyEraseAlgo(); flashAlgoVars.SECTOR_CMD=(SECTOR1); eraseFlash(&flashAlgoVars); /* The code here assumes that eraseFlash suceeds, a real app would do error checking.*/ copyProgramAlgo(); /* Setup the sector permissions */ flashAlgoVars.SECTOR_CMD=(SECTOR1); /* Setup ptr to data buffer. */ flashAlgoVars.DATA_PTR=(int)(&bufferArray); /* Number of words to program */ flashAlgoVars.FL_SECEND=0x32; /* Block address */ flashAlgoVars.ADDR=0x7000; /* Call the program routine */ programFlash(&flashAlgoVars); /* The code here assumes that programFlash suceeds, a real app would do error checking.*/ /* Map in the flash into the program space */ /* SCSR2=0xb; */ /* Map in the ext-RAM into the program space */ /* SCSR2=0x7;*/ } void lf240xInitSys(void) { WDCR=0x6f; /* Dis-able the watchdog */ SCSR1=0x0; /* PLL = x4 */ }
评论
    相关推荐