Use eclipse and jLink V8 to debug exynos 4412 u-boot and jlinkexynos

Source: Internet
Author: User
Tags building windows jlink

Use eclipse and jLink V8 to debug exynos 4412 u-boot and jlinkexynos
/*************************************** **************************************** ** @ Author Maoxiao Hu * @ version V1.0.0 * @ date Dec-2014 ************************** **************************************** * *********** <COPYRIGHT 2014 ISE of shandong university> ******************* **************************************** * ********************/First, let's talk about the network environment of my lab: A public Linux Server equipped with ubuntu, and several clients connect to the server using ssh. My personal development environment: use Mac OS X and ssh to remotely connect to the Linux server. USB series to connect to the 4412 Development Board. USB is connected to the Development Board through jLink, and no other cables are connected at the moment.
Here I will take the Mac system as an example to describe how to build the software and hardware environment. The methods for building windows and Linux are basically the same.
First, prepare the software package: 1. eclipse CDT: Release. 2. eclipse CDT zylincdt plug-in to open eclipse CDT, select help-> Install New Software in the pop-up dialog box, and click Add.

Enter the name: zylincdt

URL fill: http://opensource.zylin.com/zylincdt

Select the software package and continue to the next step until the installation is complete. Depending on the network environment, this step takes about 5-10 minutes. 3. jLink DRIVER: https://www.segger.com/jlink-software.htmlmy jlinkis jLink V8. Please be sure that your jLink can be online to upgrade the firmware. If the firmware is too low, you may not be able to debug the Cortex-A9 kernel. Download the Driver Based on your platform. The installation process is not described in detail. After the installation is complete, there will be the following programs, as if there are more tools on windows than on Mac. 4. gdb: Running. Other cases: Install eclipse on windows, Mac, you need to open the https://launchpad.net/gcc-arm-embedded/+download to download cross gdb. After the download is complete, decompress the package to any location. ----------------------- The preparation stage is completed --------------------- The following describes how to debug u-boot through gdb in eclipse. 1. Pull the u-boot source code from the server. Assume that you have completed uboot compilation on the server and generated the elf File. Here I use the FTP tool to pull the source code directory from the server to any local location. 2. Create a project in eclipse and the source code tree will appear in the left navigation bar. 3. Set the debugging parameters, right-click the project folder, and find the debugging parameter settings: new local Zylin debugging: Find the elf file: set the initialization command, which may need to be further discussed here. Here we will first use this section, and then I will test other commands.

# Connect to the J-Link gdb server
Target remote localhost: 2331
# Reset the target
Monitor reset
Monitor sleep 10
# 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
Load
Break _ start

You also need to set the source code directory. Otherwise, the system will prompt that the source code file cannot be found during debugging:

4. Start gdb-server

Note: before each debugging, make sure that 4412 of the CPU is in the halt state.

Method: After the board is started, press any key before the uboot second ends to enable 4412 to enter the uboot interface, instead of starting the kernel. After the kernel is started, jlink may fail to suspend 4412.

When JLinkExe is enabled, the CPU is successfully identified. This step is crucial. If the CPU cannot be identified, it may be because the jlink firmware version is too low or the hardware connection is faulty.

We use the halt command to stop the CPU:

Exit JLinkExe.

Open JLinkGDBServer. If the connection succeeds, it will be displayed waiting for the gdb connection:

5. Return to eclipse for debugging.

Click bugs to start debugging.

The register value is read successfully. You can perform one-step debugging, enjoy.

 

Problems to be Solved tomorrow:

1. I have not carefully studied the gdb initialization command here, but now it can be run and further modification is required.

2. There seems to be a problem with the code running address. gdb-server Always prompts that some locations cannot be read. Check the source code, relocate the code, and try again.

3. The CPU may need to be downgraded during the debugging phase. Otherwise, jlink may be unable to stop the CPU (experience judgment ).

4. The biggest concern is whether jlink v8 can support A9 debugging. However, no problems have been found yet.

 

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.