📄 usbdown.txt
字号:
;;;165 rEP3_DMA_TTC_H=0xf;
;;;166 }
;;;167 }
;;;168 else
;;;169 {
;;;170 rDIDST2=(downloadAddress_u+0x80000-8); //for 1st autoreload.
;;;171 rDIDSTC2=(0<<1)|(0<<0);
;;;172 rDCON2=rDCON2&~(0xfffff)|(downloadFileSize-0x80000);
;;;173
;;;174 while(rEP3_DMA_TTC<0xfffff)
;;;175 {
;;;176 rEP3_DMA_TTC_L=0xff;
;;;177 rEP3_DMA_TTC_M=0xff;
;;;178 rEP3_DMA_TTC_H=0xf;
;;;179 }
;;;180 }
;;;181 }
;;;182 totalDmaCount=0;
;;;183 }
;;;184 else
;;;185 {
;;;186 totalDmaCount=downloadFileSize;
;;;187 }
;;;188 #endif
;;;189
;;;190 //Uart_Printf("\nNow, Downloading [ADDRESS:%xh,TOTAL:%d]\n",
;;;191 // downloadAddress_u,downloadFileSize);
;;;192 //Uart_Printf("RECEIVED FILE SIZE:%8d",0);
;;;193
;;;194 #if USBDMA
;;;195 j=0x10000;
;;;196
;;;197 while(1)
;;;198 {
;;;199 if( (rDCDST2-(U32)downloadAddress_u+8)>=j)
;;;200 {
;;;201 Uart_Printf("\b\b\b\b\b\b\b\b%8d",j);
;;;202 j+=0x10000;
;;;203 }
;;;204 if(totalDmaCount>=downloadFileSize)break;
;;;205 }
;;;206
;;;207 #else
;;;208 j=0x10000;
000590 e3a04b40 MOV r4,#0x10000
;;;209
;;;210 while(((U32)downPt-downloadAddress_u)<(downloadFileSize-8))
000594 e1a00000 NOP
|L1.1432|
000598 e51f02e4 LDR r0,|L1.700|
00059c e5900000 LDR r0,[r0,#0] ; downPt
0005a0 e51f12f0 LDR r1,|L1.696|
0005a4 e5911000 LDR r1,[r1,#0] ; downloadAddress_u
0005a8 e0400001 SUB r0,r0,r1
0005ac e51f12f4 LDR r1,|L1.704|
0005b0 e5911000 LDR r1,[r1,#0] ; downloadFileSize
0005b4 e2411008 SUB r1,r1,#8
0005b8 e1500001 CMP r0,r1
0005bc 2a00000b BCS |L1.1520|
;;;211 {
;;;212 if( ((U32)downPt-downloadAddress_u)>=j)
0005c0 e51f030c LDR r0,|L1.700|
0005c4 e5900000 LDR r0,[r0,#0] ; downPt
0005c8 e51f1318 LDR r1,|L1.696|
0005cc e5911000 LDR r1,[r1,#0] ; downloadAddress_u
0005d0 e0400001 SUB r0,r0,r1
0005d4 e1500004 CMP r0,r4
0005d8 3a000003 BCC |L1.1516|
;;;213 {
;;;214 Uart_Printf("\b\b\b\b\b\b\b\b%8d",j);
0005dc e1a01004 MOV r1,r4
0005e0 e24f0f97 ADR r0,|L1.908|
0005e4 ebfffffe BL _printf
;;;215 j+=0x10000;
0005e8 e2844b40 ADD r4,r4,#0x10000
;;;216 }
;;;217 }
|L1.1516|
0005ec eaffffe9 B |L1.1432|
;;;218 #endif
;;;219
;;;220
;;;221 time=Timer_StopEx();
|L1.1520|
0005f0 ebfffffe BL Timer_StopEx
0005f4 e1a06000 MOV r6,r0
;;;222 Uart_Printf("\b\b\b\b\b\b\b\b%8d",downloadFileSize);
0005f8 e51f0340 LDR r0,|L1.704|
0005fc e5901000 LDR r1,[r0,#0] ; downloadFileSize
000600 e24f0f9f ADR r0,|L1.908|
000604 ebfffffe BL _printf
;;;223 Uart_Printf("(%5.1fKB/S,%3.1fS)\n",(float)(downloadFileSize/time/1000.),time);
000608 e1a00006 MOV r0,r6
00060c ebfffffe BL _f2d
000610 e58d0018 STR r0,[sp,#0x18]
000614 e58d101c STR r1,[sp,#0x1c]
000618 e51f0360 LDR r0,|L1.704|
00061c e5900000 LDR r0,[r0,#0] ; downloadFileSize
000620 ebfffffe BL _ffltu
000624 e1a09000 MOV r9,r0
000628 e1a01006 MOV r1,r6
00062c ebfffffe BL _fdiv
000630 e1a08000 MOV r8,r0
000634 ebfffffe BL _f2d
000638 e88d0003 STMIA sp,{r0,r1}
00063c e24f0fab ADR r0,|L1.920|
000640 e890000c LDMIA r0,{r2,r3}
000644 e59d0000 LDR r0,[sp,#0]
000648 ebfffffe BL _ddiv
00064c e58d0008 STR r0,[sp,#8]
000650 e58d100c STR r1,[sp,#0xc]
000654 ebfffffe BL _d2f
000658 e1a07000 MOV r7,r0
00065c ebfffffe BL _f2d
000660 e58d0010 STR r0,[sp,#0x10]
000664 e58d1014 STR r1,[sp,#0x14]
000668 e59d001c LDR r0,[sp,#0x1c]
00066c e58d0000 STR r0,[sp,#0]
000670 e1a02001 MOV r2,r1
000674 e24f0fb7 ADR r0,|L1.928|
000678 e59d1010 LDR r1,[sp,#0x10]
00067c e59d3018 LDR r3,[sp,#0x18]
000680 ebfffffe BL printf
;;;224
;;;225 #if USBDMA
;;;226 /*******************************/
;;;227 /* Verify check sum */
;;;228 /*******************************/
;;;229
;;;230 Uart_Printf("Now, Checksum calculation\n");
;;;231
;;;232 cs=0;
;;;233 i=(downloadAddress_u);
;;;234 j=(downloadAddress_u+downloadFileSize-10)&0xfffffffc;
;;;235 while(i<j)
;;;236 {
;;;237 temp=*((U32 *)i);
;;;238 i+=4;
;;;239 cs+=(U16)(temp&0xff);
;;;240 cs+=(U16)((temp&0xff00)>>8);
;;;241 cs+=(U16)((temp&0xff0000)>>16);
;;;242 cs+=(U16)((temp&0xff000000)>>24);
;;;243 }
;;;244
;;;245 i=(downloadAddress_u+downloadFileSize-10)&0xfffffffc;
;;;246 j=(downloadAddress_u+downloadFileSize-10);
;;;247 while(i<j)
;;;248 {
;;;249 cs+=*((U8 *)i++);
;;;250 }
;;;251
;;;252 checkSum=cs;
;;;253 #else
;;;254 //checkSum was calculated including dnCS. So, dnCS should be subtracted.
;;;255 checkSum=checkSum - *((unsigned char *)(downloadAddress_u+downloadFileSize-8-2))
000684 e51f03d4 LDR r0,|L1.696|
000688 e5900000 LDR r0,[r0,#0] ; downloadAddress_u
00068c e51f13d4 LDR r1,|L1.704|
000690 e5911000 LDR r1,[r1,#0] ; downloadFileSize
000694 e0800001 ADD r0,r0,r1
000698 e550000a LDRB r0,[r0,#-0xa]
00069c e51f13f0 LDR r1,|L1.692|
0006a0 e1d110b0 LDRH r1,[r1,#0] ; checkSum
0006a4 e0410000 SUB r0,r1,r0
0006a8 e51f13f8 LDR r1,|L1.696|
0006ac e5911000 LDR r1,[r1,#0] ; downloadAddress_u
0006b0 e51f23f8 LDR r2,|L1.704|
0006b4 e5922000 LDR r2,[r2,#0] ; downloadFileSize
0006b8 e0811002 ADD r1,r1,r2
0006bc e5511009 LDRB r1,[r1,#-9]
0006c0 e0400001 SUB r0,r0,r1
0006c4 e51f1418 LDR r1,|L1.692|
0006c8 e1c100b0 STRH r0,[r1,#0] ; checkSum
;;;256 - *( (unsigned char *)(downloadAddress_u+downloadFileSize-8-1) );
;;;257 #endif
;;;258
;;;259 dnCS=*((unsigned char *)(downloadAddress_u+downloadFileSize-8-2))+
0006cc e51f041c LDR r0,|L1.696|
0006d0 e5900000 LDR r0,[r0,#0] ; downloadAddress_u
0006d4 e51f141c LDR r1,|L1.704|
0006d8 e5911000 LDR r1,[r1,#0] ; downloadFileSize
0006dc e0800001 ADD r0,r0,r1
0006e0 e550000a LDRB r0,[r0,#-0xa]
0006e4 e51f1434 LDR r1,|L1.696|
0006e8 e5911000 LDR r1,[r1,#0] ; downloadAddress_u
0006ec e51f2434 LDR r2,|L1.704|
0006f0 e5922000 LDR r2,[r2,#0] ; downloadFileSize
0006f4 e0811002 ADD r1,r1,r2
0006f8 e5511009 LDRB r1,[r1,#-9]
0006fc e0800401 ADD r0,r0,r1,LSL #8
000700 e3c05b40 BIC r5,r0,#0x10000
;;;260 (*( (unsigned char *)(downloadAddress_u+downloadFileSize-8-1) )<<8);
;;;261
;;;262 download_end=1;
000704 e3a00001 MOV r0,#1
000708 e51f135c LDR r1,|L1.948|
00070c e5810000 STR r0,[r1,#0] ; download_end
;;;263 if(checkSum!=dnCS)
000710 e51f0464 LDR r0,|L1.692|
000714 e1d000b0 LDRH r0,[r0,#0] ; checkSum
000718 e1500005 CMP r0,r5
00071c 0a000006 BEQ |L1.1852|
;;;264 {
;;;265 Uart_Printf("Checksum Error!!! MEM:%x DN:%x\n",checkSum,dnCS);
000720 e1a02005 MOV r2,r5
000724 e51f0478 LDR r0,|L1.692|
000728 e1d010b0 LDRH r1,[r0,#0] ; checkSum
00072c e24f0fdf ADR r0,|L1.952|
000730 ebfffffe BL _printf
;;;266 return;
;;;267 }
;;;268
;;;269 Uart_Printf("Download O.K.\n\n");
;;;270 // Uart_TxEmpty(consoleNum);
;;;271
;;;272
;;;273
;;;274 }
|L1.1844|
000734 e28dd030 ADD sp,sp,#0x30
000738 e8bd87f0 LDMFD sp!,{r4-r10,pc}
|L1.1852|
00073c e24f0fd8 ADR r0,|L1.996| ;269
000740 ebfffffe BL _printf ;269
000744 eafffffa B |L1.1844|
|L1.1864|
000748 40200000 DCD 0x40200000
|L1.1868|
00074c 00000000 DCD IsrUsbd
|L1.1872|
000750 13fff000 DCD 0x13fff000
|L1.1876|
000754 00000000 DCD IsrDma2
|L1.1880|
000758 12000100 DCD 0x12000100
|L1.1884|
00075c 00000000 DCD ||.constdata$1||
|L1.1888|
000760 74696157 DCB "Wait"
000764 726f6620 DCB " for"
000768 776f6420 DCB " dow"
00076c 616f6c6e DCB "nloa"
000770 000a2164 DCB "d!\n\0"
ENDP
MPEG_Download PROC
;;;67 void MPEG_Download(void)
;;;68 {
000774 e92d4008 STMFD sp!,{r3,lr}
;;;69 Isr_Init1();
000778 ebfffffe BL Isr_Init1
;;;70
;;;71 rINTMSK&=~(BIT_USBD);
00077c e51f003c LDR r0,|L1.1864|
000780 e5900008 LDR r0,[r0,#8]
000784 e3c00780 BIC r0,r0,#0x2000000
000788 e51f1048 LDR r1,|L1.1864|
00078c e5810008 STR r0,[r1,#8]
;;;72
;;;73 download_end=0;
000790 e3a00000 MOV r0,#0
000794 e51f13e8 LDR r1,|L1.948|
000798 e5810000 STR r0,[r1,#0] ; download_end
;;;74 Uart_Printf("/----MPEG raw data download.----/\n");
00079c e28f003c ADR r0,|L1.2016|
0007a0 ebfffffe BL _printf
;;;75 while(1)
0007a4 e1a00000 NOP
|L1.1960|
0007a8 e1a00000 NOP
;;;76 {
;;;77 MPEG_WaitDownload();
0007ac ebfffffe BL MPEG_WaitDownload
;;;78 if(download_end==1) break;
0007b0 e51f0404 LDR r0,|L1.948|
0007b4 e5900000 LDR r0,[r0,#0] ; download_end
0007b8 e3500001 CMP r0,#1
0007bc 1a000000 BNE |L1.1988|
0007c0 ea000000 B |L1.1992|
;;;79 }
|L1.1988|
0007c4 eafffff7 B |L1.1960|
;;;80 rINTMSK |= (BIT_USBD);
|L1.1992|
0007c8 e51f0088 LDR r0,|L1.1864|
0007cc e5900008 LDR r0,[r0,#8]
0007d0 e3800780 ORR r0,r0,#0x2000000
0007d4 e51f1094 LDR r1,|L1.1864|
0007d8 e5810008 STR r0,[r1,#8]
;;;81 }
0007dc e8bd8008 LDMFD sp!,{r3,pc}
|L1.2016|
0007e0 2d2d2d2f DCB "/---"
0007e4 45504d2d DCB "-MPE"
0007e8 61722047 DCB "G ra"
0007ec 61642077 DCB "w da"
0007f0 64206174 DCB "ta d"
0007f4 6c6e776f DCB "ownl"
0007f8 2e64616f DCB "oad."
0007fc 2d2d2d2d DCB "----"
000800 00000a2f DCB "/\n\0\0"
ENDP
AREA ||.constdata||, DATA, READONLY, ALIGN=2
||.constdata$1||
DCB 0x44,0x6f,0x77,0x6e
DCB 0x6c,0x6f,0x61,0x64
DCB 0x20,0x66,0x69,0x6c
DCB 0x65,0x20,0x2e,0x2f
DCB 0x62,0x6d,0x70,0x2f
DCB 0x6d,0x6f,0x62,0x69
DCB 0x6c,0x65,0x5f,0x32
DCB 0x30,0x66,0x72,0x61
DCB 0x6d,0x65,0x5f,0x33
DCB 0x51,0x70,0x2e,0x63
DCB 0x69,0x66,0x20,0x75
DCB 0x73,0x69,0x6e,0x67
DCB 0x20,0x74,0x68,0x65
DCB 0x20,0x54,0x52,0x41
DCB 0x4e,0x53,0x4d,0x49
DCB 0x54,0x20,0x6f,0x66
DCB 0x20,0x55,0x53,0x42
DCB 0x20,0x70,0x6f,0x72
DCB 0x74,0x0a,0x00
DCB 0x00
AREA ||.bss||, NOINIT, ALIGN=2
err
||.bss$2||
% 4
download_run
% 4
menuUsed
% 4
downloadAddress_u
% 4
downPt
% 4
downloadFileSize
% 4
checkSum
% 4
totalDmaCount
% 4
isUsbdSetConfiguration
% 4
download_end
% 4
tempdownloadAddress
% 4
END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -