📄 strata16.txt
字号:
0004e0 203a205d DCB "] : "
0004e4 00000000 DCB "\0\0\0\0"
|L1.1256|
0004e8 0000000c DCD ||.bss$2|| + 12
|L1.1260|
0004ec 00000014 DCD ||.bss$2|| + 20
|L1.1264|
0004f0 75706e49 DCB "Inpu"
0004f4 61742074 DCB "t ta"
0004f8 74656772 DCB "rget"
0004fc 7a697320 DCB " siz"
000500 305b2065 DCB "e [0"
000504 205d3f78 DCB "x?] "
000508 0000203a DCB ": \0\0"
ENDP
Program28F256K3_16Bit PROC
;;;234 void Program28F256K3_16Bit(void)
;;;235 {
00050c e92d4038 STMFD sp!,{r3-r5,lr}
;;;236 // FlashROM write program must reside at RAM region NOT ROM region
;;;237 // In reading and writing all interrupts are disabled because the flash ROM
;;;238 // strongly dislike to be disturbed by other stuff.
;;;239 // And the region of flash ROM must be I/O region which means NO cacheable
;;;240 // and NO bufferable in MMU. Check it out !!!
;;;241 // 2001.6.18. Mon. It's local rain. I'll hope it eliminates the drought in Korea. by chc
;;;242
;;;243 unsigned long interrupt_reservoir;
;;;244 int i;
;;;245
;;;246
;;;247 Uart_Printf("\n[ 28F128J3A-16bit Flash Writing Program ]\n\n");
000510 e28f0f48 ADR r0,|L1.1592|
000514 ebfffffe BL _printf
;;;248
;;;249 rSROM_BW=rSROM_BW&~(1<<9);
000518 e59f0148 LDR r0,|L1.1640|
00051c e5900000 LDR r0,[r0,#0]
000520 e3c00f80 BIC r0,r0,#0x200
000524 e59f113c LDR r1,|L1.1640|
000528 e5810000 STR r0,[r1,#0]
;;;250 rSROM_BW=(rSROM_BW&~(0x40))|(0x1<<6);
00052c e1a00001 MOV r0,r1
000530 e5900000 LDR r0,[r0,#0]
000534 e3800040 ORR r0,r0,#0x40
000538 e5810000 STR r0,[r1,#0]
;;;251
;;;252 rINTMSK = BIT_ALLMSK;
00053c e3e00000 MVN r0,#0
000540 e24118a2 SUB r1,r1,#0xa20000
000544 e5810008 STR r0,[r1,#8]
;;;253 targetAddress=TARGET_ADDR_28F128;
000548 e3a00680 MOV r0,#0x8000000
00054c e51f1518 LDR r1,|L1.60|
000550 e5810000 STR r0,[r1,#0] ; targetAddress
;;;254 targetSize=downloadProgramSize;
000554 e51f00c4 LDR r0,|L1.1176|
000558 e5900000 LDR r0,[r0,#0] ; downloadProgramSize
00055c e51f1078 LDR r1,|L1.1260|
000560 e5810000 STR r0,[r1,#0] ; targetSize
;;;255
;;;256 Uart_Printf("Src size=%x\n",targetSize);
000564 e51f0080 LDR r0,|L1.1260|
000568 e5901000 LDR r1,[r0,#0] ; targetSize
00056c e28f00f8 ADR r0,|L1.1644|
000570 ebfffffe BL _printf
;;;257
;;;258 if(targetSize==0)
000574 e51f0090 LDR r0,|L1.1260|
000578 e5900000 LDR r0,[r0,#0] ; targetSize
00057c e3500000 CMP r0,#0
000580 1a000006 BNE |L1.1440|
;;;259 {
;;;260 Uart_Printf("\nThe data must be downloaded using ICE or USB from 0x11000000\n");
000584 e28f00f0 ADR r0,|L1.1660|
000588 ebfffffe BL _printf
;;;261 srcAddress=downloadAddress;
00058c e59f0128 LDR r0,|L1.1724|
000590 e5900000 LDR r0,[r0,#0] ; downloadAddress
000594 e59f1124 LDR r1,|L1.1728|
000598 e5810000 STR r0,[r1,#0] ; srcAddress
00059c ea000004 B |L1.1460|
;;;262 }
;;;263 else
;;;264 {
;;;265 srcAddress=downloadAddress+4; //to discard the data head for the size
|L1.1440|
0005a0 e59f0114 LDR r0,|L1.1724|
0005a4 e5900000 LDR r0,[r0,#0] ; downloadAddress
0005a8 e2800004 ADD r0,r0,#4
0005ac e59f110c LDR r1,|L1.1728|
0005b0 e5810000 STR r0,[r1,#0] ; srcAddress
;;;266 }
;;;267
;;;268 InputAddresses(); //srcAddress,targetSize,targetOffset will be determined.
|L1.1460|
0005b4 ebfffffe BL InputAddresses
;;;269 Uart_Printf("Source base address(0x11000000) = 0x%x\n",srcAddress);
0005b8 e59f0100 LDR r0,|L1.1728|
0005bc e5901000 LDR r1,[r0,#0] ; srcAddress
0005c0 e28f00fc ADR r0,|L1.1732|
0005c4 ebfffffe BL _printf
;;;270 Uart_Printf("Target base address(0x08000000) = 0x%x\n",targetAddress);
0005c8 e51f0594 LDR r0,|L1.60|
0005cc e5901000 LDR r1,[r0,#0] ; targetAddress
0005d0 e28f0f45 ADR r0,|L1.1772|
0005d4 ebfffffe BL _printf
;;;271 Uart_Printf("Target offset (0x0) = 0x%x\n",targetOffset);
0005d8 e51f00f8 LDR r0,|L1.1256|
0005dc e5901000 LDR r1,[r0,#0] ; targetOffset
0005e0 e28f0f4b ADR r0,|L1.1812|
0005e4 ebfffffe BL _printf
;;;272 Uart_Printf("Target size (0x20000*n) = 0x%x\n",targetSize);
0005e8 e51f0104 LDR r0,|L1.1260|
0005ec e5901000 LDR r1,[r0,#0] ; targetSize
0005f0 e28f0f51 ADR r0,|L1.1852|
0005f4 ebfffffe BL _printf
;;;273
;;;274 if ( (Strata_CheckID(targetAddress) & 0xffff) != 0x0089) // ID number = 0x0089
0005f8 e51f05c4 LDR r0,|L1.60|
0005fc e5900000 LDR r0,[r0,#0] ; targetAddress
000600 ebfffffe BL Strata_CheckID
000604 e1a00800 MOV r0,r0,LSL #16
000608 e1a00820 MOV r0,r0,LSR #16
00060c e3500089 CMP r0,#0x89
000610 0a00005c BEQ |L1.1928|
;;;275 {
;;;276 Uart_Printf("Identification check error(%x)!!\n",Strata_CheckID(targetAddress) & 0xffff);
000614 e51f05e0 LDR r0,|L1.60|
000618 e5900000 LDR r0,[r0,#0] ; targetAddress
00061c ebfffffe BL Strata_CheckID
000620 e1a05800 MOV r5,r0,LSL #16
000624 e1a05825 MOV r5,r5,LSR #16
000628 e1a01005 MOV r1,r5
00062c e28f0f4c ADR r0,|L1.1892|
000630 ebfffffe BL _printf
;;;277 return ;
;;;278 }
;;;279
;;;280 if ( (Strata_CheckDevice(targetAddress) & 0xffff) != 0x8803) // Device number=0x0018 0x8803
;;;281 {
;;;282 Uart_Printf("Device check error !!\n");
;;;283 return ;
;;;284 }
;;;285
;;;286 for(i=0;i<targetSize;i+=0x10000)
;;;287 {
;;;288 Strata_ClearBlockLock(targetAddress+targetOffset+i);
;;;289 Strata_EraseSector(targetAddress+targetOffset+i);
;;;290 }
;;;291
;;;292 Uart_Printf("\nErase the sector : 0x%x.\n", targetAddress);
;;;293
;;;294 if(!Strata_BlankCheck(targetAddress+targetOffset,targetSize))
;;;295 {
;;;296 Uart_Printf("Blank Check Error!!!\n");
;;;297 return;
;;;298 }
;;;299
;;;300 Uart_Printf("\nStart of the data writing...\n");
;;;301
;;;302 for (i=0; i<targetSize; i+=2)
;;;303 {
;;;304 Strata_ProgFlash(i+targetAddress+targetOffset, *((U16 *)(srcAddress+i)));
;;;305 if(i%0x10000==0xfffc)
;;;306 Uart_Printf("[%x]",(i+4)/0x10000);
;;;307 }
;;;308 Uart_Printf("\nEnd of the data writing \n");
;;;309
;;;310 _RESET();
;;;311
;;;312
;;;313 Uart_Printf("Verifying Start...\n");
;;;314 for (i=0; i<targetSize; i+=2)
;;;315 {
;;;316 if (*((U16 *)(i+targetAddress+targetOffset)) !=*((U16 *)(i+srcAddress)))
;;;317 {
;;;318 Uart_Printf("verify error src %08x = %04x\n", srcAddress+i, *((U16 *)(srcAddress+i)));
;;;319 Uart_Printf("verify error des %08x = %04x\n", i+targetAddress+targetOffset, *((U16 *)(i+targetAddress)));
;;;320 return;
;;;321 }
;;;322 }
;;;323 // PageModeTest();
;;;324
;;;325 Uart_Printf("Verifying End!!!");
;;;326 }
|L1.1588|
000634 e8bd8038 LDMFD sp!,{r3-r5,pc}
|L1.1592|
000638 32205b0a DCB "\n[ 2"
00063c 32314638 DCB "8F12"
000640 41334a38 DCB "8J3A"
000644 6236312d DCB "-16b"
000648 46207469 DCB "it F"
00064c 6873616c DCB "lash"
000650 69725720 DCB " Wri"
000654 676e6974 DCB "ting"
000658 6f725020 DCB " Pro"
00065c 6d617267 DCB "gram"
000660 0a0a5d20 DCB " ]\n\n"
000664 00000000 DCB "\0\0\0\0"
|L1.1640|
000668 40c20000 DCD 0x40c20000
|L1.1644|
00066c 20637253 DCB "Src "
000670 657a6973 DCB "size"
000674 0a78253d DCB "=%x\n"
000678 00000000 DCB "\0\0\0\0"
|L1.1660|
00067c 6568540a DCB "\nThe"
000680 74616420 DCB " dat"
000684 756d2061 DCB "a mu"
000688 62207473 DCB "st b"
00068c 6f642065 DCB "e do"
000690 6f6c6e77 DCB "wnlo"
000694 64656461 DCB "aded"
000698 69737520 DCB " usi"
00069c 4920676e DCB "ng I"
0006a0 6f204543 DCB "CE o"
0006a4 53552072 DCB "r US"
0006a8 72662042 DCB "B fr"
0006ac 30206d6f DCB "om 0"
0006b0 30313178 DCB "x110"
0006b4 30303030 DCB "0000"
0006b8 00000a30 DCB "0\n\0\0"
|L1.1724|
0006bc 00000000 DCD downloadAddress
|L1.1728|
0006c0 00000008 DCD ||.bss$2|| + 8
|L1.1732|
0006c4 72756f53 DCB "Sour"
0006c8 62206563 DCB "ce b"
0006cc 20657361 DCB "ase "
0006d0 72646461 DCB "addr"
0006d4 28737365 DCB "ess("
0006d8 31317830 DCB "0x11"
0006dc 30303030 DCB "0000"
0006e0 20293030 DCB "00) "
0006e4 7830203d DCB "= 0x"
0006e8 000a7825 DCB "%x\n\0"
|L1.1772|
0006ec 67726154 DCB "Targ"
0006f0 62207465 DCB "et b"
0006f4 20657361 DCB "ase "
0006f8 72646461 DCB "addr"
0006fc 28737365 DCB "ess("
000700 38307830 DCB "0x08"
000704 30303030 DCB "0000"
000708 20293030 DCB "00) "
00070c 7830203d DCB "= 0x"
000710 000a7825 DCB "%x\n\0"
|L1.1812|
000714 67726154 DCB "Targ"
000718 6f207465 DCB "et o"
00071c 65736666 DCB "ffse"
000720 20202074 DCB "t "
000724 28202020 DCB " ("
000728 29307830 DCB "0x0)"
00072c 20202020 DCB " "
000730 20202020 DCB " "
000734 7830203d DCB "= 0x"
000738 000a7825 DCB "%x\n\0"
|L1.1852|
00073c 67726154 DCB "Targ"
000740 73207465 DCB "et s"
000744 20657a69 DCB "ize "
000748 20202020 DCB " "
00074c 28202020 DCB " ("
000750 30327830 DCB "0x20"
000754 2a303030 DCB "000*"
000758 2020296e DCB "n) "
00075c 7830203d DCB "= 0x"
000760 000a7825 DCB "%x\n\0"
|L1.1892|
000764 6e656449 DCB "Iden"
000768 69666974 DCB "tifi"
00076c 69746163 DCB "cati"
000770 63206e6f DCB "on c"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -