MDK linker和debug的设置以及在RAM中调试

有误或者表述不清楚请指出,谢谢 

硬件:TQ2440开发板、jlink  V8 固件

软件:J-LINK  ARM 4.08i、MDK4.20

 

先解释下MDK中三种linker之间的区别

设置集中在option linker选项卡

1.采用Target对话框中的ram和rom地址。采用此方式,需在linker选项卡中的Use Memort Layout from

Target Diaglog选项选中,并且在Target中设置好ram、rom地址。MDK会根据Target对话框中设定的ram

和rom地址自动生成一个分散加载文件。最后链接器会根据此文件中的信息对目标文件进行连接,生成axf文件。

如下图:

至于rom和ram是片内还是片外,容量多大就需要根据芯片和开发板来决定了。

 

2.直接通过linker选项卡中的R/O Base和R/W Base来设定链接信息。链接器最后可根据此处指定的地址信息进

行连接,连接的文件应该是顺序存放了,最多RO和RW分开。此时需要注意的是应将 Use Memort Layout from

Target Diaglog前的勾去掉,且保证Scatter File中未包含分散加载文件。并且要在Misc control中设定镜像的入口点,如:

--first 2440init.o(Init)

 

2440init.o对应的是启动代码汇编源文件2440init.s,Init是对应的是段名在异常向量表之前。此处需要根据具体文件修改。

3.最后一种为直接采用分散加载文件。

在设置linker的时候可以注意下linker control string的信息,看看linker的输入信息是否符合自己的要求。

此处应该是只要选择使用scatter file文件,那么其他链接方式的设置自动失效。

可以从linker control string的信息看出来。

 

对应TQ2440开发板的设置

由于TQ2440开发板采用的是片外的ram和片外的flash,所以我这里直接采用前面说到的第二种方法。

就是通过手动设置ro的地址,其中0x30000000就是片外ram的地址。rw未指定,则说明rw数据顺序

存存放到ro段之后。

 

MDK Jlink 外部RAM调试设置

设置集中在option 的debug选项卡下

1.先将黑点调到右边,然后在右边的下拉框中选中J-LINK/J-TRACE,然后点击Setting,找到Info中的JLink,点击查看Jlink和MDK能否连接起来,在点击下面的Target查看仿真器能否找到cpu。

load Application at startup貌似去掉和不去掉的效果是一样的,猜测这个选项和前面Target中的rom地址有关,因为rom地址的后面有startup这个选项。我这里未采用Target方式链接,所以将此勾去掉了。

2.然后是ram调试是最重要的init文件。这个文件的作用是在加载axf调试文件前先将ram初始化完毕,需要完成设置总线时钟,设置bank控制寄存器等(sdram直接挂在bank6上)。本来想偷懒,直接将MDK安装文件夹下Clabsys公司的2440开发板的Ext_RAM.ini拷贝出来,结果调试的时候出现了莫名其妙的错误,猜测是初始化的问题。打开看了下,发现能看懂,MDK自带的文件只初始化了bank6。于是动手将TQ2440的init_sdram改造了下,做了个新的Ext_RAM.ini,可以顺利调试。需要注意的是,Init文件需要根据工程做一定修改,具体是在LOAD命令处。附init文件:

 

 

