Use Memory Layout from Target Dialog Scatter File

参考

MDK-ARM Linker
Scatter File的用法(转载)

keil报错

Rebuild target 'Target 1'
assembling test1.s...
linking...
.\Objects\pro.axf: Error: L6630E: Invalid token start expected number or ( but found n at position 5 on line 5
.\Objects\pro.axf: Error: L6629E: Unmatched parentheses expecting ) but found n at position 5 on line 5
.\Objects\pro.axf: Error: L6226E: Missing base address for region LR_.
.\Objects\pro.sct(5): error: L6292E: Ignoring unknown attribute 'null' specified for region LR_.
.\Objects\pro.sct(5): error: L6228E: Expected '{', found ')...'.
.\Objects\pro.sct: Error: L6372E: Image needs at least one load region.
Not enough information to list image symbols.
Not enough information to list the image map.
Finished: 2 information, 0 warning and 6 error messages.
".\Objects\pro.axf" - 6 Error(s), 0 Warning(s).
Target not created.
Build Time Elapsed:  00:00:00

解决

在options 的Linker选项卡中不要选择Use Memory Layout from Target Dialog
并且把下边自动生成的Scatter file文本框清空。

原因

scatter文件提供内存映象中各个区​​域的分组和放置详细信息。The Memory Areas settings in Target can be used to create a linker scatter file. This requires enabling Use Memory Layout from Target Dialog in the dialog Options for Target - Linker. 勾选了Use Memory Layout from Target Dialog时使用的是The Memory Areas settings in Target Dialog自动生成的scatter文件,不勾选时使用的是scatter file框里的scatter file,你可以对它进行自定义编辑,它的内容一般来说是由取消勾选前由The Memory Areas settings in Target Dialog自动生成的。当你情空scatter框后会在链接命令后指明ro、rw的基地址

--cpu ARM920T *.o 
--ro-base 0x00000000 --entry 0x00000000 --rw-base 0x40000000 --strict --summary_stderr --info summarysizes --map --xref --callgraph --symbols 
--info sizes --info totals --info unused --info veneers 
 --list ".\Listings\pro.map" 
-o .\Objects\pro.axf 


Read/Only Memory Areas中的起始地址和大小对应的是scatter文件中的映像文件的加载地址和加载存储区域的大小;映像文件中RO部分的加载地址等于运行地址;而Read/Write Memory Areas中的地址即RW部分的运行地址。

posted @ 2018-10-03 17:16  灰太狼的喜羊羊  阅读(1906)  评论(0编辑  收藏  举报