Kernel burning method of HK-2000 System

Source: Internet
Author: User
HK-2000 using at91rm9200 chip, the kernel burning instructions are as follows:
Prerequisites:
1. You must have kernel-related files for the HK-2000 multi-function data collector. If you do not contact Beijing Environmental Control Technology Co., Ltd. after-sales service department, according to The HK-2000 data collection instrument on the product serial number to request. The kernel package includes the ubootsystem file (boot.bin, loader.bin, u-boot.bin, u-boot.gz), Linux kernel (uimage), file system (jffs2.img), and FTP server software (tftpsrv. EXE ).
2. Connect the system serial port to the PC serial port, connect the system network cable, jump the Jumper J100 to 2-3, and then power on.
The serial port continuously sends C to the Super Terminal.

1) through the Super Terminal XMODEM protocol to transfer loader. Bin and then transfer the u-boot.bin, then uboot will run in SDRAM.
Then:
Uboot> protect off all
Uboot> erase all

Uboot> loadb 20000000; send boot. bin to the SDRAM
Transmit boot. Bin through Kermit Protocol
Uboot> CP. B 20000000 10000000 5fff; copy the boot. bin in the SDRAM to flash.
Uboot> protect on 10000000 10005fff; write Protection

uboot> loadb 20000000 transfer u-boot.gz to the SDRAM
transfer u-boot.gz through the kermitprotocol
uboot> CP. B 20000000 10010000 FFFF ← copy u-boot.gz from sdramto flash
uboot> protect on 10000000 1001 FFFF; write Protection
then power off, jump J100 to 1-2, restart and enter uboot

Note: When you reinstall the system, you do not have to erase all the modified parts, and erase the corresponding parts according to the following address.
If you only erase the uboot command erase 10000000 1001 FFFF
If only uimage erase 10020000 100 fffff is erased
If only jffs2.img erase 10100000 103 fffff is erased
If you want to erase uimage and jffs2.img erase 10020000 103 fffff

Method 1: Start Linux in Flash
2) reset the system and set the U-boot startup parameters as follows:
Uboot> setenv bootargs root =/dev/mtdblock/3 console = ttys0, 115200 mem = 32 m
Uboot> setenv image CP. B 10020000 21000000 e0000
Uboot> setenv ramdisk run
Uboot> setenv boot bootm 21000000
Uboot> setenv bootcmd run image \; run boot
Uboot> setenv ethaddr 00: 12: 34: 56: 78: 9A; the "can't overwrite ethaddr" prompt may appear.
Uboot> setenv ipaddr 192.168.0.102; IP address of the target board
Uboot> setenv serverip 192.168.0.6; PC windows IP
Uboot> setenv bootdelay 1
Uboot> saveenv

3) Now we can download the kernel to SDRAM through TFTP, copy it to flash, open tftpsrv. EXE in the folder where uimage jffs2.img is located, and then minimize it.
Uboot> TFTP 21000000 uimage
Uboot> CP. B 21000000 10020000 e0000
This may take some time (about 5 minutes). Please be patient and do not have power outages.

Uboot> TFTP 21100000 jffs2.img
Uboot> CP. B 21100000 10100000 260000; 0x260000 = 2432kb based on the size of jffs2.img; 0x2c0000 = 2806kb
This may take some time (about 10 minutes). Please be patient and do not have power outages.

After the copy is complete, reset the system and you will see that the Linux system with the jffs2 file system as the root file system starts to run, so that various configuration files in the root file system will
Power-off is saved

Method 2: Start Linux through the network (Open tftpsrv. EXE in the folder where uimage ramdisk.gz is located and then minimize it)
Reset the system and set the U-boot startup parameters as follows. You can download and start the system over the network:
Uboot> setenv bootargs root =/dev/Ram RW initrd = 0x21100000,6000000 ramdisk_size = 15360 console = ttys0, 115200 mem = 32 m
Uboot> setenv image TFTP 21000000 uimage
Uboot> setenv ramdisk TFTP 21100000 ramdisk.gz
Uboot> setenv boot bootm 21000000
Uboot> setenv bootcmd run image \; run ramdisk \; run boot
Uboot> setenv ethaddr 00: 12: 34: 56: 78: 9A
Uboot> setenv ipaddr 192.168.0.168
Uboot> setenv serverip 192.168.0.161
Uboot> saveenv

Restart to go to Linux

Note:
1. During kernel compilation, the 4 m norflash has been divided into three MTD partitions. The following are the partition numbers and sizes:
/Dev/MTD/1 "bootloader" 0x20000
/Dev/MTD/2 "uimage" 0xe0000
/Dev/MTD/3 "jffs2root" 0x100000
2. During kernel compilation, 64 m nanfflash is divided into one MTD partition, and one MTD partition is mounted to different directories through the yaffs system. The following is the partition number, size, and mount directory.
/Dev/MTD/4 64 m/mnt/Nand
3. After the system is started,/tmp and/var under the root file directory are mounted on the system SDRAM, therefore, various temporary files that do not need to be stored after power loss are formed during the development process.
Store them in these two directories.
4. USB flash drive usage instructions: First insert the USB flash drive to the USB host interface of the system, then enter the/test directory, and run the command
$./Udisk
Then you can mount the USB flash drive.
$ Mkdir/mnt/USB
$ Mknod/dev/sda1 B 8 1 if not, change it to mknod/dev/sda1 B 8 0
$ Mount-T vfat/dev/sda1/mnt/USB
In the above formula,/mnt/USB is the Mount directory of the new U disk. You can operate the U disk by entering the/mnt/USB directory.
5. After the system starts for the first time, the network adapter automatically configures a random MAC address and saves it to the/usr/etc/mac.txt file. After the system starts, it will directly read the first MAC address from the file.
Configure the MAC address. The IP address of the network is configured as 192.168.0.1. After the network is started, you can use the ifconfig command according to the network environment.
The command automatically takes effect after the system starts. You can put the configuration command in the/usr/etc/rc. Local file.

6. How to erase the NAND partition:
First, uninstall the NAND partition, such as NAND:
$ Umount/mnt/Nand


Then erase and re-mount:
$ Eraseall/dev/MTD/4

$ Mount-T yaffs/dev/mtdblock/4/mnt/Nand

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.