Development board programming

What is burning?

Burning is to compile the written program to form a HEX or BIN file. The process of writing this program into the MCU chip is called burning. It is the earliest MCU that can only be written once, so it is called burning, and later With the UV erasable EEPROM, there is now a FLASH ROM that can be erased at any time, but it is still used to write, so it is convenient to specifically write the program to the MCU. It is not to be confused with the upload of the serial port and the next data when the MCU is working.

Development board
Development board programming

The development board does not have a BootLoader programming (when there is nothing in the flash, or erase uboot), it is only used to program the bootloader and bare metal programs to the flash.

1.) Parallel Wiggler JTAG debug board with HJTAG software, can burn nandflash and norflash, and the port speed is slower (requires parallel port, now the laptop has basically no parallel port, this method is very limited)

2.) HJTAG USB emulator with HJTAG software, can burn nandflash and norflash, very fast, suitable for computers without parallel port

3) Jlink V8 emulator with JFlash Arm software, can only burn Norflash (can also indirectly burn Nandflash, indirect programming to Nandflash is to use sdram to achieve programming, a little bit difficult, here the company in order to save a lot of cost Using nandflash to start the kernel, the difference between norflash and nandflash is obvious. Norflash can be operated directly like memory. nandflash can only be operated through the control register. Here we must understand that the difference in hardware is also very large. Suitable for computers without a parallel port

The development board has u-boot , use uboot to write, flash needs to be able to run uboot normally, suitable for burning bootloader, kernel and rootfs

1) USB port, Uboot provided by S3C2440 integrates USB Download function, can cooperate with Samsung's DNW software, and download program conveniently (the disadvantage is that the programming speed is too slow, the advantage is that Samsung manufacturers provide u-boot source code) DNW software has windows version and linux version, of which linux version is more convenient to use and stable.

2) The network port is also a faster downloading method. The tboot download function is integrated in uboot, and can be downloaded with any tftp server software. The same can be used for windows and linux platforms, it is recommended that you use this method to download, because the speed is very fast.

3) Serial port, use the serial port Xmodem protocol to download the program. Compared with USB and network port, the speed is slow. This method is not recommended.

4) U disk, without the support of PC software, insert the U disk into the board, you can use uboot to download the files to be burned in the U disk, and realize automatic burning

5) SD/TF card, equivalent to U disk programming

Programming program
Development board programming

1, uboot programming

Download Uboot is divided into two steps, the first step is to download uboot to the system's extended RAM and run. The second step is to download the entire uboot to memory and then burn it to nandflash.

The first step is to download uboot to the extended RAM.

First use the short-circuit block selection system to start from the internal, reset or power-on, you will see the printed information LPC31xx READY FOR PLAIN IMAGE in the serial port software (115200 8 n 1). At this time, use the serial file software to send the file to send u-boot. -init.bin, then send u-boot.bin, then uboot will be started in RAM, print out the startup information, and count down. At this time, send any character to the system, stop timing, close the serial port software, connect with HyperTerminal system.

The second step is to burn uboot to nandflash

Enter the loady command in the HyperTerminal, then use the transmit/send file, select the Ymodem protocol, and send u-boot.bin. After the completion of the reception, first erase the nand erase, you can erase it all (without parameters), or use it. The parameter specifies the area, generally the first time to completely wipe, and then use nand_params to write the flash information, and finally use nand write 0x30001000 0x4000 0x100000

Where 0x30001000 is the address of uboot in memory;

0x4000 The starting address of uboot stored in flash depends on the actual partitioning situation;

0x100000 is the size of uboot, not less than the actual size;

At this point, write uboot to nandflash, you can remove the shorting jumper and start it from nandflash.

2, the kernel's programming

In the uboot start countdown, hit any key to stop, enter loady, similar to uboot programming, the main commands used are: nand erase 0x200000 (address) 0x200000 (size)

Nand write 0x30001000 0x200000 0x200000

3, the file system is programmed

The file system can be programmed by using the serial port in a similar way to the kernel. It can also be programmed by mounting the nfs using the mtd_debug tool. Since the file system is large, the first method will be slower.

Serial port programming command

Loady

Nand erase 0x600000 0x3a00000 (current partition case)

Nand write 0x30001000 0x600000 0x800000 (actual size)

Use nfs to burn the commands used

Mtd_debug erase /dev/mtd2 0 0x3a00000

Mtd_debug write /dev/mtd2 0 0x800000 ubi.img

The meaning of each item can refer to the help of mtd_debug. Direct mtd_debug can get the description. The len can use decimal numbers, but it is not possible in uboot. It is also considered to be hexadecimal without adding 0x.

4, start the option to mount the file system

In uboot, you can set the startup options through environment variables. Generally, you only need to configure whether the mounted file system is nfs or ubi, and the kernel startup option.

Mount ubifs in nanoflash:

Setenv bootargs console=ttyS0,115200n8 ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs;

Mount /rfs/rootfs on 129.1.4.199, and the ip of this machine is set to 129.1.31.33, etc.:

Setenv bootargs noinitrd root=/dev/nfs console=ttyS0,115200n8 nfsroot=129.1.4.199:/rfs/rootfs,proto=tcp,nfsvers=3,nolock ip=129.1.31.33:129.1.4.199:129.1.88.1:255.255. 0.0::eth0:off

The option to start the kernel:

Setenv bootcmd nand read 0x30001000 0x200000 0x200000\; bootm 0x30001000\;

The environment variables that have been modified by uboot require the saveenv command to save changes.

Flat Cable

Antenk offers flat cables from its own production – the location of the in-house Flat cable production is the antenk factory in shenzhen,Made in China. The FLAT CABLES are produced with latest state of the art production facilities and fulfill the Automotive standards.

Flat cable is a standard organization and is suitable for mobile electrical equipment with AC rated voltage of 450v/70v and below. Flat structure is especially suitable for frequent bending occasions, without kinking and folding neatly, such as driving. Yb, YBF and YBZ products can meet the needs of various occasions. It is suitable for the electrical connection between mobile electrical equipment in the harsh environment of power generation, metallurgy, chemical industry, port and so on.

Flat Cable

ShenZhen Antenk Electronics Co,Ltd , https://www.antenkelec.com