📄 intel_j3_2x16.cod
字号:
; 359 : pulDest = (PULONG)dwDest;
0000c e58d0004 str r0, [sp, #4]
00010 e3a06000 mov r6, #0
; 360 : pulSource = (PULONG)dwSource;
00014 e58d1008 str r1, [sp, #8]
; 361 :
; 362 : while( ulCount < dwLength)
00018 e3a09001 mov r9, #1
0001c e3570000 cmp r7, #0
00020 9a00003d bls |$L36655|
00024 e3a08502 mov r8, #2, 10
00028 e3888080 orr r8, r8, #0x80
0002c |$L36654|
; 363 : {
; 364 :
; 365 : //
; 366 : // Calculate the block address
; 367 : //
; 368 : pulBlockAddress = (ULONG *)(((ULONG)&pulDest[ulCount>>2]) & FLASH_BLOCK_MASK);
0002c e59d0004 ldr r0, [sp, #4]
00030 e1a01126 mov r1, r6, lsr #2
00034 e3a034ff mov r3, #0xFF, 8
00038 e0802101 add r2, r0, r1, lsl #2
0003c e383373f orr r3, r3, #0x3F, 14
00040 e0020003 and r0, r2, r3
00044 e58d0000 str r0, [sp]
; 369 :
; 370 : //
; 371 : // Write the Flash to buffer command until the flash is ready.
; 372 : //
; 373 : ulStart = GetSystemTimeInMsec();
00048 eb000000 bl GetSystemTimeInMsec
; 374 : ulAddDelay = 1;
0004c e2800c27 add r0, r0, #0x27, 24
00050 e1a05009 mov r5, r9
00054 e2804010 add r4, r0, #0x10
00058 |$L36658|
; 375 : do
; 376 : {
; 377 : *pulBlockAddress = FLASH_WRITE_TO_BUFFER;
00058 e3a0173a mov r1, #0x3A, 14
0005c e59d0000 ldr r0, [sp]
00060 e38110e8 orr r1, r1, #0xE8
00064 e5801000 str r1, [r0]
; 378 :
; 379 : //
; 380 : // Check to make sure that we are not in a loop.
; 381 : //
; 382 : ulCurrent = GetSystemTimeInMsec();
00068 eb000000 bl GetSystemTimeInMsec
; 383 : if(ulStart + 10000 <ulCurrent)
0006c e1540000 cmp r4, r0
00070 3a000031 bcc |$L36774|
; 391 : return FALSE;
; 392 : }
; 393 : DelayInuSec(ulAddDelay);
00074 e1a00005 mov r0, r5
00078 eb000000 bl DelayInuSec
; 394 : ulAddDelay =(ulAddDelay<<1);
; 395 : }
; 396 : while((*pulBlockAddress & EXT_STATUS_WBUFFER_READY)!= EXT_STATUS_WBUFFER_READY);
0007c e59d0000 ldr r0, [sp]
00080 e1a05085 mov r5, r5, lsl #1
00084 e5901000 ldr r1, [r0]
00088 e0012008 and r2, r1, r8
0008c e1520008 cmp r2, r8
00090 1afffff0 bne |$L36658|
; 397 :
; 398 : //
; 399 : // Program the Flash size to be written.
; 400 : //
; 401 : usWordsToWrite = (FLASH_BUFFER_SIZE - 1)>>2;
; 402 : *pulBlockAddress = (usWordsToWrite<<16) | usWordsToWrite;
00094 e3a0180f mov r1, #0xF, 16
00098 e59d0000 ldr r0, [sp]
0009c e381100f orr r1, r1, #0xF
000a0 e5801000 str r1, [r0]
; 403 :
; 404 : ulEndCount = ulCount + FLASH_BUFFER_SIZE;
000a4 e2863040 add r3, r6, #0x40
000a8 |$L36672|
; 405 : do
; 406 : {
; 407 : pulDest[ulCount>>2] = pulSource[ulCount>>2];
000a8 e59d0008 ldr r0, [sp, #8]
000ac e1a02126 mov r2, r6, lsr #2
000b0 e59d1004 ldr r1, [sp, #4]
; 408 : ulCount += sizeof(ULONG);
000b4 e2866004 add r6, r6, #4
000b8 e7900102 ldr r0, [r0, +r2, lsl #2]
; 409 : } while(ulCount < ulEndCount);
000bc e1560003 cmp r6, r3
000c0 e7810102 str r0, [r1, +r2, lsl #2]
000c4 3afffff7 bcc |$L36672|
; 410 :
; 411 : //
; 412 : // End of programming the block.
; 413 : //
; 414 : *pulBlockAddress = FLASH_BLOCK_PROGRAM_RESUME;
000c8 e3a0160d mov r1, #0xD, 12
000cc e59d0000 ldr r0, [sp]
000d0 e38110d0 orr r1, r1, #0xD0
; 415 :
; 416 : // DelayInuSec(500);
; 417 :
; 418 : //
; 419 : // Occasionally write out a dot so they don't think
; 420 : // the system is dead.
; 421 : //
; 422 : if(((ULONG)&pulDest[ulCount>>2] & (FLASH_BLOCK_SIZE - 1)) == 0)
000d4 e59f3108 ldr r3, [pc, #0x108]
000d8 e5801000 str r1, [r0]
000dc e1a01126 mov r1, r6, lsr #2
000e0 e59d0004 ldr r0, [sp, #4]
000e4 e0802101 add r2, r0, r1, lsl #2
000e8 e1120003 tst r2, r3
; 423 : {
; 424 : EdbgOutputDebugString(".");
000ec 059f00ec ldreq r0, [pc, #0xEC]
000f0 0b000000 bleq EdbgOutputDebugString
; 425 : }
; 426 :
; 427 : //
; 428 : // Wait for the Flash block command to succed.
; 429 : //
; 430 : bSuccess = WaitForReady(pulBlockAddress, 6000, EXT_STATUS_WBUFFER_READY);
000f4 e59d0000 ldr r0, [sp]
000f8 e3a02502 mov r2, #2, 10
000fc e3a01d5d mov r1, #0x5D, 26
00100 e3822080 orr r2, r2, #0x80
00104 e3811030 orr r1, r1, #0x30
00108 eb000000 bl WaitForReady
0010c e3500000 cmp r0, #0
; 431 : if(!bSuccess)
00110 0a00001b beq |$L36776|
; 361 :
; 362 : while( ulCount < dwLength)
00114 e1560007 cmp r6, r7
00118 3affffc3 bcc |$L36654|
0011c |$L36655|
; 439 : break;
; 440 : }
; 441 : }
; 442 : *pulBlockAddress = FLASH_READ_MODE;
0011c e3a018ff mov r1, #0xFF, 16
00120 e59d0000 ldr r0, [sp]
00124 e38110ff orr r1, r1, #0xFF
00128 e5801000 str r1, [r0]
; 443 : return TRUE;
0012c e1a00009 mov r0, r9
; 444 : }
00130 e28dd00c add sp, sp, #0xC
00134 e8bd43f0 ldmia sp!, {r4 - r9, lr}
00138 e12fff1e bx lr
0013c |$L36774|
; 384 : {
; 385 : EdbgOutputDebugString("FLASH_WRITE_TO_BUFFER - Failed\n.");
0013c e59f0098 ldr r0, [pc, #0x98]
00140 eb000000 bl EdbgOutputDebugString
; 386 : EdbgOutputDebugString("pulBlockAddress = %x.\n",(ULONG)pulBlockAddress);
00144 e59d1000 ldr r1, [sp]
00148 e59f0084 ldr r0, [pc, #0x84]
0014c eb000000 bl EdbgOutputDebugString
; 387 : EdbgOutputDebugString("*pulBlockAddress = %x.\n",(ULONG)*pulBlockAddress);
00150 e59d3000 ldr r3, [sp]
00154 e59f0074 ldr r0, [pc, #0x74]
00158 e5931000 ldr r1, [r3]
0015c eb000000 bl EdbgOutputDebugString
; 388 : *pulBlockAddress = FLASH_READ_STATUS;
00160 e59d3000 ldr r3, [sp]
00164 e3a00607 mov r0, #7, 12
00168 e3800070 orr r0, r0, #0x70
0016c e5830000 str r0, [r3]
; 389 : EdbgOutputDebugString("*FLASH_READ_STATUS pulBlockAddress = %x.\n",(ULONG)*pulBlockAddress);
00170 e59d0000 ldr r0, [sp]
00174 e5901000 ldr r1, [r0]
00178 e59f004c ldr r0, [pc, #0x4C]
0017c eb000000 bl EdbgOutputDebugString
00180 |$L36670|
; 390 : while(1);
00180 eafffffe b |$L36670|
00184 |$L36776|
; 432 : {
; 433 : EdbgOutputDebugString("FLASH_BLOCK_PROGRAM_RESUME - Failed\n.");
00184 e59f004c ldr r0, [pc, #0x4C]
00188 eb000000 bl EdbgOutputDebugString
; 434 : EdbgOutputDebugString("pulBlockAddress = %x.\n",(ULONG)pulBlockAddress);
0018c e59d1000 ldr r1, [sp]
00190 e59f003c ldr r0, [pc, #0x3C]
00194 eb000000 bl EdbgOutputDebugString
; 435 : EdbgOutputDebugString("*pulBlockAddress = %x.\n",(ULONG)*pulBlockAddress);
00198 e59d3000 ldr r3, [sp]
0019c e59f002c ldr r0, [pc, #0x2C]
001a0 e5931000 ldr r1, [r3]
001a4 eb000000 bl EdbgOutputDebugString
; 436 : *pulBlockAddress = FLASH_READ_STATUS;
001a8 e59d3000 ldr r3, [sp]
001ac e3a00607 mov r0, #7, 12
001b0 e3800070 orr r0, r0, #0x70
001b4 e5830000 str r0, [r3]
; 437 : EdbgOutputDebugString("*FLASH_READ_STATUS pulBlockAddress = %x.\n",(ULONG)*pulBlockAddress);
001b8 e59d0000 ldr r0, [sp]
001bc e5901000 ldr r1, [r0]
001c0 e59f0004 ldr r0, [pc, #4]
001c4 eb000000 bl EdbgOutputDebugString
001c8 |$L36684|
; 438 : while(1);
001c8 eafffffe b |$L36684|
001cc |$L36790|
001cc 00000000 DCD |??_C@_0CK@GEFO@?$CKFLASH_READ_STATUS?5pulBlockAddre@|
001d0 00000000 DCD |??_C@_0BI@IGBC@?$CKpulBlockAddress?5?$DN?5?$CFx?4?6?$AA@|
001d4 00000000 DCD |??_C@_0BI@EAHE@pulBlockAddress?5?5?$DN?5?$CFx?4?6?$AA@|
001d8 00000000 DCD |??_C@_0CG@BLFF@FLASH_BLOCK_PROGRAM_RESUME?5?9?5Fai@|
001dc 00000000 DCD |??_C@_0CB@EOBJ@FLASH_WRITE_TO_BUFFER?5?9?5Failed?6?4@|
001e0 00000000 DCD |??_C@_01PJCK@?4?$AA@|
001e4 0003ffff DCD 0x3ffff
001e8 |$M36787|
ENDP ; |WriteFlashJ3_2x16|
EXPORT |??_C@_0BH@OAPH@?$CKpFlash?5?5?5?5?5?5?5?5?$DN?5?$CFx?5?4?6?$AA@| [ DATA ] ; `string'
00000 AREA |.text| { |WaitForReady| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$WaitForReady|, PDATA, SELECTION=5, ASSOC=|.text| { |WaitForReady| } ; comdat associative
|$T36804| DCD |WaitForReady|
DCD 0x40001801
00000 AREA |.rdata| { |??_C@_0BH@OAPH@?$CKpFlash?5?5?5?5?5?5?5?5?$DN?5?$CFx?5?4?6?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0BH@OAPH@?$CKpFlash?5?5?5?5?5?5?5?5?$DN?5?$CFx?5?4?6?$AA@| DCB "*p"
DCB "Flash = %x .", 0xa, 0x0 ; `string'
; Function compile flags: /Ogsy
00000 AREA |.text| { |WaitForReady| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |WaitForReady| PROC
; 460 : {
00000 e92d41f0 stmdb sp!, {r4 - r8, lr}
00004 |$M36802|
00004 e1a07000 mov r7, r0
00008 e1a06001 mov r6, r1
0000c e1a04002 mov r4, r2
; 461 : ULONG ulStart;
; 462 : ULONG ulCurrent;
; 463 : BOOL bSuccess = FALSE;
00010 e3a08000 mov r8, #0
; 464 :
; 465 : ulStart = GetSystemTimeInMsec();
00014 eb000000 bl GetSystemTimeInMsec
00018 e1a05000 mov r5, r0
0001c |$L36696|
; 466 : do
; 467 : {
; 468 : //
; 469 : // See if there are errors.
; 470 : //
; 471 : if((*pFlash & ulBitField)== ulBitField)
0001c e5970000 ldr r0, [r7]
00020 e0001004 and r1, r0, r4
00024 e1510004 cmp r1, r4
00028 0a000009 beq |$L36794|
; 474 : break;
; 475 : }
; 476 :
; 477 : //
; 478 : // Get the current time.
; 479 : //
; 480 : ulCurrent = GetSystemTimeInMsec();
0002c eb000000 bl GetSystemTimeInMsec
; 481 : } while(ulCurrent<ulStart + ulTimeoutInMsec);
00030 e0853006 add r3, r5, r6
00034 e1500003 cmp r0, r3
00038 3afffff7 bcc |$L36696|
; 484 : {
; 485 : EdbgOutputDebugString("*pFlash = %x .\n",(ULONG)*pFlash);
0003c e5971000 ldr r1, [r7]
00040 e59f0014 ldr r0, [pc, #0x14]
00044 eb000000 bl EdbgOutputDebugString
00048 |$L36700|
; 486 : }
; 487 :
; 488 : return bSuccess;
00048 e1a00008 mov r0, r8
; 489 : }
0004c e8bd41f0 ldmia sp!, {r4 - r8, lr}
00050 e12fff1e bx lr
00054 |$L36794|
; 472 : {
; 473 : bSuccess = TRUE;
00054 e3a08001 mov r8, #1
; 482 :
; 483 : if(!bSuccess)
00058 eafffffa b |$L36700|
0005c |$L36806|
0005c 00000000 DCD |??_C@_0BH@OAPH@?$CKpFlash?5?5?5?5?5?5?5?5?$DN?5?$CFx?5?4?6?$AA@|
00060 |$M36803|
ENDP ; |WaitForReady|
END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -