📄 usbdown.txt
字号:
000294 0a00004f BEQ |L1.984|
;;;456 {
;;;457 Uart_Printf("Checksum Error!!! MEM:%x DN:%x\n",checkSum,dnCS);
000298 e1a02005 MOV r2,r5
00029c e59f0010 LDR r0,|L1.692|
0002a0 e1d010b0 LDRH r1,[r0,#0] ; checkSum
0002a4 e28f0f43 ADR r0,|L1.952|
0002a8 ebfffffe BL _printf
;;;458 return;
;;;459 }
;;;460
;;;461 Uart_Printf("Download O.K.\n\n");
;;;462 // Uart_TxEmpty(consoleNum);
;;;463
;;;464
;;;465
;;;466 }
|L1.684|
0002ac e28dd030 ADD sp,sp,#0x30
0002b0 e8bd87f0 LDMFD sp!,{r4-r10,pc}
|L1.692|
0002b4 00000018 DCD ||.bss$2|| + 24
|L1.696|
0002b8 0000000c DCD ||.bss$2|| + 12
|L1.700|
0002bc 00000010 DCD ||.bss$2|| + 16
|L1.704|
0002c0 00000014 DCD ||.bss$2|| + 20
|L1.708|
0002c4 65746e45 DCB "Ente"
0002c8 20612072 DCB "r a "
0002cc 2077656e DCB "new "
0002d0 706d6574 DCB "temp"
0002d4 7261726f DCB "orar"
0002d8 6f642079 DCB "y do"
0002dc 6f6c6e77 DCB "wnlo"
0002e0 61206461 DCB "ad a"
0002e4 65726464 DCB "ddre"
0002e8 30287373 DCB "ss(0"
0002ec 2e2e3178 DCB "x1.."
0002f0 003a292e DCB ".):\0"
|L1.756|
0002f4 00000028 DCD ||.bss$2|| + 40
|L1.760|
0002f8 00000004 DCD ||.bss$2|| + 4
|L1.764|
0002fc 69615720 DCB " Wai"
000300 676e6974 DCB "ting"
000304 64206120 DCB " a d"
000308 6c6e776f DCB "ownl"
00030c 2e64616f DCB "oad."
000310 0000000a DCB "\n\0\0\0"
|L1.788|
000314 776f6420 DCB " dow"
000318 616f6c6e DCB "nloa"
00031c 64612064 DCB "d ad"
000320 73657264 DCB "dres"
000324 30203a73 DCB "s: 0"
000328 2c782578 DCB "x%x,"
00032c 776f6420 DCB " dow"
000330 616f6c6e DCB "nloa"
000334 69662064 DCB "d fi"
000338 7320656c DCB "le s"
00033c 3a657a69 DCB "ize:"
000340 25783020 DCB " 0x%"
000344 000a0a78 DCB "x\n\n\0"
|L1.840|
000348 776f4e0a DCB "\nNow"
00034c 6f44202c DCB ", Do"
000350 6f6c6e77 DCB "wnlo"
000354 6e696461 DCB "adin"
000358 415b2067 DCB "g [A"
00035c 45524444 DCB "DDRE"
000360 253a5353 DCB "SS:%"
000364 542c6878 DCB "xh,T"
000368 4c41544f DCB "OTAL"
00036c 5d64253a DCB ":%d]"
000370 0000000a DCB "\n\0\0\0"
|L1.884|
000374 45434552 DCB "RECE"
000378 44455649 DCB "IVED"
00037c 4c494620 DCB " FIL"
000380 49532045 DCB "E SI"
000384 253a455a DCB "ZE:%"
000388 00006438 DCB "8d\0\0"
|L1.908|
00038c 08080808 DCB "\b\b\b\b"
000390 08080808 DCB "\b\b\b\b"
000394 00643825 DCB "%8d\0"
|L1.920|
000398 00000000 DCFD 0x408f400000000000 ; 1000.
00039c 408f4000
|L1.928|
0003a0 2e352528 DCB "(%5."
0003a4 424b6631 DCB "1fKB"
0003a8 252c532f DCB "/S,%"
0003ac 66312e33 DCB "3.1f"
0003b0 000a2953 DCB "S)\n\0"
|L1.948|
0003b4 00000024 DCD ||.bss$2|| + 36
|L1.952|
0003b8 63656843 DCB "Chec"
0003bc 6d75736b DCB "ksum"
0003c0 72724520 DCB " Err"
0003c4 2121726f DCB "or!!"
0003c8 454d2021 DCB "! ME"
0003cc 78253a4d DCB "M:%x"
0003d0 3a4e4420 DCB " DN:"
0003d4 000a7825 DCB "%x\n\0"
|L1.984|
0003d8 e28f0004 ADR r0,|L1.996| ;461
0003dc ebfffffe BL _printf ;461
0003e0 eaffffb1 B |L1.684|
|L1.996|
0003e4 6e776f44 DCB "Down"
0003e8 64616f6c DCB "load"
0003ec 4b2e4f20 DCB " O.K"
0003f0 000a0a2e DCB ".\n\n\0"
ENDP
Isr_Init1 PROC
;;;471 void Isr_Init1(void)
;;;472 {
0003f4 e3a00000 MOV r0,#0
;;;473 // pISR_UNDEF=(unsigned)HaltUndef;
;;;474 // pISR_SWI =(unsigned)HaltSwi;
;;;475 // pISR_PABORT=(unsigned)HaltPabort;
;;;476 // pISR_DABORT=(unsigned)HaltDabort;
;;;477 rINTMOD=0x0; // All=IRQ mode
0003f8 e59f1348 LDR r1,|L1.1864|
0003fc e5810004 STR r0,[r1,#4]
;;;478 rINTMSK=BIT_ALLMSK; // All interrupt is masked.
000400 e3e00000 MVN r0,#0
000404 e0011000 AND r1,r1,r0
000408 e5810008 STR r0,[r1,#8]
;;;479
;;;480 //pISR_URXD0=(unsigned)Uart0_RxInt;
;;;481 //rINTMSK=~(BIT_URXD0); //enable UART0 RX Default value=0xffffffff
;;;482
;;;483 #if 1
;;;484 pISR_USBD =(unsigned)IsrUsbd;
00040c e59f0338 LDR r0,|L1.1868|
000410 e59f1338 LDR r1,|L1.1872|
000414 e5810f84 STR r0,[r1,#0xf84]
;;;485 pISR_DMA =(unsigned)IsrDma2;
000418 e59f0334 LDR r0,|L1.1876|
00041c e5810f70 STR r0,[r1,#0xf70]
;;;486 #else
;;;487 pISR_IRQ =(unsigned)IsrUsbd;
;;;488 //Why doesn't it receive the big file if use this. (???)
;;;489 //It always stops when 327680 bytes are received.
;;;490 #endif
;;;491 ClearPending(BIT_DMA);
000420 e3a00940 MOV r0,#0x100000
000424 e59f131c LDR r1,|L1.1864|
000428 e5810000 STR r0,[r1,#0]
00042c e1c10000 BIC r0,r1,r0
000430 e5900010 LDR r0,[r0,#0x10]
000434 e5810010 STR r0,[r1,#0x10]
000438 e1a00001 MOV r0,r1
00043c e5900010 LDR r0,[r0,#0x10]
;;;492 ClearPending(BIT_USBD);
000440 e3a00780 MOV r0,#0x2000000
000444 e1c11000 BIC r1,r1,r0
000448 e5810000 STR r0,[r1,#0]
00044c e1c10000 BIC r0,r1,r0
000450 e5900010 LDR r0,[r0,#0x10]
000454 e5810010 STR r0,[r1,#0x10]
000458 e1a00001 MOV r0,r1
00045c e5900010 LDR r0,[r0,#0x10]
;;;493 //rINTMSK&=~(BIT_USBD);
;;;494
;;;495 //pISR_FIQ,pISR_IRQ must be initialized
;;;496 }
000460 e12fff1e BX lr
ENDP
USB_Download PROC
;;;49 void USB_Download(void)
;;;50 {
000464 e92d4008 STMFD sp!,{r3,lr}
;;;51 Isr_Init1();
000468 ebfffffe BL Isr_Init1
;;;52
;;;53 rINTMSK&=~(BIT_USBD);
00046c e59f02d4 LDR r0,|L1.1864|
000470 e5900008 LDR r0,[r0,#8]
000474 e3c00780 BIC r0,r0,#0x2000000
000478 e59f12c8 LDR r1,|L1.1864|
00047c e5810008 STR r0,[r1,#8]
;;;54
;;;55 download_end=0;
000480 e3a00000 MOV r0,#0
000484 e51f10d8 LDR r1,|L1.948|
000488 e5810000 STR r0,[r1,#0] ; download_end
;;;56 //Uart_Printf(" USB download.\n");
;;;57 while(1)
00048c e1a00000 NOP
|L1.1168|
000490 e1a00000 NOP
;;;58 {
;;;59 WaitDownload();
000494 ebfffffe BL WaitDownload
;;;60 if(download_end==1) break;
000498 e51f00ec LDR r0,|L1.948|
00049c e5900000 LDR r0,[r0,#0] ; download_end
0004a0 e3500001 CMP r0,#1
0004a4 1a000000 BNE |L1.1196|
0004a8 ea000000 B |L1.1200|
;;;61 }
|L1.1196|
0004ac eafffff7 B |L1.1168|
;;;62 rINTMSK |= (BIT_USBD);
|L1.1200|
0004b0 e59f0290 LDR r0,|L1.1864|
0004b4 e5900008 LDR r0,[r0,#8]
0004b8 e3800780 ORR r0,r0,#0x2000000
0004bc e59f1284 LDR r1,|L1.1864|
0004c0 e5810008 STR r0,[r1,#8]
;;;63 }
0004c4 e8bd8008 LDMFD sp!,{r3,pc}
ENDP
MPEG_WaitDownload PROC
;;;83 void MPEG_WaitDownload(void)
;;;84 {
0004c8 e92d47f0 STMFD sp!,{r4-r10,lr}
0004cc e24dd030 SUB sp,sp,#0x30
;;;85 U32 i;
;;;86 U32 j;
;;;87 U16 cs;
;;;88 U32 temp;
;;;89 U16 dnCS;
;;;90 int first=1;
0004d0 e3a0a001 MOV r10,#1
;;;91 float time;
;;;92 U8 tempMem[16];
;;;93 U8 key;
;;;94
;;;95 checkSum=0;
0004d4 e3a00000 MOV r0,#0
0004d8 e51f122c LDR r1,|L1.692|
0004dc e1c100b0 STRH r0,[r1,#0] ; checkSum
;;;96 downloadAddress_u=(U32)tempMem; //_RAM_STARTADDRESS;
0004e0 e28d0020 ADD r0,sp,#0x20
0004e4 e51f1234 LDR r1,|L1.696|
0004e8 e5810000 STR r0,[r1,#0] ; downloadAddress_u
;;;97 downPt=(unsigned char *)downloadAddress_u;
0004ec e51f023c LDR r0,|L1.696|
0004f0 e5900000 LDR r0,[r0,#0] ; downloadAddress_u
0004f4 e51f1240 LDR r1,|L1.700|
0004f8 e5810000 STR r0,[r1,#0] ; downPt
;;;98 //This address is used for receiving first 8 byte.
;;;99 downloadFileSize=0;
0004fc e3a00000 MOV r0,#0
000500 e51f1248 LDR r1,|L1.704|
000504 e5810000 STR r0,[r1,#0] ; downloadFileSize
;;;100
;;;101
;;;102 /*******************************/
;;;103 /* Test program download */
;;;104 /*******************************/
;;;105 j=0;
000508 e3a04000 MOV r4,#0
;;;106
;;;107
;;;108 //Uart_Printf("Enter a new temporary download address(0x12000100):");
;;;109 //tempdownloadAddress=Uart_GetIntNum();
;;;110 tempdownloadAddress=0x12000100;
00050c e59f0244 LDR r0,|L1.1880|
000510 e51f1224 LDR r1,|L1.756|
000514 e5810000 STR r0,[r1,#0] ; tempdownloadAddress
;;;111 download_run=0;
000518 e3a00000 MOV r0,#0
00051c e51f122c LDR r1,|L1.760|
000520 e5810000 STR r0,[r1,#0] ; download_run
;;;112 //Uart_Printf("The temporary download address is 0x%x.\n\n",tempdownloadAddress);
;;;113 Uart_Printf("Download file ./bmp/mobile_20frame_3Qp.cif using the TRANSMIT of USB port\n");
000524 e59f0230 LDR r0,|L1.1884|
000528 ebfffffe BL _printf
;;;114 Uart_Printf("Wait for download!\n");
00052c e28f0f8b ADR r0,|L1.1888|
000530 ebfffffe BL _printf
;;;115 while(downloadFileSize==0)
000534 e1a00000 NOP
|L1.1336|
000538 e51f0280 LDR r0,|L1.704|
00053c e5900000 LDR r0,[r0,#0] ; downloadFileSize
000540 e3500000 CMP r0,#0
000544 1a00000f BNE |L1.1416|
;;;116 {
;;;117
;;;118 if(j%0x50000==0)Led_Display(0x6);
000548 e1a01004 MOV r1,r4
00054c e3a00a50 MOV r0,#0x50000
000550 ebfffffe BL __rt_udiv
000554 e3510000 CMP r1,#0
000558 1a000001 BNE |L1.1380|
00055c e3a00006 MOV r0,#6
000560 ebfffffe BL Led_Display
;;;119 if(j%0x50000==0x28000)Led_Display(0x9);
|L1.1380|
000564 e1a01004 MOV r1,r4
000568 e3a00a50 MOV r0,#0x50000
00056c ebfffffe BL __rt_udiv
000570 e3510ba0 CMP r1,#0x28000
000574 1a000001 BNE |L1.1408|
000578 e3a00009 MOV r0,#9
00057c ebfffffe BL Led_Display
;;;120 j++;
|L1.1408|
000580 e2844001 ADD r4,r4,#1
;;;121 }
000584 eaffffeb B |L1.1336|
;;;122 //Uart_Printf(" download address: 0x%x, download file size: 0x%x\n\n",downloadAddress_u, downloadFileSize);
;;;123 Timer_InitEx();
|L1.1416|
000588 ebfffffe BL Timer_InitEx
;;;124 Timer_StartEx();
00058c ebfffffe BL Timer_StartEx
;;;125
;;;126 #if USBDMA
;;;127
;;;128 rINTMSK&=~(BIT_DMA);
;;;129 rINTSUBMSK&=~(BIT_SUB_DMA2);
;;;130
;;;131 ClearEp3OutPktReady();
;;;132 // indicate the first packit is processed.
;;;133 // has been delayed for DMA2 cofiguration.
;;;134
;;;135
;;;136 if(downloadFileSize>EP3_PKT_SIZE)
;;;137 {
;;;138 if(downloadFileSize<=(0x80000))
;;;139 {
;;;140 ConfigEp3DmaMode(downloadAddress_u+EP3_PKT_SIZE-8,downloadFileSize-EP3_PKT_SIZE);
;;;141 //wait until DMA reload occurs.
;;;142 while((rDSTAT2&0xfffff)==0);
;;;143
;;;144 //will not be used.
;;;145 rDIDST2=(downloadAddress_u+downloadFileSize-EP3_PKT_SIZE);
;;;146 rDIDSTC2=(0<<1)|(0<<0);
;;;147 rDCON2=rDCON2&~(0xfffff)|(0);
;;;148 }
;;;149 else
;;;150 {
;;;151 ConfigEp3DmaMode(downloadAddress_u+EP3_PKT_SIZE-8,0x80000-EP3_PKT_SIZE);
;;;152 //wait until DMA reload occurs.
;;;153 while((rDSTAT2&0xfffff)==0);
;;;154
;;;155 if(downloadFileSize>(0x80000*2))//for 1st autoreload
;;;156 {
;;;157 rDIDST2=(downloadAddress_u+0x80000-8); //for 1st autoreload.
;;;158 rDIDSTC2=(0<<1)|(0<<0);
;;;159 rDCON2=rDCON2&~(0xfffff)|(0x80000);
;;;160
;;;161 while(rEP3_DMA_TTC<0xfffff)
;;;162 {
;;;163 rEP3_DMA_TTC_L=0xff;
;;;164 rEP3_DMA_TTC_M=0xff;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -