📄 start.lst
字号:
###############################################################################
# #
# IAR ANSI C/C++ Compiler V6.10.1.52143/W32 for ARM 16/Apr/2011 20:57:47 #
# Copyright 1999-2010 IAR Systems AB. #
# #
# Cpu mode = thumb #
# Endian = little #
# Source file = E:\Project\15_K60\03_Software\02_My #
# program\K60_IAR\03_uart_int\src\Project_Settings\Startup #
# _Code\start.c #
# Command line = "E:\Project\15_K60\03_Software\02_My #
# program\K60_IAR\03_uart_int\src\Project_Settings\Startup #
# _Code\start.c" -D IAR -D TWR_K60N512 -lCN #
# "E:\Project\15_K60\03_Software\02_My #
# program\K60_IAR\03_uart_int\bin\Ram\List\" -lB #
# "E:\Project\15_K60\03_Software\02_My #
# program\K60_IAR\03_uart_int\bin\Ram\List\" -o #
# "E:\Project\15_K60\03_Software\02_My #
# program\K60_IAR\03_uart_int\bin\Ram\Obj\" --no_cse #
# --no_unroll --no_inline --no_code_motion --no_tbaa #
# --no_clustering --no_scheduling --debug --endian=little #
# --cpu=Cortex-M4 -e --fpu=None --dlib_config #
# D:\iar\arm\INC\c\DLib_Config_Normal.h -I #
# "E:\Project\15_K60\03_Software\02_My #
# program\K60_IAR\03_uart_int\src\Sources\H\" -I #
# "E:\Project\15_K60\03_Software\02_My #
# program\K60_IAR\03_uart_int\src\Sources\H\Component_H\" #
# -I "E:\Project\15_K60\03_Software\02_My #
# program\K60_IAR\03_uart_int\src\Sources\H\Frame_H\" -Ol #
# --use_c++_inline #
# List file = E:\Project\15_K60\03_Software\02_My #
# program\K60_IAR\03_uart_int\bin\Ram\List\start.lst #
# Object file = E:\Project\15_K60\03_Software\02_My #
# program\K60_IAR\03_uart_int\bin\Ram\Obj\start.o #
# #
# #
###############################################################################
E:\Project\15_K60\03_Software\02_My program\K60_IAR\03_uart_int\src\Project_Settings\Startup_Code\start.c
1 //-------------------------------------------------------------------------*
2 // 文件名:start.c *
3 // 说 明: CPU启动后进行系统配置 *
4 //-------------------------------------------------------------------------*
5
6 //头文件
7 #include "common.h"
8 #include "wdog.h"
9 #include "sysinit.h"
10
11 #pragma section = ".data"
12 #pragma section = ".data_init"
13 #pragma section = ".bss"
14 #pragma section = "CodeRelocate"
15 #pragma section = "CodeRelocateRam"
16
17 //内部函数声明
18 //-------------------------------------------------------------------------*
19 //函数名: common_startup *
20 //功 能: 复制中断向量表到RAM中 *
21 //参 数: 无 *
22 //说 明: 将ROM中的初始化数据拷贝到RAM中 *
23 //-------------------------------------------------------------------------*
24 void common_startup(void);
25
26 //-------------------------------------------------------------------------*
27 //函数名: start *
28 //功 能: 系统启动 *
29 //参 数: 无 *
30 //说 明: 无 *
31 //-------------------------------------------------------------------------*
\ In section .text, align 2, keep-with-next
32 void start(void)
33 {
\ start:
\ 00000000 80B5 PUSH {R7,LR}
34 //关闭看门狗
35 wdog_disable();
\ 00000002 ........ BL wdog_disable
36 //复制中断向量表到RAM中
37 common_startup();
\ 00000006 ........ BL common_startup
38 //系统设置
39 sysinit();
\ 0000000A ........ BL sysinit
40 //进入主函数
41 main();
\ 0000000E ........ BL main
42 }
\ 00000012 01BD POP {R0,PC} ;; return
43
44
45 //-------------------------------------------------------------------------*
46 //函数名: common_startup *
47 //功 能: 复制中断向量表到RAM中 *
48 //参 数: 无 *
49 //说 明: 将ROM中的初始化数据拷贝到RAM中 *
50 //-------------------------------------------------------------------------*
\ In section .text, align 2, keep-with-next
51 void common_startup(void)
52 {
\ common_startup:
\ 00000000 80B5 PUSH {R7,LR}
53 /* Declare a counter we'll use in all of the copy loops */
54 uint32 n;
55
56
57 /* Addresses for VECTOR_TABLE and VECTOR_RAM come from the linker file */
58 extern uint32 __VECTOR_TABLE[];
59 extern uint32 __VECTOR_RAM[];
60
61 /* Copy the vector table to RAM */
62 if (__VECTOR_RAM != __VECTOR_TABLE)
\ 00000002 .... LDR.N R0,??DataTable0
\ 00000004 .... LDR.N R1,??DataTable0_1
\ 00000006 8842 CMP R0,R1
\ 00000008 0BD0 BEQ.N ??common_startup_0
63 {
64 for (n = 0; n < 0x410; n++)
\ 0000000A 0020 MOVS R0,#+0
\ 0000000C 06E0 B.N ??common_startup_1
65 __VECTOR_RAM[n] = __VECTOR_TABLE[n];
\ ??common_startup_2:
\ 0000000E .... LDR.N R1,??DataTable0
\ 00000010 .... LDR.N R2,??DataTable0_1
\ 00000012 52F82020 LDR R2,[R2, R0, LSL #+2]
\ 00000016 41F82020 STR R2,[R1, R0, LSL #+2]
\ 0000001A 401C ADDS R0,R0,#+1
\ ??common_startup_1:
\ 0000001C B0F5826F CMP R0,#+1040
\ 00000020 F5D3 BCC.N ??common_startup_2
66 }
67 /* Point the VTOR to the new copy of the vector table */
68 write_vtor((uint32)__VECTOR_RAM);
\ ??common_startup_0:
\ 00000022 .... LDR.N R0,??DataTable0
\ 00000024 ........ BL write_vtor
69
70 /* Get the addresses for the .data section (initialized data section) */
71 uint8* data_ram = __section_begin(".data");
\ 00000028 .... LDR.N R1,??DataTable0_2
72 uint8* data_rom = __section_begin(".data_init");
\ 0000002A .... LDR.N R2,??DataTable0_3
73 uint8* data_rom_end = __section_end(".data_init");
\ 0000002C .... LDR.N R0,??DataTable0_4
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -