Basic operations on freerunner mobile phones

Source: Internet
Author: User
Tags nameserver
Document directory
  • 1.1. VMWare + Ubuntu for the host
  • 1.2 windows
  • 2.1. SCP
  • 2.2. TFTP
  • 5.1 Introduction
  • 5.2 Startup Mode
  • 5.3 upgrade the program with DFU-util

 

Basic operations on freerunner mobile phones

This document records some basic operations on freerunner mobile phones. In this article, freerunner mobile phones are referred to as Fr.

1. log on to 1.1 via SSH and use VMware + Ubuntu as the host

Select the VMware window as the current window and connect the PC and freerunner mobile phones with a USB cable. If the USB icon is displayed in the status bar of the VMware window, the device has been detected.

I use virtual machines that sometimes plug in USB cables, but VMWare does not respond. In this case, check whether the startup of VMware/Ubuntu is normal. If the boot is normal, you can first insert a easily recognized USB flash drive or mobile hard drive on the USB. After recognition, umount will be dropped and the same USB port will be used to connect to Fr. Generally, the connection is successful.

After connecting to Fr, you can view the USB 0 connection by typing ifconfig. Configure the IP address of the connection:

sudo ifconfig usb0 192.168.0.200

The default IP address of FR is 192.168.0.202. Ping Fr. Log On with SSH:

ssh root@192.168.0.202

Fr has no password by default. Press enter when prompted to enter the password. Then you log on to Fr. If the following prompt appears during SSH:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

As long:

rm ~/.ssh/known_hosts

Use SSH to log on.

1.2 windows

After the driver is installed, a "neo1973 USB Ethernet/rndis" is added to the network adapter category of the Device Manager ". A local connection is added to the network connection. After you set the IP address of the local connection to 192.168.0.200, you can log on to Fr using the SSH tool you are used to (such as putty.

2. file transmission

You can use SCP or TFTP to transfer files between the host and Fr.

2.1. SCP

Copy files to Fr using scp on the host:

$ scp scim_1.4.7-r0_armv4t.ipk root@192.168.0.202:root@192.168.0.202's password:scim_1.4.7-r0_armv4t.ipk                      100% 1007KB 251.7KB/s   00:04

Copy files to the host using SCP on fr:

# scp 1.png lvjie@192.168.0.200:lvjie@192.168.0.200's password:1.png                                         100%   68KB  67.9KB/s   00:00

The following example uses SCP to copy files on fr to the shared directory between the virtual machine and windows.

$ scp root@192.168.0.202:3.png /mnt/hgfs/share/root@192.168.0.202's password:3.png                                         100%  205KB 204.6KB/s   00:00
2.2. TFTP

If the TFTP server is installed on the host, you can use the TFTP tool put or get files on the host on the Fr.

2.2.1 install the TFTP Server

You can install the TFTP server as follows:

sudo apt-get install tftpd-hpa tftp-hpa

Edit/etc/default/tftpd-HPA:

$ cat /etc/default/tftpd-hpa#Defaults for tftpd-hpaRUN_DAEMON="yes"OPTIONS="-l -c -s /tftpboot"

"-L" indicates independent startup, not dependent on inetd. "-C" allows file creation. "-S/tftpboot" sets/tftpboot as the root directory at startup. Create/tftpboot and chmod to 777. After restarting, you can use the TFTP service.

2.2.2. use TFTP on fr

The TFTP on FR is usually a simplified version in busybox. Its usage is as follows:

Usage: tftp [OPTION]... HOST [PORT]Transfers a file from/to a tftp server using "octet" mode.Options:        -l FILE Local FILE.        -r FILE Remote FILE.        -g Get file.        -p Put file.

Example:

# tftp -p -r 2.raw 192.168.0.200# tftp -g -r scim-pinyin_0.5.91-r0_armv4t.ipk 192.168.0.200

"-P" is a put file. "-G" is a get file.

3. Screen

The simplest method is to use fbgrab. After the installation package is transmitted to Fr, use opkg or ipkg for installation. For example:

opkg install fbgrab_1.0-r1_armv4t.ipk

After fbgrab is installed, it is easy:

# fbgrab 1.png

You can also directly copy data in framebuffer without fbgrab, for example:

# cat /dev/fb0 > 2.raw

After the original data file is transmitted to the host, fb2png can be used to convert it to PNG. For example:

# fb2png 2.raw 2.png 0 480 640 16

Fb2png is used as follows:

