用eclipse除錯uboot工程
分享一下我老師大神的人工智慧教程!零基礎,通俗易懂!http://blog.csdn.net/jiangjunshow
也歡迎大家轉載本篇文章。分享知識,造福人民,實現我們中華民族偉大復興!
用eclipse除錯uboot工程
----------------------------------------------------------------------
2013-4-7更新:整理的PDF版本,放到這裡了:
----------------------------------------------------------------------
本文是在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/[email protected]/blog/static/380812982012223104416462/
附件1:3裡邊輸入的內容在如下:(參考《JLlink+GDB除錯U-Boot 》中的.gdbinit)(更新:這個不能啟動核心,附件2可以)
## J-LINK GDB SERVER initialization## This connects to a GDB Server listening# for commands on localhost at tcp port 2331target remote 127.0.0.1:2331 #首先連線主機的GDB Server,埠都是2331。#注意主機的GDB Server勾掉"Localhost only"選項,否則連線不上# Set JTAG speed to 30 kHzmonitor speed 30 # Set GDBServer to little endianmonitor endian little #end# Reset the chip to get to a known state.monitor reset ## CPU core initialization# # Set the processor modemonitor reg cpsr = 0xd3 #disable watchdogmonitor MemU32 0x53000000 = 0x00000000 #disable interruptmonitor MemU32 0x4A000008 = 0xFFFFFFFF #INTMSKmonitor MemU32 0x4A00000C = 0x00007FFF #INTSUBMSK #set clockmonitor MemU32 0x4C000000 = 0x00FFFFFFmonitor MemU32 0x4C000014 = 0x00000005monitor MemU32 0x4C000004 = 0x0005C011 #config sdrammonitor MemU32 0x48000000 = 0x22011110 #conwmonitor MemU32 0x48000004 = 0x00000700 #bank0monitor MemU32 0x48000008 = 0x00000700 #bank1monitor MemU32 0x4800000C = 0x00000700 #bank2monitor MemU32 0x48000010 = 0x00000700 #bank3monitor MemU32 0x48000014 = 0x00000700 #bank4monitor MemU32 0x48000018 = 0x00000700 #bank5monitor MemU32 0x4800001C = 0x00018005 #bank6monitor MemU32 0x48000020 = 0x00018005 #bank7monitor MemU32 0x48000024 = 0x008E04F4 #vREFRESHmonitor MemU32 0x48000028 = 0xB1 #vBANKSIZE -- 128M/128M --- shouldmonitor MemU32 0x4800002c = 0x30 #vMRSRB6monitor MemU32 0x48000030 = 0x30 #vMRSRB7 # Set auto JTAG speedmonitor speed auto # Setup GDB FOR FASTER DOWNLOADSset remote memory-write-packet-size 1024set remote memory-write-packet-size fixed # Load the program executable called "image.elf"# load image.elfb _startloadcontinue
附件2:能啟動核心的指令碼內容:http://my.csdn.net/kangear/code/detail/40157 新:https://code.csdn.net/snippets/37660