The tenth phase of router debugging HelloWorld "Router is the Development Board"

Source: Internet
Author: User
Tags bz2
The previous installments are doing the preparatory work, and this issue begins with the actual operation. Many of the beginning of the tutorial like to use HelloWorld to do a demonstration, I am no exception, in the Hardware Development Board tutorial running water is a HelloWorld, the program is simple, as long as the control gpio can be achieved, and intuitive obvious. Now start the HG255D implementation of the running water lamp function, the effect is as follows:



If you're interested, let's start with a hands-on operation, which is the first step in controlling the development Board. First the compilation environment is under the LINUX_32 bit, need to build a Linux development environment, here in Ubuntu14.04 for example, $ sudo apt-get update $ sudo apt-get install git g++ make libncurs Es5-dev Subversion Libssl-dev gawk libxml-parser-perl unzip wget python xz-utils vim compiler tool chain we use the Ralink SDK provided, if you want to compile yourself can also, There are many tutorials available on the Web, the buildroot-gcc342.tar.bz2 file under the Tools folder in the SDK directory is the build tool chain, and the operation under Linux is:         1. Go to sdk/tools directory CD xxxx/rfdemo/tools         2. Unzip the buildroot-gcc342.tar.bz2 file into the/opt directory tar-jvxf buildroot-gcc342.tar.bz2-c/opt         3. Optionally, add the/opt/buildroot-gcc342/bin/directory to the PATH variable: Vim ~/.profile at the end add         # MIPS Toolchain Mipsel-li Nux-xxx         path= $PATH:/opt/buildroot-gcc342/bin The version information of the toolchain can be seen when the mipsel-linux-gcc-v is restarted. After the compilation tool is ready, we start to generate the running light program we want, here because we want to make minimal changes to achieve the smallest function, I do not create the project alone, but directly on the Uboot modified, the use of uboot patch to demonstrate our running light program. Here again, after the demo example I have been patched form, the benefits of this is two points: 1. For complex projects you can clearly see where the changes were made; The 2.patch file is reversible and can be restored after the experiment is complete. Enter the Code/uboot directory of the SDKThen execute the PATCH-P1 <. /patch/led_run.patch as shown in the figure:


Then execute make menuconfig the compile configuration program, changing all options to the status of the following image:



Then exit Select Yes to save and exit.
Then execute make to generate the Uboot.bin executable file


After compiling, if the U-boot file is generated in the current directory, the compilation is successful, then you can proceed to the next step, if it is unsuccessful, look for the reason carefully. Put the Uboot.bin file in the Openocd Bin directory, run the OPENOCD service, if not clear please look at the previous installments, and then use the Telnet tool to access the OPENOCD service telnet 127.0.0.1 4444, After Telnet succeeds, two commands are executed: The halt and Run_uboot results are as follows:

>open on-chip Debugger
> Halt
target state:halted
target halted in MIPS32 mode due to debug-request, PC : 0x9f000380
> Ralink_init
> Run_uboot
125248 bytes written at address 0x00200000
downloaded 125248 bytes in 3.163181s (38.668 kib/s)
>

If the following information is displayed, you will be pleasantly surprised to find that our development board is already moving, and the running light program runs like this. The specific principle of our future analysis, a small demo demo to add a little interest. If the following information is displayed, you will be pleasantly surprised to find that our development board is already moving, and the running light program runs like this. The specific principle of our future analysis, a small demo demo to add a little interest. It is important to note that if the value of the PC is pc:0x00000000 after executing the halt command, then the u-boot of your Development Board will function properly and initialize the JTAG interface to a GPIO port, which requires the Flash 53 and 54 pins to be shortened and then booted. After normal identification and then disconnect, specific reference: http://www.openwrt.org.cn/bbs/forum.php?mod=viewthread&tid=9314 http://www.right.com.cn/ Forum/thread-105069-1-1.html

Of course, after the experiment to clean up the scene, because the code directory of the program will be used later, so we have to restore the previous changes back, perform the following two steps to Ok:1. Make Distclean 2. Patch-r-p1 <. /patch/led_run.patch


To here, "router is the development Board," the preparation of the work is finished, the next issue I will start from the source code analysis, first said U-boot and then speak OpenWrt.


---------------------------------------------------------------------------SDK Download Address: Https://github.com/aggresss/RFDemo

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.