fb2png 0.1 (2001-09-19)fb2png [dev] [filename] [sec] (x) (y) (depth)Usage: fb2png /dev/fb0 filename.png 5 800 600 24

The parameter [SEC] is the delay time, that is, the image after the SEC second is captured.

4. access the Internet through USB cable

In the test, FR can be connected to the Internet through the host. Run the following command on the host:

sudo iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24sudo sysctl -w net.ipv4.ip_forward=1

The iptables command adds a rule to the NAT table. "-S 192.168.0.0/24" specifies the source packet address. "24" indicates the mask 255.255.0. The sysctl command sets the Kernel Parameter net. ipv4.ip _ forward, which allows the host to forward IP packets.

Log on to Fr Using SSH and run the following command:

# echo nameserver 208.67.222.222 > /etc/resolv.conf# echo nameserver 208.67.220.220 >> /etc/resolv.conf

These two IP addresses are the DNS server address of opendns, and opendns is a website that provides free DNS services. Through the above settings, we can access the Internet on the FR, for example:

5. Update fr software 5.1 and introduction

The general saying of updating fr software is "Flash". I am used to saying that software upgrades. There are two methods for software upgrade: Through the JTAG interface or through USB cable.

  • The JTAG interface is used to upgrade the program to operate the memory directly through the JTAG interface of the CPU. The JTAG method requires the opening board and corresponding software.
  • The USB cable Upgrade Program requires an upgrade program in the mobile phone to communicate with the PC program. The Upgrade Program receives data and updates the program in the memory. The software upgrade function is implemented by the boot program on the mobile phone. Generally, the update program cannot update itself.

Unlike neo1973, freerunner has a nor flash. If the boot program in NAND Flash is upgraded, we can update the kernel and rootfs, but not the U-boot of NAND Flash. If we upgrade the boot program in nor flash, we can update the U-boot of kernel, rootfs, and NAND Flash.

5.2 Startup Mode

In addition to normal boot, we can also enable fr to the nor boot or NAND Boot Mode. The buttons in the upper-left corner of FR are called aux keys. Press and hold the aux key, and then press the power key to hold both keys at the same time. In a few seconds, you should enter the nor Boot Mode. Press and hold the power supply key, and then press the aux key to keep both keys pressed at the same time. In a few seconds, the system will enter the NAND Boot Mode.

I only use the NAND Boot Mode, because my fr cannot enter the nor Boot Mode. I guess the reason is that the FR's nor flash is empty and the boot program is not written. I used grep to find the boot program version in flash:

root@om-gta02:~# grep Bootloader /dev/mtdblock1Neo1973 Bootloader U-Boot 1.3.2-rc2-dirty-moko12root@om-gta02:~# grep Bootloader /dev/mtdblock0root@om-gta02:~#

You can find the boot program version in NAND Flash. The boot program cannot be found in nor flash.

5.3 upgrade the program with DFU-util

The upgraded PC program is a program named DFU-util, which includes both the Linux and Windows versions. In Windows, a driver called openmokodfu is also installed. If I fail to update VMWare, I can only use the Windows version. First install the driver. After the FR is started to the NAND Boot Mode, connect the FR and the host with a USB cable, a device category of "libUSB-Win32 devices" is added to the Device Manager, there is a device named "device firmware upgrade. Run:

D:/tools/dev>dfu-util -ldfu-util - (C) 2007 by OpenMoko Inc.This program is Free Software and has ABSOLUTELY NO WARRANTYFound Runtime: [0x1d50:0x5119] devnum=1, cfg=0, intf=2, alt=0, name="USB Device Firmware Upgrade"

This indicates that the device has been found. Note: In boot mode, if no operation is performed for a period of time (for example, the upgrade is not started), it will automatically shut down. The command to update the kernel is:

dfu-util -a kernel -R -D uImage-2.6.24+r10+gitr9706327002caebe6633c93e605882ea37172ec57-r10-om-gta02.bin

"-A" specifies the program alias to be updated. An alias can be a word or number. Common aliases are shown in the following table:

Kernel Kernel or 3
File System Rootfs or 6
Bootstrap program U-boot or 1
Boot Screen Splash or 4
Boot parameters U-boot_env or 2

"-R" indicates a reset after the operation is completed. -D file name: Specifies the file to be downloaded. Similarly, the command for updating the file system can be:

dfu-util -a rootfs -R -D poky-image-sato-om-gta02-20081127082421.rootfs.jffs2

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.