




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、不使用PE时自动生成的链接文件# -# Freescale sample code# linker command file for MC56F8367 Device# using # flash pROM# flash xROM # internal xRAM # Large Data Model (LDM)# -# see end of file for additional notes & revision history# see Freescale docs for specific device memory map# memory use for this LCF: #
2、interrupt vectors -> flash pROM starting at zero# program code -> flash pROM# constants -> flash xROM # dynamic data -> flash pROM (copied to xRAM with init) # CodeWarrior preference settings:# M56800E Processor:# Small Program Model: OFF# Large Data Model: ON# M56800E Assembler:# Defaul
3、t Data Memory Model: 24-bit# Default Program Memory Model: 19-bit# M56800E Target pref panel:# config file: 56836x_flash.cfg# (sets OMR for internal memory)# EVM board jumpers:# JG4 on# (if not set by config file)# 56836x memory map for:# Small Data Model (SDM)# x memory: EX=0 (OMR)# p memory: mode
4、0 # x memory above 7FFF not available with SDM# complete 56835 x-RAM shown for clarity# see below for memory notes#MC56F8367# p_FLASH# 00X3_FFFF : internal p flash# 0x4_00000x4_3fff : internal p boot flash# 0x4_f8000x4_ffff : on-chip p RAM# x_flash# 00x3fff : internal x RAM# 0x40000x7fff internal x
5、flash# MEMORY .p_interrupts_ROM (RX) : ORIGIN = 0x0000, LENGTH = 0x00AC # reserved for interrupts中断向量放在这个地址空间内。 .p_flash_ROM (RX) : ORIGIN = 0x00AC, LENGTH = 0x3FF54 # 256K words contiguous flash minus interrupt space #internal p flash used for code and pROM data(copy to xRAM)内部程序FLASH空间,用于存放代码和已初始化
6、数据。 # p_flash_ROM_data mirrors internal xRAM, mapping to origin and length # the "X" flag in "RX" tells the debugger to download to p-memory. # the download to p-memory is directed to the address determined by AT # in the section definition below. .p_flash_ROM_data (RX) : ORIGIN
7、= 0x0001, LENGTH = 0x3FFF # internal xRAM mirror constant data storaged here, storage address is specificated by AT.Usually behind the code.这个地址与内部数据RAM重合,已初始化数据放在pROM里然后拷贝到内部数据RAM。 .p_boot_flash_ROM (RX) : ORIGIN = 0x40000, LENGTH = 0x4000 # 16K words # .p_reserved : ORIGIN = 0x44000, LENGTH = 0xB8
8、00 # 46K words .p_internal_RAM (RWX) : ORIGIN = 0x4F800, LENGTH = 0x0800 # 2K words .p_external_RAM (RWX) : ORIGIN = 0x50000, LENGTH = 0x0000 # max available .x_internal_RAM (RW) : ORIGIN = 0x0001, LENGTH = 0x3FFF #ON_CHIP RAM .x_flash_ROM (RW) : ORIGIN = 0x4000, LENGTH = 0x4000 .x_external_RAM (RW)
9、 : ORIGIN = 0x8000, LENGTH = 0x7000 .x_onchip_peripherals (RW) : ORIGIN = 0xF000, LENGTH = 0x1000 .x_external_RAM_2 (RW) : ORIGIN = 0x10000, LENGTH = 0xFEFF00 .x_EOnCE (RW) : ORIGIN = 0xFFFF00, LENGTH = 0x0000 # we ensure the interrupt vector section is not deadstripped here# the label "interru
10、pt_vectors" comes from file 56835x_vector.asmKEEP_SECTION interrupt_vectors.text#保证中断向量不会被编译器优化掉SECTIONS .interrupt_code : * (interrupt_vectors.text) > .p_interrupts_ROM#保证中断向量放在这个位置ORIGIN = 0x0000, LENGTH = 0x00AC .boot_code : * (startup.text) * (utility.text) > .p_boot_flash_ROM#启动代码放在b
11、oot flash处 .executing_code :# .text sections * (interrupt_routines.text) * (rtlib.text)* (fp_engine.text)* (.text)* (user.text)# save address where for the data start in pROM . = ALIGN(2); _pROM_data_start = .; > .p_flash_ROM#程序代码放在内部程序flash区域 .data_in_xROM : # constant data is placed in x flash
12、ROM * (.const.data.char) # used if "Emit Separate Char Data Section" enabled * (.const.data) . = ALIGN(2); > .x_flash_ROM #常量数据放在内部数据flash区域 # AT sets the download address# the download stashes the data just after the program code# as determined by our saved pROM data start variable.dat
13、a_in_p_flash_ROM : AT(_pROM_data_start) #_pROM_data_start位于可执行代码的后面。告诉编译器将数据放置到AT所指定的ROM地址 # the data sections flashed to pROM # save data start so we can copy data later to xRAM _xRAM_data_start = .; * (.data.char) # used if "Emit Separate Char Data Section" * (.data) * (fp_state.data)* (
14、rtlib.data) # save data end and calculate data block size . = ALIGN(2); # ensure _data_size is word-aligned # since rom-to-ram copy is by word # and we could have odd-number bytes # in .data section since 56800E # has byte addressing_xRAM_data_end = .;_data_size = _xRAM_data_end - _xRAM_data_start;
15、> .p_flash_ROM_data # this section is designated as p-memory # with X flag in the memory map # the start address and length map to # actual internal xRAM#本段的data表示已经初始化的全局变量,这些初始化数据放在_pROM_data_start紧跟代码,而变量的地址则放在p_flash_ROM_data所对应的xRAM的地址区。经实例测试过。_xRAM_data_start即为片上RAM的起始地址,也就是说,该 段仅将初始化数据放在_p
16、ROM_data_start处。.data : # save space for the pROM data copy . = _data_size +1 ; # .bss sections . = ALIGN(2); * (rtlib.bss.lo) * (rtlib.bss) . = ALIGN(2); _bss_addr = .; * (.bss.char) # used if "Emit Separate Char Data Section" enabled * (.bss) _bss_end = .;_bss_size = _bss_end - _bss_addr
17、; # setup the heap address . = ALIGN(4); _heap_addr = .; _heap_size = 0x100; _heap_end = _heap_addr + _heap_size; . = _heap_end; # setup the stack address _min_stack_size = 0x200; _stack_addr = _heap_end + 2; _stack_end = _stack_addr + _min_stack_size; . = _stack_end; # used by MSL F_heap_addr = _he
18、ap_addr; F_heap_end = _heap_end; # stationery init code uses these globals: F_Lstack_addr = _stack_addr; # rom-to-ram utilityF_Ldata_size = _data_size;F_Ldata_RAM_addr = _xRAM_data_start;F_Ldata_ROM_addr = _pROM_data_start; F_xROM_to_xRAM = 0x0000; F_pROM_to_xRAM = 0x0001; # true # zeroBSS utility F
19、_Lbss_addr = _bss_addr; F_Lbss_size = _bss_size; > .x_internal_RAM # -# additional notes:# about the reserved sections:# p_interrupts_RAM - reserved in internal pRAM# memory space reserved for interrupt vectors# interrupt vectors must start at address zero# about the memory map:# SMM xRAM limit i
20、s 0x7FFF# about LCF conventions:# program memory (p memory)# (RWX) read/write/execute for pRAM# (RX) read/execute for flashed pROM# data memory (X memory)# (RW) read/write for xRAM# (R) read for data flashed xROM or reserved x memory# LENGTH = next start address - previous# LENGTH = 0x0000 means use
21、 all remaing memory# about ROM-to-RAM copying at init time:# In embedded programming, it is common for a portion of # a program resident in ROM to be copied into RAM at runtime.# For starters, program variables cannot be accessed until # they are copied to RAM. # To indicate data or code that is mea
22、nt to be copied # from ROM to RAM,the data or code is given two addresses.# One address is the resident location in ROM (defined by # the linker command file). The other is the intended# location in RAM (defined in C code where we will # do the actual copying).# To create a section with the resident
23、 location in ROM # and an intended location in RAM, you define the two addresses # in the linker command file.# Use the MEMORY segment to specify the intended RAM location,# and the AT(address)parameter to specify the resident ROM address.# revision history # 011226 R1.0 c.m. first version# 020220 R
24、1.1 a.h. updates# 020308 R1.1 a.h. 56838E# 021101 R2.0 a.h. R2.0 prep# 021204 R2.01 a.h. bss align by 1# 030222 R2.1 a.h. 568345/346# 030630 R6.0 a.h. ldm pROM-xRAM# 030814 R6.0 a.h. align(1) for data# 030916 R6.01 a.h. 56835x# 040723 R7.0 a.h. 56836x# 040723 R7.0 a.h. 56836x# - end - 使用PE时生成的链接文件1#
25、 # THIS BEAN MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.# Filename : FLASH_LDM.cmd# Project : bootloader1# Processor : 56F8367# Compiler : CodeWarrior DSP C Compiler# Date/Time : 2014-12-16, 14:28, # CodeGen: 3# Abstract :# This file is used by the linker. It describes files to be linked,# me
26、mory ranges, stack size, etc. For detailed description about linker# command files see CodeWarrior documentation. This file is generated by default.# You can switch off generation by setting the property "Generate linker file = no"# in the "Build options" tab of the CPU bean and
27、then modify this file as needed.# Copyright : 1997 - 2014 Freescale Semiconductor, Inc. # All Rights Reserved.# # Redistribution and use in source and binary forms, with or without modification,# are permitted provided that the following conditions are met:# # o Redistributions of source code must r
28、etain the above copyright notice, this list# of conditions and the following disclaimer.# # o Redistributions in binary form must reproduce the above copyright notice, this# list of conditions and the following disclaimer in the documentation and/or# other materials provided with the distribution.#
29、# o Neither the name of Freescale Semiconductor, Inc. nor the names of its# contributors may be used to endorse or promote products derived from this# software without specific prior written permission.# # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND# ANY
30、 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31、 DAMAGES# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
32、OF THE USE OF THIS# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.# # http: # mail: support# #MEMORY # I/O registers area for on-chip peripherals .x_Peripherals (RW) : ORIGIN = 0xF020, LENGTH = 0 # List of all sections specified in the "Build options" tab #Internal vector boo
33、t area. .p_Interruptsboot (RWX) : ORIGIN = 0x00040000, LENGTH = 0x0004 .p_Interrupts (RWX) : ORIGIN = 0x00000000, LENGTH = 0x000000AC .p_Code (RWX) : ORIGIN = 0x000000AC, LENGTH = 0x0003FF54 .x_Data (RW) : ORIGIN = 0x00000001, LENGTH = 0x00003FFF #Other memory segments .x_internal_ROM (RW) : ORIGIN
34、= 0x00004000, LENGTH = 0x4000 .p_internal_RAM (RWX) : ORIGIN = 0x0004F800, LENGTH = 0x0800KEEP_SECTION interrupt_vectorsboot.text KEEP_SECTION interrupt_vectors.text SECTIONS .interrupt_vectorsboot : F_vector_addr = .; # interrupt vectors boot area * (interrupt_vectorsboot.text) > .p_Interruptsbo
35、ot .interrupt_vectors : # interrupt vectors * (interrupt_vectors.text) > .p_Interrupts .ApplicationCode : F_Pcode_start_addr = .; # .text sections * (.text) * (rtlib.text) * (startup.text) * (fp_engine.text) * (ll_engine.text) * (user.text) * (.data.pmem) F_Pcode_end_addr = .; > .p_Code .Appli
36、cationData : # .data sections * (.const.data.char) # used if "Emit Separate Char Data Section" enabled * (.const.data) * (fp_state.data) * (rtlib.data) * (.data.char) # used if "Emit Separate Char Data Section" enabled * (.data) # .bss sections * (rtlib.bss.lo) * (rtlib.bss) . =
37、ALIGN(4); F_Xbss_start_addr = .; _START_BSS = .; * (.bss.char) # used if "Emit Separate Char Data Section" enabled * (.bss) . = ALIGN(2); # used to ensure proper functionality of the zeroBSS hardware loop utility _END_BSS = .; F_Xbss_length = _END_BSS - _START_BSS; /* Setup the HEAP addres
38、s */ . = ALIGN(4); _HEAP_ADDR = .; _HEAP_SIZE = 0x00000100; _HEAP_END = _HEAP_ADDR + _HEAP_SIZE; . = _HEAP_END; /* SETUP the STACK address */ _min_stack_size = 0x00000200; _stack_addr = _HEAP_END; _stack_end = _stack_addr + _min_stack_size; . = _stack_end; /* EXPORT HEAP and STACK runtime to librari
39、es */ F_heap_addr = _HEAP_ADDR; F_heap_end = _HEAP_END; F_Lstack_addr = _HEAP_END; F_StackAddr = _HEAP_END; F_StackEndAddr = _stack_end - 1; # runtime code _init_sections uses these globals: F_Ldata_size = 0x0000; F_Ldata_RAM_addr = 0x0000; F_Ldata_ROM_addr = 0x0000; F_Livt_size = 0x0000; F_Livt_RAM
40、_addr = 0x0000; F_Livt_ROM_addr = 0x0000; F_xROM_to_xRAM = 0x0000; F_pROM_to_xRAM = 0x0000; F_pROM_to_pRAM = 0x0000; F_start_bss = _START_BSS; F_end_bss = _END_BSS; _DATA_END=.; > .x_Data可以看出,.data是直接放在.x_Data里也就内部RAM里的,所以用下载工具下载时,初始过的变量能正确运行,而下电后重新上电是不能正确初始化的。使用PE时生成的链接文件2# # THIS BEAN MODULE IS
41、 GENERATED BY THE TOOL. DO NOT MODIFY IT.# Filename : FLASH_LDM.cmd# Project : bootloader1# Processor : 56F8367# Compiler : CodeWarrior DSP C Compiler# Date/Time : 2014-12-16, 14:57, # CodeGen: 6# Abstract :# This file is used by the linker. It describes files to be linked,# memory ranges, stack siz
42、e, etc. For detailed description about linker# command files see CodeWarrior documentation. This file is generated by default.# You can switch off generation by setting the property "Generate linker file = no"# in the "Build options" tab of the CPU bean and then modify this file
43、as needed.# Copyright : 1997 - 2014 Freescale Semiconductor, Inc. # All Rights Reserved.# # Redistribution and use in source and binary forms, with or without modification,# are permitted provided that the following conditions are met:# # o Redistributions of source code must retain the above copyri
44、ght notice, this list# of conditions and the following disclaimer.# # o Redistributions in binary form must reproduce the above copyright notice, this# list of conditions and the following disclaimer in the documentation and/or# other materials provided with the distribution.# # o Neither the name o
45、f Freescale Semiconductor, Inc. nor the names of its# contributors may be used to endorse or promote products derived from this# software without specific prior written permission.# # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR# ANY DIRECT,
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 【正版授权】 ISO/TR 8955:2025 EN Railway infrastructure - Track quality evaluation - Chord-based method
- 消费金融公司的市场调研与需求分析考核试卷
- 海底油气管道新型铺设技术考核试卷
- 煤气化中的清洁生产工艺优化研究考核试卷
- 水产加工企业发展战略规划与实施考核试卷
- 数字出版物的版权侵权案例分析考核试卷
- 期货市场风险管理工具比较服务考核试卷
- 果品、蔬菜种植气候智慧型农业考核试卷
- 上海代办租房合同标准文本
- 为企业安装合同标准文本
- 教育行业在线课程内容更新方案
- 2023-2024年高级经济师之工商管理试题库(有答案)
- 2024智慧水电厂建设方案
- 2024年21起典型火灾案例及消防安全知识专题培训(消防月)
- 校长为公共卫生安全第一人责任制度
- 辐射与防护学习通超星期末考试答案章节答案2024年
- GB/T 19228.1-2024不锈钢卡压式管件组件第1部分:卡压式管件
- GB/T 36187-2024冷冻鱼糜
- 2024年《监察法》知识考试题库及答案
- 抽水蓄能电站地下厂房岩锚梁开挖施工方案
- 奥鹏东北财经大学东财《EXCEL在财务工作中的应用》单元作业2参考答案
评论
0/150
提交评论