Log on to the beso_wifi Development Board under the Virtual Machine and install the gdb debugging tool for the graphic interface.

Source: Internet
Author: User

Log on to the beso_wifi Development Board under the Virtual Machine and install the gdb debugging tool for the graphic interface.

Due to development and laziness (I don't want to install linux directly), I spent some time studying how to log on to the control DEVELOPMENT BOARD UNDER VMware Linux. The specific process is as follows:

I. Required Software and Hardware:

1. beso_wifi Development Board (chip ADSP-BF561, uClinux)
3. VMware Workstation 6.5
3. Fedora-11-i386-DVD.iso

Ii. Installation of VMware-tools and software in fedora11:
1. vmware-tools is a plug-in that has to be installed after VMware is installed. This plug-in is very powerful. After installation, you can directly access the directories in windows and drag and drop files with windows to each other's systems. However, if the kernel version of fedora11 is 2.6.29, an error will be reported when you install and compile it directly with VMware Workstation 6.5. Therefore, you have installed vmware-tools with patches on the Internet. The specific address is issue 9.10. Decompress, install, and everything goes smoothly.

2. Install TFTP and xinetd, fedora, and RedHat. There are good software installation commands, and Yum install XXX is all done. If you can install the software on the network, try to use the network. If you install the software on your own, many errors may occur because some dependent software is not installed. When the time comes, you may find the cause of exceptions on the Internet, therefore, we strongly recommend that you use yum! After installing TFTP and xinetd, enter setup under the terminal and remove the iptable option to enable the NFS, TFTP, and xinetd options. Add the TFTP configuration under ETC/xinetd. D and add the in. tftpd-L/tftpboot/option under/root/. bashrc.

3. Configure the serial port and network. Because it is a virtual machine that connects to the Development Board, we need to solve two problems. One is the serial port and the other is the network port. Serial port installation is relatively simple. If the host has a serial port, add the corresponding serial port device under VMware. Start fedora11, run minicom-s to change the device to/dev/ttys0, select the baud rate, remove traffic control, and save. Uboot printing information is displayed on the power-on terminal of the board. Everything is OK! If the host is a USB-port laptop, a USB-to-serial connection line is required. First, install the driver under windows, and then add a serial port under VMware, the sub-host displays com5. After starting fedora, configure minicom as in the previous step. Remember! You do not need to change ttys0 to ttyusb. Next, configure the NIC. Note that the network adapter of the virtual machine uses bridged (bridging) as the real physical machine. Naturally, select the NIC under edit-> Virtual Network Editor-> host virtual network mapping. (This step is often forgotten ). Restart fedora, change the eth0 IP address to 192.168.6.4 under the terminal, power on the board, and run the TFTP Command on minicom to copy the kernel and start it. Everything is OK.

Iii. GDB debugging
The purpose of installing VMware Is to make development and debugging as convenient as possible. In addition, the implementation of GDB is essential for kernel and app debugging. According to the official website http://docs.blackfin.uclinux.org/doku.php? Id = Linux-kernel: kgdb_2008r1.5 the above introduction, I completed the kgdb build on the virtual machine. The procedure is as follows:

1. First Update a file named kgdb_patch/kgdb_bfin_linux-2.6.x.patch under the patch folder of 08r1. Some bugs of the original patch have been fixed. : Http://blackfin.uclinux.org/gf/project/uclinux-dist/scmsvn? Action = browse & Path = % 2 fbranches % 2f2008r1% 2fbfin_patch % 2fkgdb_patch % 2f

2. After the update is complete, according to the instructions above, in the linux-2.6.x directory input command
Patch-P1 <../bfin_patch/kgdb_patch/kgdb_bfin_linux-2.6.x.patch
The patch is used to add files to the corresponding directory and modify makefike and kconfig so that corresponding options are available during Kernel configuration.

3. Run make linux_menuconfig to configure the kernel and enable the kgdb option.
Kernel hacking --->
[*] Kernel debugging
[*] Kgbd: kernel debugging with remote GDB
[*] Kgdb: over Ethernet

In addition, you must configure Cmd Line.
Blackfin Processor options --->
Board mizmizations --->
[*] Default bootloader kernel arguments
(Console = ttybf0, 115200 kgdboe = @ 192.168.6.213/, @ 192.168.6.4/) Initial kernel command string

Run make config_menuconfig and select gdbserver (old) in miscellaneous applications ). Note: There are two gdbservers in it. You need to select the ones marked with "old.

The preceding steps have completed Kernel configuration, enabling kgdb debugging, and debugging through UDP over Ethernet. The default target board port is 6443 and host port is 6442.

4. after the kernel is compiled, enter the linux-2.6.x directory, input bfin-uClinux-GDB vmlinux to enable GDB debugging, the Board starts the kernel after power-on, on the host machine input GDB Command target remote UDP: 192.168.6.213: 6443, as you can see, waiting and connet related words appear on the target board, indicating that the gdb connection is successful. Then, based on some examples of GDB debugging provided on the official website, we tested it as follows:
Host:
(GDB) Break sys_open
# Use the gdb continue command
(GDB) c

On the target system use the "ls" command to trigger a breakpoint at sys_open
/> Ls

The breakpoint hits and GDB displays a message
"Breakpoint 1: sys_open (..."
# Use the gdb single stepping command
(GDB) Si
# Use the gdb remove breakpoint command
(GDB) del 1
# Set hardware breakpoint
(GDB) hbreak sys_open
# Continue
(GDB) C <code>
-Run "ls" in the target console <code>
/> Ls <code>
-The GDB session is terminated using the detach command <code>
# Interrupt the target from the gdb host
(GDB) type ctrl + c
# Detach the gdb host from the target
(GDB) detach
# Exit GDB
(GDB) quit

4. install DDD to implement the DDD debugging on the graphic interface. When installing DDD, it is still the same. Use yum directly. Remember not to download the DDD compressed package separately for installation. This will cause an error, to install DDD, you must install seven dependent software or lib at the same time. Enter
DDD -- debugger bfin-uClinux-GDB vmlinux: The GDB debugging function of the beautiful graphic interface is implemented. The example provided on the official website is very smooth. In addition, the latest version of the graphic interface GDB debugging can be based on Eclipse. The software is more powerful. The information 8.12 on the official website has just been updated. If you have time, try again, after setting up the environment, we will start learning about GDB ^. ^

 

Reprinted please indicate the source

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.