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

📄 flash.txt

📁 s3c24a0固件测试代码 ? ? ? ? ?啊 
💻 TXT
📖 第 1 页 / 共 3 页
字号:
000290  0a782520          DCB      " %x\n"
000294  00000000          DCB      "\0\0\0\0"
                  |L1.664|
000298  e28f0008          ADR      r0,|L1.680|           ;149
00029c  ebfffffe          BL       _printf               ;149
0002a0  e3a00001          MOV      r0,#1                 ;150
0002a4  eaffffb6          B        |L1.388|              ;150
                  |L1.680|
0002a8  776f440a          DCB      "\nDow"               ;150
0002ac  616f6c6e          DCB      "nloa"                ;150
0002b0  2e4f2064          DCB      "d O."                ;150
0002b4  000a2e4b          DCB      "K.\n\0"              ;150
                          ENDP

                  Ch2_SROM_CONTROLLER PROC
;;;46     void Ch2_SROM_CONTROLLER(void)
;;;47     {
0002b8  e92d4070          STMFD    sp!,{r4-r6,lr}
;;;48         int i=0,whichFlash;
0002bc  e3a04000          MOV      r4,#0
;;;49         char key;
;;;50     
;;;51         Uart_Printf("\n[ NOR Flash Memory Writer Ver 0.1 ]\n\n");
0002c0  e28f00f8          ADR      r0,|L1.960|
0002c4  ebfffffe          BL       _printf
;;;52         Uart_Printf("The program buffer : 0x11000000 ~ 0x13cf0000\n");
0002c8  e28f0f46          ADR      r0,|L1.1000|
0002cc  ebfffffe          BL       _printf
;;;53         
;;;54         downloadAddress=0x11000000;
0002d0  e3a00544          MOV      r0,#0x11000000
0002d4  e51f1154          LDR      r1,|L1.392|
0002d8  e5810000          STR      r0,[r1,#0]  ; downloadAddress
;;;55         downloadProgramSize=0x0;
0002dc  e3a00000          MOV      r0,#0
0002e0  e51f107c          LDR      r1,|L1.620|
0002e4  e5810000          STR      r0,[r1,#0]  ; downloadProgramSize
;;;56     
;;;57         //MMU_Init();
;;;58         ChangeRomCacheStatus(RW_NCNB);
0002e8  e59f0128          LDR      r0,|L1.1048|
0002ec  ebfffffe          BL       ChangeRomCacheStatus
;;;59         
;;;60         while(1)
0002f0  e1a00000          NOP      
                  |L1.756|
0002f4  e1a00000          NOP      
;;;61         {   //display menu
;;;62             Uart_Printf("%c : %s",'a'+i,flashType[i][1]);
0002f8  e59f011c          LDR      r0,|L1.1052|
0002fc  e0800184          ADD      r0,r0,r4,LSL #3
000300  e2841061          ADD      r1,r4,#0x61
000304  e5902004          LDR      r2,[r0,#4]
000308  e28f0f44          ADR      r0,|L1.1056|
00030c  ebfffffe          BL       _printf
;;;63             i++;
000310  e2844001          ADD      r4,r4,#1
;;;64             if((int)(flashType[i][0])==0)
000314  e59f0100          LDR      r0,|L1.1052|
000318  e7900184          LDR      r0,[r0,r4,LSL #3]
00031c  e3500000          CMP      r0,#0
000320  1a000002          BNE      |L1.816|
;;;65             {
;;;66                 Uart_Printf("\n");
000324  e28f00e8          ADR      r0,|L1.1044|
000328  ebfffffe          BL       _printf
;;;67                 break;
00032c  ea000004          B        |L1.836|
;;;68             }
;;;69             if((i%4)==0) 
                  |L1.816|
000330  e3140003          TST      r4,#3
000334  1a000001          BNE      |L1.832|
;;;70                 Uart_Printf("\n");
000338  e28f00d4          ADR      r0,|L1.1044|
00033c  ebfffffe          BL       _printf
;;;71         }
                  |L1.832|
000340  eaffffeb          B        |L1.756|
;;;72     
;;;73         Uart_Printf("Select the type of a flash memory ? ");
                  |L1.836|
000344  e28f00dc          ADR      r0,|L1.1064|
000348  ebfffffe          BL       _printf
;;;74         whichFlash=Uart_Getch()-'a';
00034c  ebfffffe          BL       Uart_Getch
000350  e2405061          SUB      r5,r0,#0x61
;;;75         Uart_Printf("%c\n",(whichFlash+'a'));
000354  e2851061          ADD      r1,r5,#0x61
000358  e28f00f0          ADR      r0,|L1.1104|
00035c  ebfffffe          BL       _printf
;;;76         //Uart_Printf("\n");
;;;77     
;;;78         if( i<0 || (i>=(sizeof(flashType)/8)) )
000360  e3540000          CMP      r4,#0
000364  ba000001          BLT      |L1.880|
000368  e3540003          CMP      r4,#3
00036c  3a000000          BCC      |L1.884|
;;;79             return;
;;;80     
;;;81         Uart_Printf("Do you want to download through UART0 from 0x%x? [y/n] : ",downloadAddress);
;;;82         key=Uart_Getch();
;;;83         Uart_Printf("%c\n",key);
;;;84         if(key=='y')
;;;85         {
;;;86             if(!DownloadData())
;;;87                 return;
;;;88         }
;;;89     
;;;90         ( (void (*)(void))(flashType[whichFlash][0]) )();
;;;91     }
                  |L1.880|
000370  e8bd8070          LDMFD    sp!,{r4-r6,pc}
                  |L1.884|
000374  e51f01f4          LDR      r0,|L1.392|           ;81
000378  e5901000          LDR      r1,[r0,#0]            ;81  ; downloadAddress
00037c  e28f00d0          ADR      r0,|L1.1108|          ;81
000380  ebfffffe          BL       _printf               ;81
000384  ebfffffe          BL       Uart_Getch            ;82
000388  e1a06000          MOV      r6,r0                 ;82
00038c  e1a01006          MOV      r1,r6                 ;83
000390  e28f00b8          ADR      r0,|L1.1104|          ;83
000394  ebfffffe          BL       _printf               ;83
000398  e3560079          CMP      r6,#0x79              ;84
00039c  1a000003          BNE      |L1.944|              ;84
0003a0  ebfffffe          BL       DownloadData          ;86
0003a4  e3500000          CMP      r0,#0                 ;86
0003a8  1a000000          BNE      |L1.944|              ;86
0003ac  eaffffef          B        |L1.880|              ;87
                  |L1.944|
0003b0  e59f1064          LDR      r1,|L1.1052|          ;90
0003b4  e7910185          LDR      r0,[r1,r5,LSL #3]     ;90
0003b8  e12fff30          BLX      r0                    ;90
0003bc  eaffffeb          B        |L1.880|
                  |L1.960|
0003c0  4e205b0a          DCB      "\n[ N"
0003c4  4620524f          DCB      "OR F"
0003c8  6873616c          DCB      "lash"
0003cc  6d654d20          DCB      " Mem"
0003d0  2079726f          DCB      "ory "
0003d4  74697257          DCB      "Writ"
0003d8  56207265          DCB      "er V"
0003dc  30207265          DCB      "er 0"
0003e0  5d20312e          DCB      ".1 ]"
0003e4  00000a0a          DCB      "\n\n\0\0"
                  |L1.1000|
0003e8  20656854          DCB      "The "
0003ec  676f7270          DCB      "prog"
0003f0  206d6172          DCB      "ram "
0003f4  66667562          DCB      "buff"
0003f8  3a207265          DCB      "er :"
0003fc  31783020          DCB      " 0x1"
000400  30303031          DCB      "1000"
000404  20303030          DCB      "000 "
000408  7830207e          DCB      "~ 0x"
00040c  66633331          DCB      "13cf"
000410  30303030          DCB      "0000"
                  |L1.1044|
000414  0000000a          DCB      "\n\0\0\0"
                  |L1.1048|
000418  00000c12          DCD      0x00000c12
                  |L1.1052|
00041c  00000000          DCD      flashType
                  |L1.1056|
000420  3a206325          DCB      "%c :"
000424  00732520          DCB      " %s\0"
                  |L1.1064|
000428  656c6553          DCB      "Sele"
00042c  74207463          DCB      "ct t"
000430  74206568          DCB      "he t"
000434  20657079          DCB      "ype "
000438  6120666f          DCB      "of a"
00043c  616c6620          DCB      " fla"
000440  6d206873          DCB      "sh m"
000444  726f6d65          DCB      "emor"
000448  203f2079          DCB      "y ? "
00044c  00000000          DCB      "\0\0\0\0"
                  |L1.1104|
000450  000a6325          DCB      "%c\n\0"
                  |L1.1108|
000454  79206f44          DCB      "Do y"
000458  7720756f          DCB      "ou w"
00045c  20746e61          DCB      "ant "
000460  64206f74          DCB      "to d"
000464  6c6e776f          DCB      "ownl"
000468  2064616f          DCB      "oad "
00046c  6f726874          DCB      "thro"
000470  20686775          DCB      "ugh "
000474  54524155          DCB      "UART"
000478  72662030          DCB      "0 fr"
00047c  30206d6f          DCB      "om 0"
000480  3f782578          DCB      "x%x?"
000484  2f795b20          DCB      " [y/"
000488  3a205d6e          DCB      "n] :"
00048c  00000020          DCB      " \0\0\0"
                          ENDP

                  DownloadImage PROC
;;;154    static int DownloadImage(void)
;;;155    {
000490  e92d47f0          STMFD    sp!,{r4-r10,lr}
;;;156        int i,j,tmp;
;;;157        U16 checkSum=0,dnCS;
000494  e3a07000          MOV      r7,#0
;;;158        U32 fileSize=10;
000498  e3a0500a          MOV      r5,#0xa
;;;159        U8 *downPt;
;;;160    
;;;161        downPt=(U8 *)downloadAddress;
00049c  e51f031c          LDR      r0,|L1.392|
0004a0  e5909000          LDR      r9,[r0,#0]  ; downloadAddress
;;;162       
;;;163        Uart_Printf("\ndownloadAddress = %x\n",downloadAddress);
0004a4  e51f0324          LDR      r0,|L1.392|
0004a8  e5901000          LDR      r1,[r0,#0]  ; downloadAddress
0004ac  e24f0fca          ADR      r0,|L1.396|
0004b0  ebfffffe          BL       _printf
;;;164    
;;;165        Uart_Printf("Download the plain binary file(.BHC) to be written\n");
0004b4  e24f0fc6          ADR      r0,|L1.420|
0004b8  ebfffffe          BL       _printf
;;;166        Uart_Printf("The file format : <n+6>(4)+(n)+CS(2)\n");
0004bc  e24f0fbb          ADR      r0,|L1.472|
0004c0  ebfffffe          BL       _printf
;;;167        Uart_Printf("To transmit .BIN file : wkocm2 xxx.BIN /1 /d:1\n");
0004c4  e24f0fb3          ADR      r0,|L1.512|
0004c8  ebfffffe          BL       _printf
;;;168        Uart_Printf("Download methods : COM:8Bit,NP,1STOP\n");
0004cc  e24f0fa9          ADR      r0,|L1.560|
0004d0  ebfffffe          BL       _printf
;;;169     
;;;170        Uart_Printf("\nSTATUS : ");
0004d4  e24f0fa1          ADR      r0,|L1.600|
0004d8  ebfffffe          BL       _printf
;;;171        rINTMSK=BIT_ALLMSK;
0004dc  e3e00000          MVN      r0,#0
0004e0  e51f1284          LDR      r1,|L1.612|
0004e4  e5810008          STR      r0,[r1,#8]
;;;172        
;;;173        tmp=RdURXH0(); //To remove overrun error state.
0004e8  e2810642          ADD      r0,r1,#0x4200000
0004ec  e5d00024          LDRB     r0,[r0,#0x24]
0004f0  e1a0a000          MOV      r10,r0
;;;174    
;;;175        i=0;
0004f4  e3a04000          MOV      r4,#0
;;;176        j=0;
0004f8  e3a06000          MOV      r6,#0
;;;177        while(i<fileSize)
0004fc  e1a00000          NOP      
                  |L1.1280|
000500  e1540005          CMP      r4,r5

⌨️ 快捷键说明

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