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

📄 flash.cod

📁 Ep93XX TionProV2 BSP
💻 COD
📖 第 1 页 / 共 5 页
字号:
  00088	e5823000	 str         r3, [r2]

; 158  : 
; 159  :         //
; 160  :         // Read erase status.
; 161  :         //
; 162  :         *gpulCurAddr = FLASH_READ_STATUS;

  0008c	e59f30b8	 ldr         r3, [pc, #0xB8]
  00090	e5932000	 ldr         r2, [r3]
  00094	e3a03607	 mov         r3, #7, 12
  00098	e3833070	 orr         r3, r3, #0x70
  0009c	e5823000	 str         r3, [r2]

; 163  :         gbUnlocked   = FALSE;

  000a0	e59f20a0	 ldr         r2, [pc, #0xA0]
  000a4	e3a03000	 mov         r3, #0
  000a8	e5823000	 str         r3, [r2]

; 164  :     }
; 165  :     else

  000ac	ea000024	 b           |$L38114|
  000b0		 |$L38113|

; 166  :     {
; 167  :         //
; 168  :         // Check to see if we have finished erasing the flash memory.
; 169  :         //
; 170  :         if(gdwStartAddr + gdwLength < ((DWORD)gpulCurAddr) + FLASH_BLOCK_SIZE)

  000b0	e59f30a0	 ldr         r3, [pc, #0xA0]
  000b4	e5932000	 ldr         r2, [r3]
  000b8	e59f3094	 ldr         r3, [pc, #0x94]
  000bc	e5933000	 ldr         r3, [r3]
  000c0	e0822003	 add         r2, r2, r3
  000c4	e59f3080	 ldr         r3, [pc, #0x80]
  000c8	e5933000	 ldr         r3, [r3]
  000cc	e2833701	 add         r3, r3, #1, 14
  000d0	e1520003	 cmp         r2, r3
  000d4	2a000003	 bcs         |$L38116|

; 171  :         {
; 172  :             gbFlashEraseComplete = TRUE;

  000d8	e59f2070	 ldr         r2, [pc, #0x70]
  000dc	e3a03001	 mov         r3, #1
  000e0	e5823000	 str         r3, [r2]

; 173  :             return;

  000e4	ea000016	 b           |$L38110|
  000e8		 |$L38116|

; 174  :         }
; 175  : 
; 176  :         //
; 177  :         // Advance to the next block.
; 178  :         //
; 179  :         gpulCurAddr+= FLASH_BLOCK_SIZE>>2;

  000e8	e59f305c	 ldr         r3, [pc, #0x5C]
  000ec	e5933000	 ldr         r3, [r3]
  000f0	e2832701	 add         r2, r3, #1, 14
  000f4	e59f3050	 ldr         r3, [pc, #0x50]
  000f8	e5832000	 str         r2, [r3]

; 180  : 
; 181  :         //
; 182  :         // Clear the lock bits if the flash block was locked.
; 183  :         //
; 184  :         *gpulCurAddr = FLASH_LOCK_BIT;

  000fc	e59f3048	 ldr         r3, [pc, #0x48]
  00100	e5932000	 ldr         r2, [r3]
  00104	e3a03606	 mov         r3, #6, 12
  00108	e3833060	 orr         r3, r3, #0x60
  0010c	e5823000	 str         r3, [r2]

; 185  :         *gpulCurAddr = FLASH_LOCK_CLEAR;

  00110	e59f3034	 ldr         r3, [pc, #0x34]
  00114	e5932000	 ldr         r2, [r3]
  00118	e3a0360d	 mov         r3, #0xD, 12
  0011c	e38330d0	 orr         r3, r3, #0xD0
  00120	e5823000	 str         r3, [r2]

; 186  :         *gpulCurAddr = FLASH_READ_STATUS;

  00124	e59f3020	 ldr         r3, [pc, #0x20]
  00128	e5932000	 ldr         r2, [r3]
  0012c	e3a03607	 mov         r3, #7, 12
  00130	e3833070	 orr         r3, r3, #0x70
  00134	e5823000	 str         r3, [r2]

; 187  : 
; 188  :         gbUnlocked  = TRUE;

  00138	e59f2008	 ldr         r2, [pc, #8]
  0013c	e3a03001	 mov         r3, #1
  00140	e5823000	 str         r3, [r2]
  00144		 |$L38114|
  00144		 |$L38110|

; 189  :     }
; 190  : }

  00144	e12fff1e	 bx          lr
  00148		 |$L38391|
  00148	00000000	 DCD         |gbUnlocked|
  0014c	00000000	 DCD         |gpulCurAddr|
  00150	00000000	 DCD         |gbFlashEraseComplete|
  00154	00000000	 DCD         |gdwLength|
  00158	00000000	 DCD         |gdwStartAddr|
  0015c		 |$M38387|

			 ENDP  ; |ContinueEraseFlashJ3_2x16|

	EXPORT	|FinishEraseFlashJ3_2x16|
	EXPORT	|??_C@_01LFCBOECM@?4?$AA@| [ DATA ]	; `string'

  00000			 AREA	 |.text| { |FinishEraseFlashJ3_2x16| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000			 AREA	 |.pdata$$FinishEraseFlashJ3_2x16|, PDATA, SELECTION=5, ASSOC=|.text| { |FinishEraseFlashJ3_2x16| } ; comdat associative
|$T38398| DCD	|$L38397|
	DCD	0x4000af02

  00000			 AREA	 |.rdata| { |??_C@_01LFCBOECM@?4?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_01LFCBOECM@?4?$AA@| DCB ".", 0x0			; `string'
; Function compile flags: /Ods

  00000			 AREA	 |.text| { |FinishEraseFlashJ3_2x16| }, CODE, ARM, SELECTION=1 ; comdat noduplicate

  00000		 |FinishEraseFlashJ3_2x16| PROC

; 199  : {

  00000		 |$L38397|
  00000	e52de004	 str         lr, [sp, #-4]!
  00004	e24dd018	 sub         sp, sp, #0x18
  00008		 |$M38395|

; 200  :     BOOL    bSuccess;
; 201  :     //
; 202  :     // Check to see if the flash has been completely erased. If so just
; 203  :     // return.
; 204  :     //
; 205  :     if(gbFlashEraseComplete)

  00008	e59f32a8	 ldr         r3, [pc, #0x2A8]
  0000c	e5933000	 ldr         r3, [r3]
  00010	e3530000	 cmp         r3, #0
  00014	0a000002	 beq         |$L38120|

; 206  :     {
; 207  :         return TRUE;

  00018	e3a03001	 mov         r3, #1
  0001c	e58d3004	 str         r3, [sp, #4]
  00020	ea00009b	 b           |$L38118|
  00024		 |$L38120|

; 208  :     }
; 209  : 
; 210  :     //
; 211  :     // Wait for the Flash block command to succeed.
; 212  :     //
; 213  :     bSuccess = WaitForReady(gpulCurAddr, 10000, EXT_STATUS_WBUFFER_READY);

  00024	e3a03502	 mov         r3, #2, 10
  00028	e3832080	 orr         r2, r3, #0x80
  0002c	e3a03c27	 mov         r3, #0x27, 24
  00030	e3831010	 orr         r1, r3, #0x10
  00034	e59f3268	 ldr         r3, [pc, #0x268]
  00038	e5930000	 ldr         r0, [r3]
  0003c	eb000000	 bl          WaitForReady
  00040	e58d0008	 str         r0, [sp, #8]
  00044	e59d3008	 ldr         r3, [sp, #8]
  00048	e58d3000	 str         r3, [sp]

; 214  :     if(bSuccess == FALSE)

  0004c	e59d3000	 ldr         r3, [sp]
  00050	e3530000	 cmp         r3, #0
  00054	1a000002	 bne         |$L38121|

; 215  :     {
; 216  :         return FALSE;

  00058	e3a03000	 mov         r3, #0
  0005c	e58d3004	 str         r3, [sp, #4]
  00060	ea00008b	 b           |$L38118|
  00064		 |$L38121|

; 217  :     }
; 218  :     *gpulCurAddr  = FLASH_CLEAR_STATUS;

  00064	e59f3238	 ldr         r3, [pc, #0x238]
  00068	e5932000	 ldr         r2, [r3]
  0006c	e3a03605	 mov         r3, #5, 12
  00070	e3833050	 orr         r3, r3, #0x50
  00074	e5823000	 str         r3, [r2]

; 219  : 
; 220  : 
; 221  :     //
; 222  :     // Erase the block before unlocking the next block.
; 223  :     //
; 224  :     if(gbUnlocked)

  00078	e59f3234	 ldr         r3, [pc, #0x234]
  0007c	e5933000	 ldr         r3, [r3]
  00080	e3530000	 cmp         r3, #0
  00084	0a00002b	 beq         |$L38122|

; 225  :     {
; 226  :         //
; 227  :         // Erase the flash block
; 228  :         //
; 229  :         *gpulCurAddr = FLASH_BLOCK_ERASE;

  00088	e59f3214	 ldr         r3, [pc, #0x214]
  0008c	e5932000	 ldr         r2, [r3]
  00090	e3a03602	 mov         r3, #2, 12
  00094	e3833020	 orr         r3, r3, #0x20
  00098	e5823000	 str         r3, [r2]

; 230  :         *gpulCurAddr = FLASH_BLOCK_ERASE_RESUME;

  0009c	e59f3200	 ldr         r3, [pc, #0x200]
  000a0	e5932000	 ldr         r2, [r3]
  000a4	e3a0360d	 mov         r3, #0xD, 12
  000a8	e38330d0	 orr         r3, r3, #0xD0
  000ac	e5823000	 str         r3, [r2]

; 231  : 
; 232  :         //
; 233  :         // Read erase status.
; 234  :         //
; 235  :         *gpulCurAddr = FLASH_READ_STATUS;

  000b0	e59f31ec	 ldr         r3, [pc, #0x1EC]
  000b4	e5932000	 ldr         r2, [r3]
  000b8	e3a03607	 mov         r3, #7, 12
  000bc	e3833070	 orr         r3, r3, #0x70
  000c0	e5823000	 str         r3, [r2]

; 236  : 
; 237  :         //
; 238  :         // Wait for the Flash block command to succeed.
; 239  :         //
; 240  :         bSuccess = WaitForReady(gpulCurAddr, 10000, EXT_STATUS_WBUFFER_READY);

  000c4	e3a03502	 mov         r3, #2, 10
  000c8	e3832080	 orr         r2, r3, #0x80
  000cc	e3a03c27	 mov         r3, #0x27, 24
  000d0	e3831010	 orr         r1, r3, #0x10
  000d4	e59f31c8	 ldr         r3, [pc, #0x1C8]
  000d8	e5930000	 ldr         r0, [r3]
  000dc	eb000000	 bl          WaitForReady
  000e0	e58d000c	 str         r0, [sp, #0xC]
  000e4	e59d300c	 ldr         r3, [sp, #0xC]
  000e8	e58d3000	 str         r3, [sp]

; 241  :         if(bSuccess == FALSE)

  000ec	e59d3000	 ldr         r3, [sp]
  000f0	e3530000	 cmp         r3, #0
  000f4	1a000002	 bne         |$L38123|

; 242  :         {
; 243  :             return FALSE;

  000f8	e3a03000	 mov         r3, #0
  000fc	e58d3004	 str         r3, [sp, #4]
  00100	ea000063	 b           |$L38118|
  00104		 |$L38123|

; 244  :         }
; 245  : 
; 246  :         *gpulCurAddr    = FLASH_CLEAR_STATUS;

  00104	e59f3198	 ldr         r3, [pc, #0x198]
  00108	e5932000	 ldr         r2, [r3]
  0010c	e3a03605	 mov         r3, #5, 12
  00110	e3833050	 orr         r3, r3, #0x50
  00114	e5823000	 str         r3, [r2]

; 247  :         gbUnlocked      = FALSE;

  00118	e59f2194	 ldr         r2, [pc, #0x194]
  0011c	e3a03000	 mov         r3, #0
  00120	e5823000	 str         r3, [r2]

; 248  : 
; 249  :         //
; 250  :         // Increment to the next block.
; 251  :         //
; 252  :         gpulCurAddr += FLASH_BLOCK_SIZE>>2;

  00124	e59f3178	 ldr         r3, [pc, #0x178]
  00128	e5933000	 ldr         r3, [r3]
  0012c	e2832701	 add         r2, r3, #1, 14
  00130	e59f316c	 ldr         r3, [pc, #0x16C]
  00134	e5832000	 str         r2, [r3]
  00138		 |$L38122|
  00138		 |$L38126|

; 253  :     }
; 254  : 
; 255  : 
; 256  :     //
; 257  :     // Erase the Flash
; 258  :     //
; 259  :     while((DWORD)gpulCurAddr < (gdwStartAddr + gdwLength))

  00138	e59f3170	 ldr         r3, [pc, #0x170]
  0013c	e5932000	 ldr         r2, [r3]
  00140	e59f3164	 ldr         r3, [pc, #0x164]
  00144	e5933000	 ldr         r3, [r3]
  00148	e0822003	 add         r2, r2, r3
  0014c	e59f3150	 ldr         r3, [pc, #0x150]
  00150	e5933000	 ldr         r3, [r3]
  00154	e1530002	 cmp         r3, r2
  00158	2a00004b	 bcs         |$L38127|

; 260  :     {
; 261  : 
; 262  :         //
; 263  :         // Clear the lock bits if the flash block was locked.
; 264  :         //
; 265  :         *gpulCurAddr = FLASH_LOCK_BIT;

  0015c	e59f3140	 ldr         r3, [pc, #0x140]
  00160	e5932000	 ldr         r2, [r3]
  00164	e3a03606	 mov         r3, #6, 12
  00168	e3833060	 orr         r3, r3, #0x60
  0016c	e5823000	 str         r3, [r2]

; 266  :         *gpulCurAddr = FLASH_LOCK_CLEAR;

  00170	e59f312c	 ldr         r3, [pc, #0x12C]
  00174	e5932000	 ldr         r2, [r3]
  00178	e3a0360d	 mov         r3, #0xD, 12
  0017c	e38330d0	 orr         r3, r3, #0xD0
  00180	e5823000	 str         r3, [r2]

; 267  :         *gpulCurAddr = FLASH_READ_STATUS;

  00184	e59f3118	 ldr         r3, [pc, #0x118]
  00188	e5932000	 ldr         r2, [r3]
  0018c	e3a03607	 mov         r3, #7, 12
  00190	e3833070	 orr         r3, r3, #0x70
  00194	e5823000	 str         r3, [r2]

; 268  : 
; 269  :         //
; 270  :         // Wait for the Flash block command to succeed.
; 271  :         //
; 272  :         bSuccess = WaitForReady(gpulCurAddr, 10000, EXT_STATUS_WBUFFER_READY);

  00198	e3a03502	 mov         r3, #2, 10
  0019c	e3832080	 orr         r2, r3, #0x80
  001a0	e3a03c27	 mov         r3, #0x27, 24
  001a4	e3831010	 orr         r1, r3, #0x10
  001a8	e59f30f4	 ldr         r3, [pc, #0xF4]
  001ac	e5930000	 ldr         r0, [r3]
  001b0	eb000000	 bl          WaitForReady
  001b4	e58d0010	 str         r0, [sp, #0x10]
  001b8	e59d3010	 ldr         r3, [sp, #0x10]
  001bc	e58d3000	 str         r3, [sp]

; 273  :         *gpulCurAddr  = FLASH_CLEAR_STATUS;

  001c0	e59f30dc	 ldr         r3, [pc, #0xDC]
  001c4	e5932000	 ldr         r2, [r3]
  001c8	e3a03605	 mov         r3, #5, 12
  001cc	e3833050	 orr         r3, r3, #0x50
  001d0	e5823000	 str         r3, [r2]

; 274  :         
; 275  :         if(!bSuccess)

  001d4	e59d3000	 ldr         r3, [sp]
  001d8	e3530000	 cmp         r3, #0
  001dc	1a000000	 bne         |$L38128|

; 276  :         {
; 277  :             break;

  001e0	ea000029	 b           |$L38127|
  001e4		 |$L38128|

; 278  :         }
; 279  : 
; 280  : 
; 281  :         //
; 282  :         // Erase the flash block
; 283  :         //
; 284  :         *gpulCurAddr = FLASH_BLOCK_ERASE;

  001e4	e59f30b8	 ldr         r3, [pc, #0xB8]
  001e8	e5932000	 ldr         r2, [r3]
  001ec	e3a03602	 mov         r3, #2, 12

⌨️ 快捷键说明

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