After successfully compiling u-boot, you can burn u-boot to NandFlash, so that u-boot will run automatically every time you start the computer. The next step is to complete its main mission---start the Linux kernel. You can use the tftp service to download the kernel and run it directly in the memory, but the most important process is to burn it to NandFlash to avoid loss after power failure.
There is a bug in the u-boot I transplanted here, that is, the command nand erase 100000 500000 always prompts 90% completed, which causes me to be unable to boot the kernel from NandFlash when writing the kernel. I will make a mark here and add it after finding a solution in the future. First use the sd card uboot that comes with ok6410 to burn the uboot and uImage I compiled.
1. Start u-boot through SD card boot method (mmc provided by Feiling Company)
2. Download our own u-boot.bin through dnw (the uboot network card driver provided by Feiling is incorrect and tftp cannot be used)
Board operation: SMDK6410 # dnw 50008000
Host operation: sudo dnw u-boot.bin
3. Burn u-boot.bin to NandFlash
SMDK6410 # nand erase 0 100000
SMDK6410 # nand write.uboot 50008000 0 100000
4. Download our own u-boot.bin through dnw
Board operation: SMDK6410 # dnw 50008000
Host operation: sudo dnw uImage
5. Burn the kernel into NandFlash
SMDK6410 # nand erase 100000 500000
SMDK6410 # nand write.e 50008000 100000 500000
6. After changing the board to boot from NandFlash, the following problems were found
U-Boot 2010.03 (Jan 22 2014 - 15:18:07) for SMDK6410
CPU: S3C6410@533MHz
Fclk = 533MHz, Hclk = 133MHz, Pclk = 66MHz (ASYNC Mode)
Board: SMDK6410
DRAM: 256 MB
Flash: 0 kB
NAND: 2048 MiB
*** Warning - bad CRC, using default environment
In: serial
Out: serial
Err: serial
Net: dm9000
Hit any key to stop autoboot: 0
NAND read: device 0 offset 0x100000, size 0x500000
5242880 bytes read: OK
## Booting kernel from Legacy Image at 50008000 ...
Image Name: Linux-3.12.7
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1575408 Bytes = 1.5 MB
Load Address: 50008000
Entry Point: 50008000
Verifying Checksum ... OK
XIP Kernel Image ... OK
OK
Starting kernel ...
undefined instruction
pc : [<5000800c>] lr : [<57e249a0>]
sp: 57cffdf4 ip: 00000002 fp: 50000100
r10: 0000065a r9: 57d04a24 r8: 57cfffe0
r7: 50008000 r6: 57e37c3c r5: 00000000 r4: 57cfffc4
r3 : 00000000 r2 : 50000100 r1 : 0000065a r0 : 50000144
Flags: nzCv IRQs off FIQs off Mode SVC_32
Resetting CPU ...
resetting ...
The problem is that an undefined exception occurs, undefined instruction, resulting in infinite restart.
So I started to shoot wrongly, because the kernel can be downloaded and run through tftp in the previous article, so the kernel should be fine. Later I found that I was missing a part. Since uboot only supports uImage, I first made the kernel image generated by uImage directly under Linux, but it can't be recognized by uboot. Here you need to use mkimage under uboot/tools to make uImage.
wu@wu-VirtualBox:/opt/u-boot-2010.03-3/tools$ mkimage -A arm -O linux -T kernel -C none -a 50008000 -e 50008040 -n "linux-3.12.7" -d / opt/linux-3.12.7-2/arch/arm/boot/zImage uImage
The generated uImage is under /opt/u-boot-2010.03-3/tools.
After searching for information from many sources, I found that the problem occurred at the interface between uboot and kernel:
Look carefully at the information printed above Load Address: 50008000 Entry Point: 50008000, and the command we just used is -a 50008000 -e 50008040, Load Address is the kernel load address, Entry Point is the kernel entry address, 50008040 needs to be added with x40 (converted to 64 bytes) because: uImage is a dedicated image file for uboot, it adds a 64-byte "header" before zImage, indicating the kernel version, loading location, generation time, size and other information;
For details, please refer to this article: http://kmoving.blog.163.com/blog/static/20504919720123151533819/
Repeat steps 1-5 to successfully start
U-Boot 2010.03 (Jan 22 2014 - 15:18:07) for SMDK6410
CPU: S3C6410@533MHz
Fclk = 533MHz, Hclk = 133MHz, Pclk = 66MHz (ASYNC Mode)
Board: SMDK6410
DRAM: 256 MB
Flash: 0 kB
NAND: 2048 MiB
*** Warning - bad CRC, using default environment
In: serial
Out: serial
Err: serial
Net: dm9000
Hit any key to stop autoboot: 0
NAND read: device 0 offset 0x100000, size 0x500000
5242880 bytes read: OK
## Booting kernel from Legacy Image at 50008000 ...
Image Name: linux-3.12.7
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1575408 Bytes = 1.5 MB
Load Address: 50008000
Entry Point: 50008040
Verifying Checksum ... OK
XIP Kernel Image ... OK
OK
Starting kernel ...
Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0x0
Linux version 3.12.7 (wu@wu-VirtualBox) (gcc version 4.4.3 (ctng-1.6.1) ) #1 Tue Jan 21 17:10:55 CST 2014
CPU: ARMv6-compatible processor [410fb766] revision 6 (ARMv7), cr=00c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
Machine: OK6410
Memory policy: ECC disabled, Data cache writeback
CPU S3C6410 (id 0x36410101)
........Omitted.......
Previous article:Porting u-boot-2010.03 --- Use tftp to download and run the kernel
Next article:Porting the kernel to the OK6410 development board under Ubuntu
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Summary of performance indicators of integrated operational amplifiers
- 【Top Micro Intelligent Display Module】Three: Interface editing tool SGTools
- C2000 LaunchPad - SIC Interrupt Reception
- [Automatic clock-in and walking timing system based on face recognition] BLE automatic time calibration and scanning wearable watch/scan
- EEWORLD University ---- Cisco CCNA+CCNP Learning Tutorial
- What are the differences between level conversion chips and digital ADU isolation chips? Aren't they both designed to match their own voltage...
- IIC communication of msp430g2553
- How to get the free page block of STM32' MCU internal flash
- Using MicroPython to run app-like functions on a single chip
- What software do you usually use when doing circuit simulation?