?? download.lst
字號(hào):
##############################################################################
# #
# IAR ARM ANSI C/C++ Compiler V4.40A/W32 17/Jan/2007 16:16:26 #
# Copyright 1999-2005 IAR Systems. All rights reserved. #
# #
# Cpu mode = arm #
# Endian = little #
# Stack alignment = 4 #
# Source file = D:\lilian\STR71X\application note\IAP using #
# UART\an2078_IAR(forum)\an2078\IAP_V2.0\common\downlo #
# ad.c #
# Command line = "D:\lilian\STR71X\application note\IAP using #
# UART\an2078_IAR(forum)\an2078\IAP_V2.0\common\downlo #
# ad.c" -lC "D:\lilian\STR71X\application note\IAP #
# using UART\an2078_IAR(forum)\an2078\IAP_V2.0\user\De #
# bug\List\" -lA "D:\lilian\STR71X\application #
# note\IAP using UART\an2078_IAR(forum)\an2078\IAP_V2. #
# 0\user\Debug\List\" -o "D:\lilian\STR71X\application #
# note\IAP using UART\an2078_IAR(forum)\an2078\IAP_V2 #
# .0\user\Debug\Obj\" -z2 --no_cse --no_unroll #
# --no_inline --no_code_motion --no_tbaa #
# --no_clustering --no_scheduling --debug --cpu_mode #
# arm --endian little --cpu ARM7TDMI --stack_align 4 #
# -e --fpu None --dlib_config "C:\Program Files\IAR #
# Systems\Embedded Workbench #
# 4.0\arm\LIB\dl4tpannl8n.h" --segment #
# code=CODE_Flash -I "D:\lilian\STR71X\application #
# note\IAP using UART\an2078_IAR(forum)\an2078\IAP_V2. #
# 0\user\..\include\" -I "D:\lilian\STR71X\application #
# note\IAP using UART\an2078_IAR(forum)\an2078\IAP_V2 #
# .0\user\..\common\" -I "C:\Program Files\IAR #
# Systems\Embedded Workbench 4.0\arm\INC\" #
# List file = D:\lilian\STR71X\application note\IAP using #
# UART\an2078_IAR(forum)\an2078\IAP_V2.0\user\Debug\Li #
# st\download.lst #
# Object file = D:\lilian\STR71X\application note\IAP using #
# UART\an2078_IAR(forum)\an2078\IAP_V2.0\user\Debug\Ob #
# j\download.r79 #
# #
# #
##############################################################################
D:\lilian\STR71X\application note\IAP using UART\an2078_IAR(forum)\an2078\IAP_V2.0\common\download.c
1 /******************** (C) COPYRIGHT 2006 STMicroelectronics ********************
2 * File Name : download.c
3 * Author : MCD Application Team
4 * Date First Issued : 10/25/2004
5 * Description : This file provides the software which allows to download
6 * an image to internal Flash.
7 ********************************************************************************
8 * History:
9 * 02/01/2006 : IAP Version 2.0
10 * 11/24/2004 : IAP Version 1.0
11 ********************************************************************************
12 THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH
13 CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. AS A
14 RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT OR
15 CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT OF SUCH
16 SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION CONTAINED HEREIN
17 IN CONNECTION WITH THEIR PRODUCTS.
18 ********************************************************************************/
19
20 #include "common.h"
21
22 extern char file_name[FILE_NAME_LENGTH];
23 /*******************************************************************************
24 * Function Name : SerialDownload
25 * Description : Download a file via serial port
26 * Input : None
27 * Return : None
28 *******************************************************************************/
\ In segment CODE_Flash, align 4, keep-with-next
29 void SerialDownload (void)
30 {
\ SerialDownload:
\ 00000000 30402DE9 PUSH {R4,R5,LR}
\ 00000004 0CD04DE2 SUB SP,SP,#+12
31 char Number[10];
32 s32 Size, DownloadAddr = 0x20002000;
\ 00000008 8005A0E3 MOV R0,#+536870912
\ 0000000C 800D80E3 ORR R0,R0,#0x2000
\ 00000010 0050B0E1 MOVS R5,R0
33 SerialPutString("Waiting for the file to be sent ... (press 'a' to abort)\n\r");
\ 00000014 A8009FE5 LDR R0,??SerialDownload_0 ;; `?<Constant "Waiting for the file ...">`
\ 00000018 ........ _BLF SerialPutString,??SerialPutString??rA
34 Size = Ymodem_Receive((char *)DownloadAddr);
\ 0000001C 0500B0E1 MOVS R0,R5
\ 00000020 ........ _BLF Ymodem_Receive,??Ymodem_Receive??rA
\ 00000024 0040B0E1 MOVS R4,R0
35 if (Size > 0)
\ 00000028 010054E3 CMP R4,#+1
\ 0000002C 110000BA BLT ??SerialDownload_1
36 {
37 SerialPutString("\n\n\rTransfer Completed Successfully!\n\r--------------------------------\r\n Name: ");
\ 00000030 90009FE5 LDR R0,??SerialDownload_0+0x4 ;; `?<Constant "\\n\\n\\rTransfer Completed...">`
\ 00000034 ........ _BLF SerialPutString,??SerialPutString??rA
38 SerialPutString(file_name);
\ 00000038 8C009FE5 LDR R0,??SerialDownload_0+0x8 ;; file_name
\ 0000003C ........ _BLF SerialPutString,??SerialPutString??rA
39 Int2Str(Number,Size);
\ 00000040 0410B0E1 MOVS R1,R4
\ 00000044 0D00B0E1 MOVS R0,SP
\ 00000048 ........ _BLF Int2Str,??Int2Str??rA
40 SerialPutString("\n\r Size: ");
\ 0000004C 7C009FE5 LDR R0,??SerialDownload_0+0xC ;; `?<Constant "\\n\\r Size: ">`
\ 00000050 ........ _BLF SerialPutString,??SerialPutString??rA
41 SerialPutString(Number);
\ 00000054 0D00B0E1 MOVS R0,SP
\ 00000058 ........ _BLF SerialPutString,??SerialPutString??rA
42 SerialPutString(" Bytes\r\n");
\ 0000005C 70009FE5 LDR R0,??SerialDownload_0+0x10 ;; `?<Constant " Bytes\\r\\n">`
\ 00000060 ........ _BLF SerialPutString,??SerialPutString??rA
43 SerialPutString("-------------------\n");
\ 00000064 6C009FE5 LDR R0,??SerialDownload_0+0x14 ;; `?<Constant "-------------------\\n">`
\ 00000068 ........ _BLF SerialPutString,??SerialPutString??rA
44 gimagesize = Size;
\ 0000006C 68009FE5 LDR R0,??SerialDownload_0+0x18 ;; gimagesize
\ 00000070 004080E5 STR R4,[R0, #+0]
\ 00000074 100000EA B ??SerialDownload_2
45 }
46 else if (Size == -1)
\ ??SerialDownload_1:
\ 00000078 010074E3 CMN R4,#+1
\ 0000007C 0200001A BNE ??SerialDownload_3
47 {
48 SerialPutString("\n\n\rThe image size is higher than 248 KBytes!\n\r");
\ 00000080 58009FE5 LDR R0,??SerialDownload_0+0x1C ;; `?<Constant "\\n\\n\\rThe image size is ...">`
\ 00000084 ........ _BLF SerialPutString,??SerialPutString??rA
\ 00000088 0B0000EA B ??SerialDownload_2
49 }
50 else if (Size == -2)
\ ??SerialDownload_3:
\ 0000008C 020074E3 CMN R4,#+2
\ 00000090 0200001A BNE ??SerialDownload_4
51 {
52 SerialPutString("\n\n\rVerification failed!\n\r");
\ 00000094 48009FE5 LDR R0,??SerialDownload_0+0x20 ;; `?<Constant "\\n\\n\\rVerification faile...">`
\ 00000098 ........ _BLF SerialPutString,??SerialPutString??rA
\ 0000009C 060000EA B ??SerialDownload_2
53 }
54 else if (Size == -3)
\ ??SerialDownload_4:
\ 000000A0 030074E3 CMN R4,#+3
\ 000000A4 0200001A BNE ??SerialDownload_5
55 {
56 SerialPutString("\r\n\nAborted by user.\n\r");
\ 000000A8 38009FE5 LDR R0,??SerialDownload_0+0x24 ;; `?<Constant "\\r\\n\\nAborted by user.\\n\\r">`
\ 000000AC ........ _BLF SerialPutString,??SerialPutString??rA
\ 000000B0 010000EA B ??SerialDownload_2
57 }
58 else
59 {
60 SerialPutString("\n\rFailed to receive the file!\n\r");
\ ??SerialDownload_5:
\ 000000B4 30009FE5 LDR R0,??SerialDownload_0+0x28 ;; `?<Constant "\\n\\rFailed to receive t...">`
\ 000000B8 ........ _BLF SerialPutString,??SerialPutString??rA
61 }
62 return;
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -