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

📄 main.lst

📁 本代bootloader通过usb下载代码首先存放在sdram中
💻 LST
📖 第 1 页 / 共 5 页
字号:
   \   0000005C   24009FE5           LDR      R0,??AT45_GetJedecId_1+0x4  ;; `?<Constant "-F- AT45_GetJedecId: ...">_1`
   \   00000060   ........           BL       printf
   \                     ??AT45_GetJedecId_4:
   \   00000064   FEFFFFEA           B        ??AT45_GetJedecId_4
    259          
    260              // Wait for transfer to finish
    261              while (AT45_IsBusy(pAt45));
   \                     ??AT45_GetJedecId_3:
   \   00000068   0400A0E1           MOV      R0,R4
   \   0000006C   ........           BL       AT45_IsBusy
   \   00000070   000050E3           CMP      R0,#+0
   \   00000074   FBFFFF1A           BNE      ??AT45_GetJedecId_3
    262          
    263              return id;
   \   00000078   00009DE5           LDR      R0,[SP, #+0]
   \   0000007C   1C40BDE8           POP      {R2-R4,LR}
   \   00000080   1EFF2FE1           BX       LR               ;; return
   \                     ??AT45_GetJedecId_1:
   \   00000084   ........           DC32     `?<Constant "-F- AT45_GetJedecId: ...">`
   \   00000088   ........           DC32     `?<Constant "-F- AT45_GetJedecId: ...">_1`
    264          }
    265          
    266          //------------------------------------------------------------------------------
    267          /// Reads data from the At45 inside the provided buffer. Since a continuous
    268          /// read command is used, there is no restriction on the buffer size and read
    269          /// address.
    270          /// \param pAt45  Pointer to a At45 driver instance.
    271          /// \param pBuffer  Data buffer.
    272          /// \param size  Number of bytes to read.
    273          /// \param address  Address at which data shall be read.
    274          //------------------------------------------------------------------------------

   \                                 In section .text, align 4, keep-with-next
    275          static void AT45_Read(
    276              At45 *pAt45,
    277              unsigned char *pBuffer,
    278              unsigned int size,
    279              unsigned int address) 
    280          {
   \                     AT45_Read:
   \   00000000   10402DE9           PUSH     {R4,LR}
   \   00000004   0040A0E1           MOV      R4,R0
   \   00000008   01C0A0E1           MOV      R12,R1
    281              unsigned char error;
    282          
    283              // Sanity checks
    284              ASSERT(pAt45, "-F- AT45_Read: pAt45 is null\n\r");
   \   0000000C   000054E3           CMP      R4,#+0
   \   00000010   0400001A           BNE      ??AT45_Read_0
   \   00000014   ........           LDR      R0,??DataTable12  ;; `?<Constant "-F- ASSERT: ">`
   \   00000018   ........           BL       printf
   \   0000001C   84009FE5           LDR      R0,??AT45_Read_1  ;; `?<Constant "-F- AT45_Read: pAt45 ...">`
   \   00000020   ........           BL       printf
   \                     ??AT45_Read_2:
   \   00000024   FEFFFFEA           B        ??AT45_Read_2
    285              ASSERT(pBuffer, "-F- AT45_Read: pBuffer is null\n\r");
   \                     ??AT45_Read_0:
   \   00000028   00005CE3           CMP      R12,#+0
   \   0000002C   0400001A           BNE      ??AT45_Read_3
   \   00000030   ........           LDR      R0,??DataTable12  ;; `?<Constant "-F- ASSERT: ">`
   \   00000034   ........           BL       printf
   \   00000038   6C009FE5           LDR      R0,??AT45_Read_1+0x4  ;; `?<Constant "-F- AT45_Read: pBuffe...">`
   \   0000003C   ........           BL       printf
   \                     ??AT45_Read_4:
   \   00000040   FEFFFFEA           B        ??AT45_Read_4
    286          
    287              // Issue a continuous read array command
    288              error = AT45_SendCommand(pAt45, AT45_CONTINUOUS_READ_LEG, 8, pBuffer, size, address, 0, 0);
   \                     ??AT45_Read_3:
   \   00000044   0010A0E3           MOV      R1,#+0
   \   00000048   0000A0E3           MOV      R0,#+0
   \   0000004C   03002DE9           PUSH     {R0,R1}
   \   00000050   0310A0E1           MOV      R1,R3
   \   00000054   0200A0E1           MOV      R0,R2
   \   00000058   03002DE9           PUSH     {R0,R1}
   \   0000005C   0C30A0E1           MOV      R3,R12
   \   00000060   0820A0E3           MOV      R2,#+8
   \   00000064   E810A0E3           MOV      R1,#+232
   \   00000068   0400A0E1           MOV      R0,R4
   \   0000006C   ........           BL       AT45_SendCommand
   \   00000070   10D08DE2           ADD      SP,SP,#+16       ;; stack cleaning
    289              ASSERT(!error, "-F- AT45_Read: Failed to issue command\n\r");
   \   00000074   000050E3           CMP      R0,#+0
   \   00000078   0400000A           BEQ      ??AT45_Read_5
   \   0000007C   ........           LDR      R0,??DataTable12  ;; `?<Constant "-F- ASSERT: ">`
   \   00000080   ........           BL       printf
   \   00000084   24009FE5           LDR      R0,??AT45_Read_1+0x8  ;; `?<Constant "-F- AT45_Read: Failed...">`
   \   00000088   ........           BL       printf
   \                     ??AT45_Read_6:
   \   0000008C   FEFFFFEA           B        ??AT45_Read_6
    290          
    291              // Wait for the read command to execute
    292              while (AT45_IsBusy(pAt45));
   \                     ??AT45_Read_5:
   \   00000090   0400A0E1           MOV      R0,R4
   \   00000094   ........           BL       AT45_IsBusy
   \   00000098   000050E3           CMP      R0,#+0
   \   0000009C   FBFFFF1A           BNE      ??AT45_Read_5
    293          }
   \   000000A0   1040BDE8           POP      {R4,LR}
   \   000000A4   1EFF2FE1           BX       LR               ;; return
   \                     ??AT45_Read_1:
   \   000000A8   ........           DC32     `?<Constant "-F- AT45_Read: pAt45 ...">`
   \   000000AC   ........           DC32     `?<Constant "-F- AT45_Read: pBuffe...">`
   \   000000B0   ........           DC32     `?<Constant "-F- AT45_Read: Failed...">`
    294          
    295          //------------------------------------------------------------------------------
    296          /// Writes data on the At45 at the specified address. Only one page of
    297          /// data is written that way; if the address is not at the beginning of the
    298          /// page, the data is written starting from this address and wraps around to
    299          /// the beginning of the page.
    300          /// \param pAt45  Pointer to a At45 driver instance.
    301          /// \param pBuffer  Buffer containing the data to write.
    302          /// \param size  Number of bytes to write.
    303          /// \param address  Destination address on the At45.
    304          //------------------------------------------------------------------------------

   \                                 In section .text, align 4, keep-with-next
    305          static void AT45_Write(
    306              At45 *pAt45,
    307              unsigned char *pBuffer,
    308              unsigned int size,
    309              unsigned int address) 
    310          {
   \                     AT45_Write:
   \   00000000   10402DE9           PUSH     {R4,LR}
   \   00000004   0040A0E1           MOV      R4,R0
   \   00000008   01C0A0E1           MOV      R12,R1
    311              unsigned char error;
    312          
    313              // Sanity checks
    314              ASSERT(pAt45, "-F- AT45_Write: pAt45 is null.\n\r");
   \   0000000C   000054E3           CMP      R4,#+0
   \   00000010   0400001A           BNE      ??AT45_Write_0
   \   00000014   ........           LDR      R0,??DataTable12  ;; `?<Constant "-F- ASSERT: ">`
   \   00000018   ........           BL       printf
   \   0000001C   AC009FE5           LDR      R0,??AT45_Write_1  ;; `?<Constant "-F- AT45_Write: pAt45...">`
   \   00000020   ........           BL       printf
   \                     ??AT45_Write_2:
   \   00000024   FEFFFFEA           B        ??AT45_Write_2
    315              ASSERT(pBuffer, "-F- AT45_Write: pBuffer is null.\n\r");
   \                     ??AT45_Write_0:
   \   00000028   00005CE3           CMP      R12,#+0
   \   0000002C   0400001A           BNE      ??AT45_Write_3
   \   00000030   ........           LDR      R0,??DataTable12  ;; `?<Constant "-F- ASSERT: ">`
   \   00000034   ........           BL       printf
   \   00000038   94009FE5           LDR      R0,??AT45_Write_1+0x4  ;; `?<Constant "-F- AT45_Write: pBuff...">`
   \   0000003C   ........           BL       printf
   \                     ??AT45_Write_4:
   \   00000040   FEFFFFEA           B        ??AT45_Write_4
    316              ASSERT(size <= pAt45->pDesc->pageSize, "-F- AT45_Write: Size too big\n\r");
   \                     ??AT45_Write_3:
   \   00000044   1C0094E5           LDR      R0,[R4, #+28]
   \   00000048   080090E5           LDR      R0,[R0, #+8]
   \   0000004C   020050E1           CMP      R0,R2
   \   00000050   0400002A           BCS      ??AT45_Write_5
   \   00000054   ........           LDR      R0,??DataTable12  ;; `?<Constant "-F- ASSERT: ">`
   \   00000058   ........           BL       printf
   \   0000005C   74009FE5           LDR      R0,??AT45_Write_1+0x8  ;; `?<Constant "-F- AT45_Write: Size ...">`
   \   00000060   ........           BL       printf
   \                     ??AT45_Write_6:
   \   00000064   FEFFFFEA           B        ??AT45_Write_6
    317          
    318              // Issue a page write through buffer 1 command
    319              error = AT45_SendCommand(pAt45, AT45_PAGE_WRITE_BUF1, 4, pBuffer, size, address, 0, 0);
   \                     ??AT45_Write_5:
   \   00000068   0010A0E3           MOV      R1,#+0
   \   0000006C   0000A0E3           MOV      R0,#+0
   \   00000070   03002DE9           PUSH     {R0,R1}
   \   00000074   0310A0E1           MOV      R1,R3
   \   00000078   0200A0E1           MOV      R0,R2
   \   0000007C   03002DE9           PUSH     {R0,R1}
   \   00000080   0C30A0E1           MOV      R3,R12
   \   00000084   0420A0E3           MOV      R2,#+4
   \   00000088   8210A0E3           MOV      R1,#+130
   \   0000008C   0400A0E1           MOV      R0,R4
   \   00000090   ........           BL       AT45_SendCommand
   \   00000094   10D08DE2           ADD      SP,SP,#+16       ;; stack cleaning
    320              ASSERT(!error, "-F- AT45_Write: Could not issue command.\n\r");
   \   00000098   000050E3           CMP      R0,#+0
   \   0000009C   0400000A           BEQ      ??AT45_Write_7
   \   000000A0   ........           LDR      R0,??DataTable12  ;; `?<Constant "-F- ASSERT: ">`
   \   000000A4   ........           BL       printf
   \   000000A8   2C009FE5           LDR      R0,??AT45_Write_1+0xC  ;; `?<Constant "-F- AT45_Write: Could...">`
   \   000000AC   ........           BL       printf
   \                     ??AT45_Write_8:
   \   000000B0   FEFFFFEA           B        ??AT45_Write_8
    321          
    322              // Wait until the command is sent
    323              while (AT45_IsBusy(pAt45));
   \                     ??AT45_Write_7:
   \   000000B4   0400A0E1           MOV      R0,R4
   \   000000B8   ........           BL       AT45_IsBusy
   \   000000BC   000050E3           CMP      R0,#+0
   \   000000C0   FBFFFF1A           BNE      ??AT45_Write_7
    324              
    325              // Wait until the At45 becomes ready again
    326              AT45_WaitReady(pAt45);
   \   000000C4   0400A0E1           MOV      R0,R4
    327          }
   \   000000C8   1040BDE8           POP      {R4,LR}
   \   000000CC   ........           B        AT45_WaitReady   ;; tailcall
   \                     ??AT45_Write_1:
   \   000000D0   ........           DC32     `?<Constant "-F- AT45_Write: pAt45...">`
   \   000000D4   ........           DC32     `?<Constant "-F- AT45_Write: pBuff...">`
   \   000000D8   ........           DC32     `?<Constant "-F- AT45_Write: Size ...">`
   \   000000DC   ........           DC32     `?<Constant "-F- AT45_Write: Could...">`
    328          
    329          //------------------------------------------------------------------------------
    330          /// Erases a page of data at the given address in the At45.
    331          /// \param pAt45  Pointer to a At45 driver instance.
    332          /// \param address  Address of page to erase.
    333          //------------------------------------------------------------------------------
    334          static void AT45_Erase(At45 *pAt45, unsigned int address) 
    335          {
    336              unsigned char error;
    337          
    338              // Sanity checks
    339              ASSERT(pAt45, "-F- AT45_Erase: pAt45 is null\n\r");
    340              
    341              // Issue a page erase command.
    342              error = AT45_SendCommand(pAt45, AT45_PAGE_ERASE, 4, 0, 0, address, 0, 0);
    343              ASSERT(!error, "-F- AT45_Erase: Could not issue command.\n\r");
    344          
    345              // Wait for end of transfer
    346              while (AT45_IsBusy(pAt45));
    347          
    348              // Poll until the At45 has completed the erase operation
    349              AT45_WaitReady(pAt45);
    350          }
    351          

⌨️ 快捷键说明

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