[cpp] view plaincopyprint?
  1. FUNC void SetupForStart (void) { 
  2.  
  3. // <o> Program Entry Point  
  4.   PC = 0x30000000; 
  5.  
  6.  
  7. FUNC void Init (void) { 
  8.     _WDWORD(0x53000000, 0x00000000); 
  9.     _WDWORD(0x4A000008, 0xFFFFFFFF); 
  10.     _WDWORD(0x4A00001C, 0x000007FF); 
  11.     _WDWORD(0x53000000, 0x00000000); 
  12.     _WDWORD(0x56000050, 0x000055AA); 
  13.     _WDWORD(0x4C000014, 0x00000007); 
  14.     _WDWORD(0x4C000000, 0x00FFFFFF); 
  15.     _WDWORD(0x4C000004, 0x00061012); 
  16.     _WDWORD(0x4C000008, 0x00040042); 
  17.     _WDWORD(0x48000000, 0x22111120); 
  18.     _WDWORD(0x48000004, 0x00002F50); 
  19.     _WDWORD(0x48000008, 0x00000700); 
  20.     _WDWORD(0x4800000C, 0x00000700); 
  21.     _WDWORD(0x48000010, 0x00000700); 
  22.     _WDWORD(0x48000014, 0x00000700); 
  23.     _WDWORD(0x48000018, 0x0007FFFC); 
  24.     _WDWORD(0x4800001C, 0x00018005); 
  25.     _WDWORD(0x48000020, 0x00018005); 
  26.     _WDWORD(0x48000024, 0x008E0459); 
  27.     _WDWORD(0x48000028, 0x00000032); 
  28.     _WDWORD(0x4800002C, 0x00000030); 
  29.     _WDWORD(0x48000030, 0x00000030); 
  30.  
  31.  
  32. // Reset chip with watchdog, because nRST line is routed on hardware in a way   
  33. // that it can not be pulled low with ULINK  
  34.  
  35. _WDWORD(0x40000000, 0xEAFFFFFE);        // Load RAM addr 0 with branch to itself  
  36. CPSR = 0x000000D3;                      // Disable interrupts  
  37. PC   = 0x40000000;                      // Position PC to start of RAM  
  38. _WDWORD(0x53000000, 0x00000021);        // Enable Watchdog  
  39. g, 0                                    // Wait for Watchdog to reset chip  
  40.  
  41. Init();                                 // Initialize memory  
  42. LOAD ..\output\codec.axf INCREMENTAL    // 此处需修改axf文件的路径各工程设置可能不一样需要在此处修改!  
  43. SetupForStart();                        // Setup for Running  
  44. stop, pc                                // 想要直接到main可设置为  g, main 
FUNC void SetupForStart (void) {// <o> Program Entry PointPC = 0x30000000;
}FUNC void Init (void) {_WDWORD(0x53000000, 0x00000000);_WDWORD(0x4A000008, 0xFFFFFFFF);_WDWORD(0x4A00001C, 0x000007FF);_WDWORD(0x53000000, 0x00000000);_WDWORD(0x56000050, 0x000055AA);_WDWORD(0x4C000014, 0x00000007);_WDWORD(0x4C000000, 0x00FFFFFF);_WDWORD(0x4C000004, 0x00061012);_WDWORD(0x4C000008, 0x00040042);_WDWORD(0x48000000, 0x22111120);_WDWORD(0x48000004, 0x00002F50);_WDWORD(0x48000008, 0x00000700);_WDWORD(0x4800000C, 0x00000700);_WDWORD(0x48000010, 0x00000700);_WDWORD(0x48000014, 0x00000700);_WDWORD(0x48000018, 0x0007FFFC);_WDWORD(0x4800001C, 0x00018005);_WDWORD(0x48000020, 0x00018005);_WDWORD(0x48000024, 0x008E0459);_WDWORD(0x48000028, 0x00000032);_WDWORD(0x4800002C, 0x00000030);_WDWORD(0x48000030, 0x00000030);
}// Reset chip with watchdog, because nRST line is routed on hardware in a way 
// that it can not be pulled low with ULINK_WDWORD(0x40000000, 0xEAFFFFFE);        // Load RAM addr 0 with branch to itself
CPSR = 0x000000D3;                      // Disable interrupts
PC   = 0x40000000;                      // Position PC to start of RAM
_WDWORD(0x53000000, 0x00000021);        // Enable Watchdog
g, 0                                    // Wait for Watchdog to reset chipInit();                                 // Initialize memory
LOAD ..\output\codec.axf INCREMENTAL    // 此处需修改axf文件的路径各工程设置可能不一样需要在此处修改!
SetupForStart();                        // Setup for Running
stop, pc                                // 想要直接到main可设置为  g, main

具体设置如图:

转载:http://blog.csdn.net/rockrockwu/article/details/7093435

转载于:https://www.cnblogs.com/Hdd-Yi/archive/2013/04/19/3030386.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/274283.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

FS_S5PC100 UBOOT-2011.12移植,支持DM9000

在uboot中已经支持了DM9000驱动代码在drivers/net/目录下的dm9000x.c dm9000x.h 修改include/configs/smdkc100.h 文件&#xff0c;注释掉SMC911X的支持&#xff0c;添加对DM9000的支持//#define CONFIG_SMC911X 1 /* we have a SMC9115 on-board *///#define…

为什么ui框架设计成单线程_评估UI设计的备忘单

为什么ui框架设计成单线程Whether you’re evaluating your design proposals or giving feedback to a colleague during a design critique or an informal conversation, you may find this actionable cheat sheet valuable. It’s quick to digest and its questions are …

css 菜单栏悬停_在CSS中构建悬停菜单

css 菜单栏悬停A good menu design is an important part of any website or web app UI. Using only modern HTML and CSS, all kinds of menu combinations can be created to handle whatever user interactions are necessary. In this article, we’ll take a look at how…

一级学科和二级学科_在多学科团队中工作的6个障碍(以及如何解决这些问题)

一级学科和二级学科In a team with different skillsets, one can be hopeful and idealistic about the outcome. The goal is to work as one team, put users first and create awesome experiences. Unfortunately, things don’t always go as planned.在一支具有不同技能…

LBS核心技术解析(引子)

http://www.cnblogs.com/LBSer/archive/2013/04/25/3048754.html 引子&#xff1a; 人们常用“上知天文&#xff0c;下知地理”来形容一个人的博学&#xff0c;人们总是用三要素论“什么时间、什么地点&#xff0c;发生或干了什么事情”来描述一件事情,人们也常常借用“天时、地…

lynda ux_如何建立内部UX团队

lynda uxWritten by Cassandra Naji由卡珊德拉纳吉 ( Cassandra Naji)撰写 The needs of real users are increasingly driving enterprise software design and development. Since 2013, IBM has hired close to 1500 designers and UXers, establishing the largest design…

IE6下div宽高设置

IE6下宽高设置。IE下div 中没有内容时&#xff0c;设置宽高不起作用&#xff0c;必须设置div背景色&#xff0c;并使用滤镜。才能使Div填充目标区域。多用于&#xff0c;其他容器元素使用背景图片&#xff0c;但是背景图片的部分需要其他的事件支持。如跳转。可以使用放置div的…

财务软件开发_财务独立对软件开发人员的重要性

财务软件开发If you read this post, chances that you are a software developer who is seeking financial advice for smart money-saving or investment or early retirement.如果您阅读此文章&#xff0c;则您很可能是一名软件开发人员&#xff0c;正在为精明的省钱或投资…

WIP模块常用表结构

WIP模块常用表结构表名: wip.wip_accounting_classes说明: 离散作业会计科目CLASS_CODE VARCHAR2(10) 帐目ORGANIZATION_ID NUMBER 组织代码CLASS_TYPE NUMBER 帐目类型DESCRIPTION VARCHAR2(240) 描述…

book电子书数据库设计_如何为杀手book的封面设计写出完美的摘要

book电子书数据库设计逐步出版真正的假人 (BOOK PUBLISHING STEP BY STEP FOR REAL DUMMIES) I have spent 18 years in advertising, briefing designers and art directors on various projects — from the simplest typo-only banners to the most complex integrated camp…

5g的负面影响_设计系统的实施是否会对早期概念产生负面影响?

5g的负面影响Athe financial institution where I was recently working the design system was maintained in Sketch libraries and code. A small team working across multiple brands means there is always a question for why we may or may not maintain something. We…

每日英语:Five Really Dumb Money Moves You've Got to Avoid

You know the smartest things to do with your money. But what are the worst moves? What should you avoid?Weirdly enough, they are things that a surprising number of people are still doing─even though they probably know, in their heart of hearts, how fool…

像素/厘米与像素/英寸区别_像素/体素艺术入门指南

像素/厘米与像素/英寸区别Here’s some resources I’ve found helpful so you can start learning pixel or voxel art (as a continuation of this post on 3D resources). Feel free to mention anything I missed in the comments!这是我发现有帮助的一些资源&#xff0c;因…

畅通工程续 最短路

某省自从实行了很多年的畅通工程计划后&#xff0c;终于修建了很多路。不过路多了也不好&#xff0c;每次要从一个城镇到另一个城镇时&#xff0c;都有许多种道路方案可以选择&#xff0c;而某些方案要比另一些方案行走的距离要短很多。这让行人很困扰。现在&#xff0c;已知起…

Vim中数字自增、自减

&#xff08;1&#xff09;ctrl a&#xff1a;数字自动增加1 按下ctrl a&#xff1a; &#xff08;2&#xff09;number ctrl a&#xff1a;数字自动增加number 例子&#xff1a;想将20修改成100&#xff0c;按下80 ctrl a&#xff1a; &#xff08;3&#xff09;ctrl x…

本土链雷达网_走向本土设计

本土链雷达网I’m old enough to remember when you could pick up any regional graphic design annual, open it, and know exactly which area you were looking at just from the work itself. Tennessee or Texas. Southern California or the Pacific Northwest. New Yor…

pyqt5子窗口跳出主窗口_弹出式窗口与 可用性,转换和跳出率

pyqt5子窗口跳出主窗口Written by Cassandra Naji由卡珊德拉纳吉 ( Cassandra Naji)撰写 They go by many names — modal windows, dialog boxes, modal pop-ups — but whatever you call them, pop-ups have a reputation for being divisive when it comes to usability. …

系统应用iPad设备应用需定制开发的3大理由

这几周朋友几篇文章介绍了改系统应用的文章. 关联文章的地址 iPad设备应用需定制发开的3大理由 通过深入分析iPad设备及iPad应用系统的实际情况&#xff0c;直接将现有的基于PC系统发开的信应用系统&#xff0c;直接迁移到iPad设备上&#xff0c;存在以下几方面的出突问题。也是…

移动硬盘不可用_如何对您的网站执行移动可用性审核

移动硬盘不可用In the wake of 在之后 Mobilegeddon, ensuring a good experience for your mobile users is more important than ever. With Google now giving preference to mobile-friendly sites in the search rankings, now is the time to ensure optimal mobile per…

开源服务器Tornado的初步了解

文章结束给大家来个程序员笑话&#xff1a;[M] 明天看了下Python的一个新web框架&#xff0c;由Facebook开源。不得不说&#xff0c;品牌效应啊&#xff0c;只要是Facebook开源的目项&#xff0c;没有不好用的。Tornado可以说是好用到了极致&#xff0c;从开打官方面页开始懂得…