main.c

来自「相当有用的并且已经调试通过的FLASH烧写程序。」· C语言 代码 · 共 46 行

C
46
字号
/*
	Designed by YHB, 07.06.2004  
	This is for TMS320C5416 board 
	
	If you want to use it,please note:
	1.Confirm that the connection between CPU and flash 
	  is the same as the document "spra585".
	  
	2.Be sure to select flash instead of RAM when entering in CCS.
	  Otherwise,you must reset the board and modify configuration.
	  
	3.If you want to modify the address which you want to burn in,
	  you can only modify the "BOOTADDRESS".
	  
	4.Look at the "NOTE" part in FlashBurn.h
*/
 
#include "FlashBurn.h"
#include "regs54xx.h"
#include "C54xInit.h"

#define BOOTADDRESS 0x8000

void main()
{
	int i;
	
	unsigned int* punTemp = (unsigned int*)(0x6000);
	
	SetClkMode(5);
	
	//Set DROM bit to 0,such flash will be the
	//DSP's data space from 0x8000 to 0xffff
	PMST  = 0xffa0;
	
	SWWSR = 0x7fff;
	
	for( i = 0 ; i < 100 ; i++ )
		punTemp[i] = i + 2;
				
//	BurnFile(BOOTADDRESS);	
	EraseFlash();
	BurnFlash(BOOTADDRESS,punTemp,100);			
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?