44bmain.c

来自「windows 下 ads开发arm相关 用途 :通过multi ice烧写f」· C语言 代码 · 共 74 行

C
74
字号
/*************************************************************************
* FILE NAME                                     VERSION                
*                                                                      
*        44bmain.c            		            1.0              
*                                                                      
* COMPONENT                                                            
*                                                                      
*        Flash Operation such as erase/program                                    
*                                                                      
* DESCRIPTION                                                          
*                                                                      
*      	  
*                                                                      
* DATA STRUCTURES                                                      
*                                                                      
*               
*                                                                      
* FUNCTIONS                                                            
*
*        
*                                                                      
* DEPENDENCIES                                                         
*        
*       
* HISTORY
*	
*		Meter Chen                2001-7
*                                                               
************************************************************************/

#include <stdlib.h>
#include <string.h>
#include <math.h>

#include "..\inc\def.h"
#include "..\inc\29lvflash.h"
#include "..\inc\option.h"
#include "..\inc\44b.h"
#include "..\inc\44blib.h"

int main(void)
{
    
    /**** SYSTEM INITIALIZE */
    
	/* disable system cache */
    rSYSCFG = 0;

    //__rt_lib_init();

    Port_Init();
    
    /**** FLASH OPERATION */
    
    /* 1 - get flash'ID, if it work well, at least our hardware is good */
    Flash_ReadID();
    
    /* 2 - erase the whole chip, also you can erase it sector by sector */
    Flash_Erase_Chip();
    
    /* 3 - write into flash from a temporary buffer */
    /* the buffer base is 0xc100000, the image length is 1000000, you can change these */
    Flash_Write(0, (char *)0xc100000, 100000);
    
    /**** PROGRAM OVER */

    while(1)
    {
    	Led_Display(0);
    	Delay(1000);
    	Led_Display(3);
    	Delay(10000);
    }
}

⌨️ 快捷键说明

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