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

📄 uart1.txt

📁 SMDK2442所有设备的驱动测试程序。运行monitor程序
💻 TXT
📖 第 1 页 / 共 5 页
字号:
                  |L1.2292|
0008f4  6e616843          DCB      "Chan"
0008f8  74206567          DCB      "ge t"
0008fc  62206568          DCB      "he b"
000900  72647561          DCB      "audr"
000904  20657461          DCB      "ate "
000908  7420666f          DCB      "of t"
00090c  696d7265          DCB      "ermi"
000910  206c616e          DCB      "nal "
000914  31206f74          DCB      "to 1"
000918  30323531          DCB      "1520"
00091c  70622030          DCB      "0 bp"
000920  6e612073          DCB      "s an"
000924  72502064          DCB      "d Pr"
000928  20737365          DCB      "ess "
00092c  65746e45          DCB      "Ente"
000930  000a2e72          DCB      "r.\n\0"
                          ENDP

                  Test_Uart1_Dma PROC
;;;255    void Test_Uart1_Dma(void)
;;;256    {
000934  e92d4008          STMFD    sp!,{r3,lr}
;;;257        Uart_Port_Set(); 
000938  ebfffffe          BL       Uart_Port_Set
;;;258        Uart_Select(1);    
00093c  e3a00001          MOV      r0,#1
000940  ebfffffe          BL       Uart_Select
;;;259        /*********** UART1 Tx test with DMA1 ***********/ 
;;;260        isDone=1;
000944  e3a00001          MOV      r0,#1
000948  e51f1570          LDR      r1,|L1.992|
00094c  e5810000          STR      r0,[r1,#0]  ; isDone
;;;261        uart1TxStr="ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890->UART1 Tx Test by DMA1 is good!!!!\r\n";
000950  e59f01ec          LDR      r0,|L1.2884|
000954  e51f1804          LDR      r1,|L1.344|
000958  e5810000          STR      r0,[r1,#0]  ; uart1TxStr
;;;262        Uart_Printf("\n[Uart channel 1 DMA1 Tx Test]\n");
00095c  e28f0f79          ADR      r0,|L1.2888|
000960  ebfffffe          BL       Uart_Printf
;;;263        Uart_TxEmpty(1);
000964  e3a00001          MOV      r0,#1
000968  ebfffffe          BL       Uart_TxEmpty
;;;264    
;;;265        pISR_DMA1  =(unsigned)Uart1_TxDmaDone;
00096c  e59f01f4          LDR      r0,|L1.2920|
000970  e51f10dc          LDR      r1,|L1.2204|
000974  e5810f68          STR      r0,[r1,#0xf68]
;;;266    
;;;267        rULCON1=(0<<6)|(0<<3)|(0<<2)|(3);	// Normal,No parity,One stop bit, 8bit
000978  e3a00003          MOV      r0,#3
00097c  e51f1828          LDR      r1,|L1.348|
000980  e5810000          STR      r0,[r1,#0]
;;;268        rUCON1 |= (TX_INTTYPE<<9)|(RX_INTTYPE<<8)|(0<<7)|(0<<6)|(0<<5)|(0<<4)|(3<<2)|(1);
000984  e1c10000          BIC      r0,r1,r0
000988  e5900004          LDR      r0,[r0,#4]
00098c  e3800fc0          ORR      r0,r0,#0x300
000990  e380000d          ORR      r0,r0,#0xd
000994  e5810004          STR      r0,[r1,#4]
;;;269        //Clock,Tx:Def,Rx:Def,Rx timeout:x,Rx error int:x,Loop-back:x,Send break:x,Tx:dma1,Rx:int
;;;270    
;;;271        /***DMA1 init***/
;;;272        rDISRC1=(U32)uart1TxStr;	// Start address
000998  e51f0848          LDR      r0,|L1.344|
00099c  e5900000          LDR      r0,[r0,#0]  ; uart1TxStr
0009a0  e3a0144b          MOV      r1,#0x4b000000
0009a4  e5810040          STR      r0,[r1,#0x40]
;;;273        rDISRCC1=(0<<1)|(0);		// AHB,Increment
0009a8  e3a00000          MOV      r0,#0
0009ac  e3a0144b          MOV      r1,#0x4b000000
0009b0  e5810044          STR      r0,[r1,#0x44]
;;;274        rDIDST1=(U32)UTXH1;			// Memory buffer Address
0009b4  e59f01b0          LDR      r0,|L1.2924|
0009b8  e3a0144b          MOV      r1,#0x4b000000
0009bc  e5810048          STR      r0,[r1,#0x48]
;;;275        rDIDSTC1=(1<<1)|(1);		// APB,Fixed
0009c0  e3a00003          MOV      r0,#3
0009c4  e3a0144b          MOV      r1,#0x4b000000
0009c8  e581004c          STR      r0,[r1,#0x4c]
;;;276        rDCON1=(1<<31)|(0<<30)|(1<<29)|(0<<28)|(0<<27)|(1<<24)|(1<<23)|(1<<22)|(0<<20)|strlen((char*)uart1TxStr);
0009cc  e51f087c          LDR      r0,|L1.344|
0009d0  e5900000          LDR      r0,[r0,#0]  ; uart1TxStr
0009d4  ebfffffe          BL       strlen
0009d8  e3800480          ORR      r0,r0,#0x80000000
0009dc  e3800587          ORR      r0,r0,#0x21c00000
0009e0  e3a0144b          MOV      r1,#0x4b000000
0009e4  e5810050          STR      r0,[r1,#0x50]
;;;277        //handshake, sync PCLK, TC int, single tx, single service, Uart1, H/W request,auto-reload off, Byte size Tx, Tx count value
;;;278        rINTMSK=~(BIT_DMA1);
0009e8  e3e00a40          MVN      r0,#0x40000
0009ec  e3a0144a          MOV      r1,#0x4a000000
0009f0  e5810008          STR      r0,[r1,#8]
;;;279        rDMASKTRIG1=(0<<2)|(1<<1)|(0);    //no-stop, DMA1 channel on, no-SW trigger 
0009f4  e3a00002          MOV      r0,#2
0009f8  e3a0144b          MOV      r1,#0x4b000000
0009fc  e5810060          STR      r0,[r1,#0x60]
;;;280    
;;;281        while(isDone);
000a00  e1a00000          NOP      
                  |L1.2564|
000a04  e51f062c          LDR      r0,|L1.992|
000a08  e5900000          LDR      r0,[r0,#0]  ; isDone
000a0c  e3500000          CMP      r0,#0
000a10  1afffffb          BNE      |L1.2564|
;;;282    
;;;283        /*********** UART1 Rx test with DMA1 ***********/ 
;;;284        isDone=1;
000a14  e3a00001          MOV      r0,#1
000a18  e51f1640          LDR      r1,|L1.992|
000a1c  e5810000          STR      r0,[r1,#0]  ; isDone
;;;285        uart1RxStr=(char *)UARTBUFFER;
000a20  e3a005c4          MOV      r0,#0x31000000
000a24  e51f180c          LDR      r1,|L1.544|
000a28  e5810000          STR      r0,[r1,#0]  ; uart1RxStr
;;;286    
;;;287        Uart_Printf("\n[Uart channel 1 DMA1 Rx Test]\n");
000a2c  e28f0f4f          ADR      r0,|L1.2928|
000a30  ebfffffe          BL       Uart_Printf
;;;288        Uart_Printf("Type any five keys!!!\n");    
000a34  e28f0f55          ADR      r0,|L1.2960|
000a38  ebfffffe          BL       Uart_Printf
;;;289        Uart_Printf("Then you will see what you typed.\n");
000a3c  e28f0f59          ADR      r0,|L1.2984|
000a40  ebfffffe          BL       Uart_Printf
;;;290    
;;;291        pISR_DMA1=(unsigned)Uart1_RxDmaDone;
000a44  e59f0180          LDR      r0,|L1.3020|
000a48  e51f11b4          LDR      r1,|L1.2204|
000a4c  e5810f68          STR      r0,[r1,#0xf68]
;;;292        pISR_UART1=(unsigned)Uart1_RxDmaOrErr;
000a50  e59f0178          LDR      r0,|L1.3024|
000a54  e5810f7c          STR      r0,[r1,#0xf7c]
;;;293    
;;;294        rULCON1=(0<<6)|(0<<3)|(0<<2)|(3);	// Normal,No parity,One stop bit, 8bit
000a58  e3a00003          MOV      r0,#3
000a5c  e51f1908          LDR      r1,|L1.348|
000a60  e5810000          STR      r0,[r1,#0]
;;;295        rUCON1 &= 0x400;	// For the PCLK <-> UCLK fuction    
000a64  e1c10000          BIC      r0,r1,r0
000a68  e5900004          LDR      r0,[r0,#4]
000a6c  e2000e40          AND      r0,r0,#0x400
000a70  e5810004          STR      r0,[r1,#4]
;;;296        rUCON1 |= (TX_INTTYPE<<9)|(RX_INTTYPE<<8)|(0<<7)|(1<<6)|(0<<5)|(0<<4)|(1<<2)|(3);
000a74  e1a00001          MOV      r0,r1
000a78  e5900004          LDR      r0,[r0,#4]
000a7c  e3800fc0          ORR      r0,r0,#0x300
000a80  e3800047          ORR      r0,r0,#0x47
000a84  e5810004          STR      r0,[r1,#4]
;;;297        //Clock,Tx:Def,Rx:Def,Rx timeout:x,Rx error int:o,Loop-back:x,Send break:x,Tx:int,Rx:dma1
;;;298    
;;;299        /***DMA1 init***/
;;;300        rDISRC1=(U32)URXH1;			// Start address
000a88  e2810024          ADD      r0,r1,#0x24
000a8c  e3a0144b          MOV      r1,#0x4b000000
000a90  e5810040          STR      r0,[r1,#0x40]
;;;301        rDISRCC1=(1<<1)|(1);		// APB,Fixed
000a94  e3a00003          MOV      r0,#3
000a98  e3a0144b          MOV      r1,#0x4b000000
000a9c  e5810044          STR      r0,[r1,#0x44]
;;;302        rDIDST1=(U32)uart1RxStr;	// Memory buffer Address
000aa0  e51f0888          LDR      r0,|L1.544|
000aa4  e5900000          LDR      r0,[r0,#0]  ; uart1RxStr
000aa8  e3a0144b          MOV      r1,#0x4b000000
000aac  e5810048          STR      r0,[r1,#0x48]
;;;303        rDIDSTC1= (0<<1)|(0);		// AHB,Increment
000ab0  e3a00000          MOV      r0,#0
000ab4  e3a0144b          MOV      r1,#0x4b000000
000ab8  e581004c          STR      r0,[r1,#0x4c]
;;;304        rDCON1=(1<<31)|(0<<30)|(1<<29)|(0<<28)|(0<<27)|(1<<24)|(1<<23)|(1<<22)|(0<<20)|(5);
000abc  e59f0110          LDR      r0,|L1.3028|
000ac0  e3a0144b          MOV      r1,#0x4b000000
000ac4  e5810050          STR      r0,[r1,#0x50]
;;;305        //handshake, sync PCLK, TC int, single tx, single service, Uart1, H/W request,auto-reload off, Byte size Tx, Tx count value
;;;306    
;;;307        // Clear Int Pending and Unmask
;;;308        ClearPending(BIT_UART1);
000ac8  e3a00880          MOV      r0,#0x800000
000acc  e3a0144a          MOV      r1,#0x4a000000
000ad0  e5810000          STR      r0,[r1,#0]
000ad4  e3a00880          MOV      r0,#0x800000
000ad8  e3a0144a          MOV      r1,#0x4a000000
000adc  e5810010          STR      r0,[r1,#0x10]
000ae0  e3a0044a          MOV      r0,#0x4a000000
000ae4  e5900010          LDR      r0,[r0,#0x10]
;;;309        rINTMSK=~(BIT_DMA1|BIT_UART1);
000ae8  e3e00884          MVN      r0,#0x840000
000aec  e3a0144a          MOV      r1,#0x4a000000
000af0  e5810008          STR      r0,[r1,#8]
;;;310        rSUBSRCPND=(BIT_SUB_RXD1|BIT_SUB_TXD1|BIT_SUB_ERR1);
000af4  e3a00038          MOV      r0,#0x38
000af8  e3a0144a          MOV      r1,#0x4a000000
000afc  e5810018          STR      r0,[r1,#0x18]
;;;311        rINTSUBMSK=~(BIT_SUB_ERR1);
000b00  e3e00020          MVN      r0,#0x20
000b04  e3a0144a          MOV      r1,#0x4a000000
000b08  e581001c          STR      r0,[r1,#0x1c]
;;;312        rDMASKTRIG1=(0<<2)|(1<<1)|(0);    //no-stop, DMA1 channel on, no-SW trigger 
000b0c  e3a00002          MOV      r0,#2
000b10  e3a0144b          MOV      r1,#0x4b000000
000b14  e5810060          STR      r0,[r1,#0x60]
;;;313    
;;;314        while(isDone);
000b18  e1a00000          NOP      
                  |L1.2844|
000b1c  e51f0744          LDR      r0,|L1.992|
000b20  e5900000          LDR      r0,[r0,#0]  ; isDone
000b24  e3500000          CMP      r0,#0
000b28  1afffffb          BNE      |L1.2844|
;;;315    
;;;316        Uart_Printf("%s\n",uart1RxStr);
000b2c  e51f0914          LDR      r0,|L1.544|
000b30  e5901000          LDR      r1,[r0,#0]  ; uart1RxStr
000b34  e24f0f93          ADR      r0,|L1.2288|
000b38  ebfffffe          BL       Uart_Printf
;;;317        
;;;318        Uart_Port_Return();
000b3c  ebfffffe          BL       Uart_Port_Return
;;;319    }
000b40  e8bd8008          LDMFD    sp!,{r3,pc}
                  |L1.2884|
000b44  000000dc          DCD      ||.constdata$1|| + 220
                  |L1.2888|
000b48  61555b0a          DCB      "\n[Ua"
000b4c  63207472          DCB      "rt c"
000b50  6e6e6168          DCB      "hann"
000b54  31206c65          DCB      "el 1"
000b58  414d4420          DCB      " DMA"
000b5c  78542031          DCB      "1 Tx"
000b60  73655420          DCB      " Tes"
000b64  000a5d74          DCB      "t]\n\0"
                  |L1.2920|
000b68  00000000          DCD      Uart1_TxDmaDone
                  |L1.2924|
000b6c  50004020          DCD      0x50004020
                  |L1.2928|
000b70  61555b0a          DCB      "\n[Ua"
000b74  63207472          DCB      "rt c"
000b78  6e6e6168          DCB      "hann"
000b7c  31206c65          DCB      "el 1"
000b80  414d4420          DCB      " DMA"
000b84  78522031          DCB      "1 Rx"
000b88  73655420          DCB      " Tes"
000b8c  000a5d74          DCB      "t]\n\0"
                  |L1.2960|
000b90  65707954          DCB      "Type"
000b94  796e6120          DCB      " any"
000b98  76696620          DCB      " fiv"
000b9c  656b2065          DCB      "e ke"
000ba0  21217379          DCB      "ys!!"
000ba4  00000a21          DCB      "!\n\0\0"
                  |L1.2984|
000ba8  6e656854          DCB      "Then"
000bac  756f7920          DCB      " you"
000bb0  6c697720          DCB      " wil"
000bb4  6573206c          DCB      "l se"
000bb8  68772065          DCB      "e wh"
000bbc  79207461          DCB      "at y"
000bc0  7420756f          DCB      "ou t"
000bc4  64657079          DCB      "yped"
000bc8  00000a2e          DCB      ".\n\0\0"
                  |L1.3020|
000bcc  00000000          DCD      Uart1_RxDmaDone
                  |L1.3024|
000bd0  00000000          DCD      Uart1_RxDmaOrErr
                  |L1.3028|
000bd4  a1c00005          DCD      0xa1c00005
                          ENDP

                  Uart1_TxFifo PROC
;;;322    void __irq Uart1_TxFifo(void)
;;;323    {
000bd8  e92d0007          STMFD    sp!,{r0-r2}
;;;324        rINTSUBMSK|=(BIT_SUB_RXD1|BIT_SUB_TXD1|BIT_SUB_ERR1);	// Just for the safety
000bdc  e3a0044a          MOV      r0,#0x4a000000
000be0  e590001c          LDR      r0,[r0,#0x1c]
000be4  e3800038          ORR      r0,r0,#0x38
000be8  e3a0144a          MOV      r1,#0x4a000000
000bec  e581001c          STR      r0,[r1,#0x1c]
;;;325        while (!(rUFSTAT1 & 0x4000) && (*uart1TxStr != '\0')) 	//until tx fifo full or end of string
000bf0  e1a00000          NOP      
                  |L1.3060|
000bf4  e51f0aa0          LDR      r0,|L1.348|
000bf8  e5900018          LDR      r0,[r0,#0x18]
000bfc  e3100c40          TST      r0,#0x4000
000c00  1a00000d          BNE      |L1.3132|
000c04  e51f0ab4          LDR      r0,|L1.344|
000c08  e5900000          LDR      r0,[r0,#0]  ; uart1TxStr
000c0c  e5d00000          LDRB     r0,[r0,#0]
000c10  e3500000          CMP      r0,#0

⌨️ 快捷键说明

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