Eclipse + Jlink gdbSever debug mini6410 uboot

Source: Internet
Author: User
Tags jlink

Eclipse + jlink gdbsever debug mini6410 uboot
Since the hardware does not support simulators when the mini6410 is released, you need to modify the settings. For details, see
Rvds2.2 + jlink V8 debug mini6410 (http://www.towoo.net/forum.php? MoD = viewthread & tid = 245 & page = 1 & extra = # pid267)
There have been many articles on the Internet for eclipse graphical method debugging. This article also gets a lot from it, but it only applies debugging to 6410.
List the software:
1. Eclipse-SDK-3.6-win32 http://www.eclipse.org/downloads/
2. Cdt-master-7.0 http://www.eclipse.org/cdt/downloads.php
3. zylin plug-in http://www.zylin.com/zylincdt/
4, yagarto-tools-20100703-setup http://www.yagarto.de/#download
5. yagarto-bu-2.20.1_gcc-4.5.1-c-gdb-7.1_eabi http://www.yagarto.de/#download
6. jlinkarm_v1_ I http://www.segger.com/cms/jlink-software.html
Note: For jlink software packages, test in v4.10. The higher version is not necessarily supported.
After correctly connecting the mini6410 Development Board and jlink, open the gdb server and read the arm11. the status is waiting for connection.
 
This article briefly introduces how to debug uboot In the debugging environment. I tried to compile uboot in windows but it was not successful. Therefore, uboot in ELF format compiled in Linux is used here. Copy the compiled uboot in ELF format to the uboot original code folder in windows, which is convenient for later import. In addition, MMU is used for 6410 of uboot. To simplify the process, you can find the macro definition switch # define config_enable_mmu in/include/configs/mini6410.h and comment it out. In addition, you need to modify the text_base value in/board/Samsung/mini6410/config. mk and change 0xc7e00000 to 0x57e00000. Create a new C Project, as shown in.
 
The following figure is displayed. Select makefile project> Empty Project> Other toolchain and click Finish.
 

.
 
Click "Next". Click "Browse" here to find the uboot source code and import the required source code (this article debugs uboot Based on mini6410). Otherwise, there may be some trouble, you can try it several times to find out which features are unavailable.
 
After clicking finish, the source code has been imported.
 
Next, you need to set up eclipse to compile and debug arm-based programs. It is used to set the cross-compiler arm-none-eabi-gcc.exe. This article does not allow uboot debugging, but you can set it for future convenience.
 
Similarly, you can set your own development environment.
 
The following is the core part of this article. Click Run-> Debug deployments,
 
Appears:
 
Here we use zylin Embedded debug (Native). In the Main tab, C/C ++ Application is an important option, select the uboot In the ELF format to be debugged.

Set the Debugger tab below and set GDB debuggerto arm-none-eabi-gdb.exe. This is the cross-Debugger for future debugging. Clear the GDB command file.
 

Next, set the Command tab and add the code for initializing mini6410 in 'initialize' Command. This Code conforms to the syntax structure of Jlink gdbserver.
 
The detailed code is as follows, with simple comments.
# Connect to the J-Link gdb server
Target remote localhost: 2331
# Set JTAG speed to 30 kHz
Monitor endian little
Monitor speed 30
# Reset the target
Monitor reset
Monitor sleep 10
#
# CPU core initialization (to be done by user)
#
# Set the processor mode
Monitor reg cpsr = 0xd3
# Config MMU
# Flush v3/v4 cache
Monitor cp15 7, 7, 0, 0 = 0x0
#/* Flush v4 TLB */
Monitor cp15 8, 7, 0, 0 = 0x0
# Disable MMU stuff and caches
Monitor cp15 1, 0, 0, 0 = 0x1002
# Peri port setup
Monitor cp15 15, 2, 0, 4 = 0x70000013
# Disable watchdog
Monitor MemU32 0x7e004000 = 0x00000000
Monitor sleep 10
# Disable interrupt
Monitor MemU32 0x71200014 = 0x00000000
Monitor MemU32 0x71300014 = 0x00000000
Monitor MemU32 0x7120000C = 0x00000000
Monitor MemU32 0x7130000C = 0x00000000
Monitor MemU32 0x71200F00 = 0x00000000
Monitor MemU32 0x71300F00 = 0x00000000
# Set clock
Monitor MemU32 0x7e00f900 = 0x0000801e
Monitor MemU32 0x7e00f000 = 0x0000ffff
Monitor MemU32 0x7e00f004 = 0x0000ffff
Monitor MemU32 0x7e00f020 = 0x01043310
Monitor MemU32 0x7e00f00C = 0xc2150601
Monitor MemU32 0x7e00f010 = 0xc2150601
Monitor MemU32 0x7e00f024 = 0x00000003
Monitor MemU32 0x7e00f014 = 0x00200102
Monitor MemU32 0x7e00f018 = 0x00000000
Monitor MemU32 0x7e00f01C = 0x14000007
# Config sdram
Monitor MemU32 0x7e00f120 = 0x00000008
Monitor MemU32 0x7e001004 = 0x00000004
Monitor MemU32 0x7e001010 = 0x0000040f
Monitor MemU32 0x7e001014 = 0x00000006
Monitor MemU32 0x7e001018 = 0x00000001
Monitor MemU32 0x7e00101c = 0x00000002
Monitor MemU32 0x7e001020 = 0x00000006
Monitor MemU32 0x7e001024 = 0x0000000a
Monitor MemU32 0x7e001028 = 0x0000000c
Monitor MemU32 0x7e00102c = 0x0000018f
Monitor MemU32 0x7e001030 = 0x0000000c
Monitor MemU32 0x7e001034 = 0x00000002
Monitor MemU32 0x7e001038 = 0x00000002
Monitor MemU32 0 x 7e00103c = 0x00000002
Monitor MemU32 0x7e001040 = 0x00000002
Monitor MemU32 0x7e001044 = 0x00000013
Monitor MemU32 0x7e001048 = 0x00000013
Monitor MemU32 0 x 7e00100c = 0x00010012
Monitor MemU32 0x7e00104C = 0x00000b45
Monitor MemU32 0x7e001200 = 0x000150f8
Monitor MemU32 0x7e001304 = 0x00000000
Monitor MemU32 0x7e001008 = 0x000c0000
Monitor memu32 0x7e001008 = 0x00000000
Monitor memu32 0x7e001008 = 0x00040000
Monitor memu32 0x7e001008 = 0x00040000
Monitor memu32 0x7e001008 = 0x000a0000
Monitor memu32 0x7e001008 = 0x00080032
Monitor memu32 0x7e001004 = 0x00000000
# Setup GDB for faster downloads
# Set remote memory-Write-packet-size 1024
Set remote memory-Write-packet-size 4096
Set remote memory-Write-packet-size fixed
Monitor speed 12000
Break start_armboot
Load
Continue

Click the debug button. After uboot download is complete, you can set breakpoints and single-step debugging like other debuggers. You can try and make progress together.
 

Reprinted:
Http://www.towoo.net/forum.php? Mod = viewthread & tid = 398 & page = 1 & extra = # pid420

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.