用eclipse调试uboot工程

来源:互联网 发布:c语言开源项目 编辑:程序博客网 时间:2024/05/20 23:59

转自 http://blog.csdn.net/kangear/article/details/8639398

用eclipse导入uboot工程

----------------------------------------------------------------------

下了最新的eclipse.3.4.2.

启动的时候需要jvm1.5以上,先把自带的1.4卸载,方法见上一篇文章。(如果已经安装好eclipse从下边开始做

1。启动后,先new-》c project -》empty makefile project。toolchains选择other toolchain。

2。一直next后建立一个新的空白工程。

3。然后file-》import-》general-》file system

4。浏览uboot的目录,然后新建一个into目录,next,把需要的目录选上。

5。然后一直next即可。

6。这样uboot就导入到刚才建立的“uboot”工程了。


具体编译过程如下:

1、选择project --> make target --> creat,target name为smdk2440_config

2、编译工程project --> make target --> build,选择smdk2440_config,点build即可完成第一步(make smdk2440_config)

3、然后再project --> build all 或project --> build project都可以,都是相当于执行了make all(在开发板手册中第二步只执行了make,实际上也就是执行了make all)

至此,uboot make完毕。


说明:

1。如果出现编译出现错误,请在工程目录下手动make smdk2440_config; make 一下。看能不能成功

2。关于smdk2440_config,我移植的目标板起名smdk2440,根据你的变化。

3。最好能在命令行熟悉编译u-boot后,再来搞这个

4。u-boot版本为2009-11





参考1:http://blog.csdn.net/lanmanck/article/details/4264510

参考2:http://hi.baidu.com/flfxt/item/1d5b81c3d9b0cd360931c68b


用eclipse调试uboot工程

----------------------------------------------------------------------

2013-4-7更新:整理的PDF版本,放到这里了:http://download.csdn.net/detail/kangear/5230353

----------------------------------------------------------------------

   本文是在ubuntu12.10上调试的。首先保证jlink for linux中的JLinkGDBServer可以用!具体可以参考《(先留着,还没有整理好)。还要装好arm-linux-gdb安装方法参见这个《arm-linux-gdb的安装》。
0。安装 eclipse 插件 Zylin Embedded CDT
  打开 eclipsec 后,选择 Help->install New Software...在 Work with 位置输入http://com.zylin.cdt.feature 依指示完成安裝

打开上文中的U-boot3工程(可以参考这里《用eclipse导入uboot工程》),保证能正常编译。

1。启动后,先Run-》Debug Configrations 如下图配置:


2。点击Debuger,如下配置:


3。点击Commands-》如下配置:(里边填写的内容下附件)


4。依此点击如下图所示:


5。下边是调试窗口:


6。这样单步调度u-boot了。


参考1:《使用JLINK GDBSERVER调试U-BOOT的方法》http://blog.csdn.net/samantha_sun/article/details/6245504

参考2:《图解Ubuntu + Eclipse + JLink + arm-linux-gcc 配置》http://wenku.baidu.com/view/e4f9ad76f242336c1eb95ed2.html

参考3:《JLlink+GDB调试U-Boot  》http://blog.163.com/nesnil@126/blog/static/380812982012223104416462/


附件1:3里边输入的内容在如下:(参考《JLlink+GDB调试U-Boot  》中的.gdbinit)(更新:这个不能启动内核,附件2可以)

[html] view plain copy
  1. #  
  2.   
  3. # J-LINK GDB SERVER initialization  
  4.   
  5. #  
  6.   
  7. # This connects to a GDB Server listening  
  8.   
  9. # for commands on localhost at tcp port 2331  
  10.   
  11. target remote 127.0.0.1:2331 #首先连接主机的GDB Server,端口都是2331。  
  12.   
  13. #注意主机的GDB Server勾掉"Localhost only"选项,否则连接不上  
  14.   
  15. # Set JTAG speed to 30 kHz  
  16.   
  17. monitor speed 30  
  18.   
  19.    
  20.   
  21. # Set GDBServer to little endian  
  22.   
  23. monitor endian little  
  24.   
  25.    
  26. #end  
  27.   
  28. # Reset the chip to get to a known state.  
  29.   
  30. monitor reset  
  31.   
  32.    
  33.   
  34. #  
  35.   
  36. # CPU core initialization  
  37.   
  38. #  
  39.   
  40.    
  41.   
  42. # Set the processor mode  
  43.   
  44. monitor reg cpsr = 0xd3  
  45.   
  46.    
  47.   
  48. #disable watchdog  
  49.   
  50. monitor MemU32 0x53000000 = 0x00000000  
  51.   
  52.    
  53.   
  54. #disable interrupt  
  55.   
  56. monitor MemU32 0x4A000008 = 0xFFFFFFFF #INTMSK  
  57.   
  58. monitor MemU32 0x4A00000C = 0x00007FFF #INTSUBMSK  
  59.   
  60.    
  61.   
  62. #set clock  
  63.   
  64. monitor MemU32 0x4C000000 = 0x00FFFFFF  
  65.   
  66. monitor MemU32 0x4C000014 = 0x00000005  
  67.   
  68. monitor MemU32 0x4C000004 = 0x0005C011  
  69.   
  70.    
  71.   
  72. #config sdram  
  73.   
  74. monitor MemU32 0x48000000 = 0x22011110 #conw  
  75.   
  76. monitor MemU32 0x48000004 = 0x00000700 #bank0  
  77.   
  78. monitor MemU32 0x48000008 = 0x00000700 #bank1  
  79.   
  80. monitor MemU32 0x4800000C = 0x00000700 #bank2  
  81.   
  82. monitor MemU32 0x48000010 = 0x00000700 #bank3  
  83.   
  84. monitor MemU32 0x48000014 = 0x00000700 #bank4  
  85.   
  86. monitor MemU32 0x48000018 = 0x00000700 #bank5  
  87.   
  88. monitor MemU32 0x4800001C = 0x00018005 #bank6  
  89.   
  90. monitor MemU32 0x48000020 = 0x00018005 #bank7  
  91.   
  92. monitor MemU32 0x48000024 = 0x008E04F4 #vREFRESH  
  93.   
  94. monitor MemU32 0x48000028 = 0xB1 #vBANKSIZE -- 128M/128M --- should  
  95.   
  96. monitor MemU32 0x4800002c = 0x30 #vMRSRB6  
  97.   
  98. monitor MemU32 0x48000030 = 0x30 #vMRSRB7  
  99.   
  100.    
  101.   
  102. # Set auto JTAG speed  
  103.   
  104. monitor speed auto  
  105.   
  106.    
  107.   
  108. # Setup GDB FOR FASTER DOWNLOADS  
  109.   
  110. set remote memory-write-packet-size 1024  
  111.   
  112. set remote memory-write-packet-size fixed  
  113.   
  114.    
  115.   
  116. # Load the program executable called "image.elf"  
  117.   
  118. # load image.elf  
  119.   
  120. b _start  
  121.   
  122. load  
  123.   
  124. continue  

附件2:能启动内核的脚本内容:http://my.csdn.net/kangear/code/detail/40157 新:https://code.csdn.net/snippets/37660

原创粉丝点击