1 MEMORY
2 {
3 PAGE 0 :
4 RAMM0 : origin = 0x000000, length = 0x000400
5 /******************************************************************
6 *On F281x L0 SARAM is 0x008000-0x008FFF, and L1 SARAM is
7 * 0x009000-0x009FFF.
8 * Hence, whole SECURE_RAM is 0x008000-0x009FFF
9 *******************************************************************/
10 SECURE_RAM : origin = 0x008000, length = 0x002000
11 BEGIN_FLASH : origin = 0x3F7FF6, length = 0x000002 /*RAM run:0x3F9FFa*/
12
13 RESET : origin = 0x3FFFC0, length = 0x000002
14 VECTORTS : origin = 0x3FFFc2, length = 0x00003e
15
16 FLASH : origin = 0x3d8000, length = 0x01FF80 /* for Flash */
17
18 /*PRAMH0 : origin = 0x3F8000, length = 0x001ff4 */ /*for RAM 0x001ffe*/
19
20
21 PAGE 1 :
22 /* SARAM */
23 RAMM1 : origin = 0x000400, length = 0x000400
24 DRAMH0 : origin = 0x3f8000, length = 0x002000
25
26 }
27
28
29 SECTIONS
30 {
31 /* Allocate program areas: */
32 secureRamfuncs : LOAD=FLASH, PAGE = 0 /*PRAMH0*/
33 RUN=SECURE_RAM,PAGE=0
34 RUN_START(_secureRamFuncs_runstart),
35 LOAD_START(_secureRamFuncs_loadstart),
36 LOAD_END(_secureRamFuncs_loadend)
37 .reset : > FLASH, PAGE = 0 /*PRAMH0*/
38 .text : > FLASH, PAGE = 0 /*PRAMH0*/
39 .cinit : > FLASH, PAGE = 0 /*PRAMH0*/
40 /* zhaowritefunc : LOAD=FLASH,PAGE=0
41 RUN=SECURE_RAM,PAGE=0
42 RUN_START(_zhaowritefunc_runstart),
43 LOAD_START(_zhaowritefunc_loadstart),
44 LOAD_END(_zhaowritefunc_loadend)
45 zhaoreadfunc : LOAD=FLASH,PAGE=0
46 RUN=SECURE_RAM,PAGE=0
47 RUN_START(_zhaoreadfunc_runstart),
48 LOAD_START(_zhaoreadfunc_loadstart),
49 LOAD_END(_zhaoreadfunc_loadend)
50 transmit_work_scifunc : LOAD=FLASH,PAGE=0
51 RUN=SECURE_RAM,PAGE=0
52 RUN_START(_transmit_work_scifunc_runstart),
53 LOAD_START(_transmit_work_scifunc_loadstart),
54 LOAD_END(_transmit_work_scifunc_loadend)
55 transmit_work_usbfunc : LOAD=FLASH,PAGE=0
56 RUN=SECURE_RAM,PAGE=0
57 RUN_START(_transmit_work_usbfunc_runstart),
58 LOAD_START(_transmit_work_usbfunc_loadstart),
59 LOAD_END(_transmit_work_usbfunc_loadend)*/
60
61 /* frame_valid_low_test_programfuncs: LOAD=FLASH,PAGE=0
62 RUN=SECURE_RAM,PAGE=0
63 RUN_START(_frame_valid_low_test_programfuncs_runstart),
64 LOAD_START(_frame_valid_low_test_programfuncs_loadstart),
65 LOAD_END(_frame_valid_low_test_programfuncs_loadend)
66
67 frame_valid_high_test_programfuncs: LOAD=FLASH,PAGE=0
68 RUN=SECURE_RAM,PAGE=0
69 RUN_START(_frame_valid_high_test_programfuncs_runstart),
70 LOAD_START(_frame_valid_high_test_programfuncs_loadstart),
71 LOAD_END(_frame_valid_high_test_programfuncs_loadend)
72 */
73 /* fifo_empty_test_programfuncs : LOAD=FLASH,PAGE=0
74 RUN=SECURE_RAM,PAGE=0
75 RUN_START(_fifo_empty_test_programfuncs_runstart),
76 LOAD_START(_fifo_empty_test_programfuncs_loadstart),
77 LOAD_END(_fifo_empty_test_programfuncs_loadend)
78 fifo_half_test_programfuncs : LOAD=FLASH,PAGE=0
79 RUN=SECURE_RAM,PAGE=0
80 RUN_START(_fifo_half_test_programfuncs_runstart),
81 LOAD_START(_fifo_half_test_programfuncs_loadstart),
82 LOAD_END(_fifo_half_test_programfuncs_loadend)
83 */
84
85
86 /* tint0_sub_lowRAMFUNCS : LOAD=FLASH,PAGE=0
87 RUN=SECURE_RAM,PAGE=0
88 RUN_START(_tint0_sub_lowRAMFUNCS_runstart),
89 LOAD_START(_tint0_sub_lowRAMFUNCS_loadstart),
90 LOAD_END(_tint0_sub_lowRAMFUNCS_loadend) */
91 /* Jump to the Flash boot mode Entry! */
92 codestart : LOAD = BEGIN_FLASH, PAGE = 0
93
94 /* Allocate data areas: */
95 .stack : > RAMM1, PAGE = 1
96 .bss : > DRAMH0, PAGE = 1
97 .ebss : > DRAMH0, PAGE = 1
98 .const : > DRAMH0, PAGE = 1
99 .econst : > DRAMH0, PAGE = 1
100 .sysmem : > DRAMH0, PAGE = 1
101 }
上面代码执行后跳到C初始化的入口_c_int00(0x3F6000),在C初始化的入口,_c_int00对一些变量,堆栈和寄存器进行必要的设置,这个函数在运行支持库(rts.lib)中,_c_int00函数为建立C运行环境,需完成以下工作:
为系统堆栈产生.stack块,并初始化堆栈指针;
从.cinit块将初始化数据拷贝到.bss块中相应的变量;
对寄存器进行必要的配置,调用main函数开始运行C程序。
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/tongxinshuyu/article-39166-3.html
国之不幸啊
我不追星
撞死他
消灭一切反动派