⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 s12xe_flash.lst

📁 freescale 协处理器应用相关实例
💻 LST
📖 第 1 页 / 共 3 页
字号:
ANSI-C/cC++ Compiler for HC12 V-5.0.30 Build 6157, Jun  7 2006

    1:  /******************************************************************************
    2:  * 		                                         COPYRIGHT (c) Freescale 2005   
    3:  * FILE NAME: S12XE_FTM.C                                                      
    4:  *                                                                           
    5:  * PURPOSE: S12XE Flash Routines      											 
    6:  *                                                                           
    7:  *                                                                          
    8:  * DOCUMENTATION SOURCE: CodeWarrior                                          
    9:  *                                                                           
   10:  * TARGET DEVICE: S12XE                                                
   11:  *                                                                           
   12:  * MEMORY USAGE(bytes)  RAM:         ROM:                                    
   13:  *                                                                           
   14:  * INCLUDE FILES: s12x_FTM.h, target.h                                               
   15:  *                                                                           
   16:  * FUNCTIONS :                                                      
   17:  *                                                    
   18:  * Tasks	 :  none                                                  			 
   19:  * Hooks   :	 none                                                            
   20:  * ISRs	 :	 none                                                                
   21:  *                                                                          
   22:  * COMPILER: Metrowerks                     
   23:  *                                                                           
   24:  * DESCRIPTION: Routines to program S12X FTM.                                              
   25:  *                                                                           
   26:  * NOTES
   27:  * -----
   28:  * Routines use Global pointers to access flash arrays.
   29:  *                                                                           
   30:  * UPDATE HISTORY                                                            
   31:  * REV      AUTHOR      DATE         DESCRIPTION OF CHANGE                    
   32:  * ---      ------      ---------    ---------------------                   
   33:  * 1.0      r32151      03/03/05     Initial coding                                        
   34:  *
   35:  ***************************************************************************/
   36:  /*=========================================================================
   37:  Freescale reserves the right to make changes without further notice to any 
   38:  product herein to improve reliability, function, or design. Freescale does 
   39:  not assume any liability arising out of the application or use of any      
   40:  product, circuit, or software described herein; neither does it convey     
   41:  any license under its patent rights nor the rights of others. Freescale    
   42:  products are not designed, intended, or authorized for use as components   
   43:  in systems intended for surgical implant into the body, or other           
   44:  applications intended to support life, or for any other application in 
   45:  which the failure of the Freescale product could create a situation where 
   46:  personal injury or death may occur. Should Buyer purchase or use Freescale 
   47:  products for any such intended or unauthorized application, Buyer shall 
   48:  indemnify and hold Freescale and its officers, employees, subsidiaries, 
   49:  affiliates, and distributors harmless against all claims costs, damages, 
   50:  and expenses, and reasonable attorney fees arising out of, directly or 
   51:  indirectly, any claim of personal injury or death associated with such 
   52:  unintended or unauthorized use, even if such claim alleges that Freescale  
   53:  was negligent regarding the design or manufacture of the part. Freescale   
   54:  and the Freescale logo* are registered trademarks of Freescale Ltd.        
   55:  **************************************************************************/
   56:  
   57:  /************************* Include Files *************************************/
   58:  #include "target.h"  /* includes device peripheral declarations */
   59:  #include "S12XE_Flash.h"
   60:  #include "far_ptr.h"
   61:  #include "s12x_peripherals.h"
   62:  /************************* typedefs ******************************************/
   63:  
   64:  /************************* function prototypes *******************************/
   65:  /* in S12X_FTM.h */
   66:  /************************* #defines ******************************************/
   67:  /* in S12X_FTM.h */
   68:  
   69:  /************************* Constants *****************************************/
   70:  #pragma CONST_SEG DEFAULT
   71:  /************************* Global Variables **********************************/
   72:  #pragma DATA_SEG DEFAULT
   73:  /************************* Functions *****************************************/
   74:  #pragma CODE_SEG DEFAULT 
   75:  
   76:  /******************************************************************************
   77:  Function Name	:	LaunchFlashCommand
   78:  Engineer		:	r32151
   79:  Date			:	15/11/05
   80:  Arguments	:	
   81:  Return		:
   82:  Notes			:	This function does not check if the Flash is erased.
   83:                 This function does not explicitly verify that the data has been 
   84:  					sucessfully programmed.
   85:  					This function must be located in RAM or a flash block not 
   86:  					being programmed.
   87:  ******************************************************************************/
   88:  tU08
   89:  LaunchFlashCommand(char params, tU08 command, tU08 ccob0, tU16 ccob1, tU16 ccob2, tU16 ccob3, tU16 ccob4, tU16 ccob5)
   90:  {

Function: LaunchFlashCommand
Source  : D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\Sources\S12XE_Flash.c
Options : -CPUHCS12XE -D__FAR_DATA -D__NO_FLOAT__ -Env"GENPATH=D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\bin;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\prm;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\cmd;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\Sources;C:\Program Files\Freescale\CW for HC12 V4.5\lib\HC12c\lib;C:\Program Files\Freescale\CW for HC12 V4.5\lib\HC12c\src;C:\Program Files\Freescale\CW for HC12 V4.5\lib\xgatec\lib;*C:\Program Files\Freescale\CW for HC12 V4.5\lib\xgatec\src;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\Sources\Configuration;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\defs_XEx100_M22E;C:\Program Files\Freescale\CW for HC12 V4.5\lib\HC12c\include;C:\Program Files\Freescale\CW for HC12 V4.5\lib\xgatec\include" -Env"LIBPATH=D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\bin;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\prm;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\cmd;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\Sources;C:\Program Files\Freescale\CW for HC12 V4.5\lib\HC12c\lib;C:\Program Files\Freescale\CW for HC12 V4.5\lib\HC12c\src;C:\Program Files\Freescale\CW for HC12 V4.5\lib\xgatec\lib;*C:\Program Files\Freescale\CW for HC12 V4.5\lib\xgatec\src;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\Sources\Configuration;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\defs_XEx100_M22E;C:\Program Files\Freescale\CW for HC12 V4.5\lib\HC12c\include;C:\Program Files\Freescale\CW for HC12 V4.5\lib\xgatec\include" -Env"OBJPATH=D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\bin" -Env"TEXTPATH=D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\bin" -Lasm=%n.lst -Mb -ObjN="D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\Example_9_Data\Flash_P&E_target\ObjectCode\S12XE_Flash.c.o" -WmsgSd1106

  0000 3b           [2]     PSHD  
   91:  	if(FTM.fstat.bit.ccif == 1)
  0001 1f00008055   [5]     BRCLR FTM:6,#128,*+90 ;abs = 005b
   92:  	{																	
   93:  														      /* Clear any error flags*/	
   94:  	   FTM.fstat.byte = (FPVIOL | ACCERR); 
  0006 c630         [1]     LDAB  #48
  0008 7b0000       [3]     STAB  FTM:6
   95:  
   96:                /* Write the command id / ccob0 */
   97:  		FTM.fccobix.byte = 0;
  000b 790000       [3]     CLR   FTM:2
   98:  		FTM.fccob.byte.hi = command;
  000e a68e         [3]     LDAA  14,SP
  0010 7a0000       [3]     STAA  FTM:10
   99:  		FTM.fccob.byte.lo = ccob0;
  0013 a68d         [3]     LDAA  13,SP
  0015 7a0000       [3]     STAA  FTM:11
  100:  
  101:        if(++FTM.fccobix.byte != params) {
  0018 720000       [4]     INC   FTM:2
  001b f60000       [3]     LDAB  FTM:2
  001e 87           [1]     CLRA  
  001f b746         [1]     TFR   D,Y
  0021 e68f         [3]     LDAB  15,SP
  0023 b715         [1]     SEX   B,X
  0025 34           [2]     PSHX  
  0026 adb1         [3]     CPY   2,SP+
  0028 271d         [3/1]   BEQ   *+31 ;abs = 0047
  102:           FTM.fccob.word = ccob1; 			/* Write next data word to CCOB buffer. */ 
  002a ec8b         [3]     LDD   11,SP
  002c 0730         [4]     BSR   *+50 ;abs = 005e
  103:           if(++FTM.fccobix.byte != params) {
  002e 2717         [3/1]   BEQ   *+25 ;abs = 0047
  104:    		      FTM.fccob.word = ccob2; 			/* Write next data word to CCOB buffer. */
  0030 ec89         [3]     LDD   9,SP
  0032 072a         [4]     BSR   *+44 ;abs = 005e
  105:              if(++FTM.fccobix.byte != params) {
  0034 2711         [3/1]   BEQ   *+19 ;abs = 0047
  106:     		      FTM.fccob.word = ccob3; 			/* Write next data word to CCOB buffer. */
  0036 ec87         [3]     LDD   7,SP
  0038 0724         [4]     BSR   *+38 ;abs = 005e
  107:                 if(++FTM.fccobix.byte != params) {

⌨️ 快捷键说明

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