This article records how the mini2440 development board uses uboot to start the kernel through the nfs service.
background:
I have to use this board again today after putting it aside for a long time. I changed the machine before. Although kernel and rootfs are mounted via nfs, I can't get into u-boot... I got u-boot working, but nfs doesn't work again.
environment:
1.OS:ubuntu11.10;
2. Serial port tool: C-kermit
Involving:
1.Configuration of exports in nfs;
2. Setting of env in u-boot;
3. Problems encountered...
1. Configuration file in nfs: /etc/exports
$sudo vim /etc/exports
1. Add the nfs directory to be mounted on the development board:
/your/nfsroot/path 192.168.2.0/24(rw, sync, no_root_squash)
Mine is: /home/wang2/codePrj/ldd/rootfs/qtopia4 192.168.2.0/24 (rw, sync, no_root_squash)
2. Add the kernel file directory required by the development board:
/your/kernel/uImage/path 192.168.2.0/24(rw, sync,no_root_squash)
Mine is: /home/wang2/codePrj/ldd/imgs 192.168.2.0/24 (rw, sync, no_root_squash)
3.$sudo nfs-kernel-server restart
2. About uImage in the first step:
Because u-boot needs to read the first 64 bytes of img information when booting kernel img, you must also create uImage (uboot Image) if you want to use u-boot to boot the kernel
1. Use make menuconfig to get zImage;
2. Use mkimage in u-boot tools to process zImage:
mkimage -A arm -O linux -T kernel -C none -a 0x30008000 -e 0x30008000 -n kernel-2.6.32.2 -d zImage uImage
3. Parameter description:
-A arm -------- Architecture architecture is arm
-O linux -------- OS The operating system is Linux
-T kernel -------- Type The image type is kernel
-C none -------- Compressed The compression type is no compression
-a 30008000 ---- image loading address (hex)
-e 30008000 ---- entry kernel entry address (hex)
-n kernel-2.6.32.2 --- name image name
-d zImage ---- the original image file name uImage ---- the image file used by u-boot
3. Mount via nfs:
1. Tips:
Loading: *_*** ERROR: Cannot mount
reason:
a. After modifying /etc/exports, the nfs service was not restarted;
b. The firewall is not closed:
$sudo ufw status If it is active, you can pass
$sudo ufw disable Disable Ubuntu Fire Wall firewall
2. Tips:
NAND read: device 0 offset 524288, size 2097152 ...
2097152 bytes read: OK
## Booting image at 30008000 ...
Image Name: kernel-2.6.32.2
Created: 2010-04-25 9:59:17 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1966552 Bytes = 1.9 MB
Load Address: 30008000
Entry Point: 30008000
Verifying Checksum ... OK
XIP Kernel Image...OK
Starting kernel ...
data abort
pc : [<30008010>] lr : [<33f94754>]
sp : 33f4faa0 ip : 30008000 fp : 00000002
r10: 00000000 r9: 33e7fe2c r8: 33f4ffdc
r7: 33f9e278 r6: 33f9e278 r5: 30008000 r4: 00000000
r3 : 30008000 r2 : 30000100 r1 : 000000c1 r0 : 33f4fce8
Flags: nZCv IRQs off FIQs off Mode SVC_32
Resetting CPU ...
reason:
a. The kernel type is incorrect and the mach-type is inconsistent;
b. The entry address in uImage is incorrect, because mkimage will add 64 bytes (0x40) of additional information after processing, so change the -e option above to
0x30008040
3. Tips:
Load address: 0x30008000
Loading: T T T T T T T .....
reason:
The error at this moment was caused by the network cable being too long!!! I used a 3 to 5 meter network cable and it was only TTT; when I changed it to a 1 meter cable, it was ########! It was so weird
4. extra:
Before, I directly generated uImag according to the above command, and it could run after downloading it to the development board; but this time it always goes to download->cpu resetting->download->cpu resetting...; (the only difference between before and after is the use of the mkimage tool!) It was fixed through b.
4. Configuration of u-boot environment variables:
1. Print the current env:
#printenv
2. Set env:
#setenv env_name env_value
#setenv bootargs 'noinitrd root=/dev/nfs rw nfsroot=192.168.2.3:/home/wang2/codePrj/ldd/rootfs/qtopia4 ip=192.168.2.4:192.168.2.3:255.255.255.0 console=ttySAC0,115200 mem=64M'
My env:
[zhong@mini2440]# printenv
bootdelay=1
baudrate=115200
ethaddr=08:08:11:18:12:27
zhong=bmp d 70000
stdin=serial
stdout=serial
stderr=serial
ethact=dm9000
filesize=266854
fileaddr=30008000
gatewayip=192.168.2.1
netmask=255.255.255.0
ipaddr=192.168.2.4
serverip=192.168.2.3
bootcmd=nfs 0x30008000 192.168.2.3:/home/wang2/codePrj/ldd/imgs/uImage;bootm
0x30008000
bootargs=noinitrd root=/dev/nfs rw nfsroot=192.168.2.3:/home/wang2/codePrj/ldd/rootfs/qtopia4 ip=192.168.2.4:192.168.2.3:255.255.255.0 console=ttySAC0,115200 mem=64M
5. NFS can be started
Try to bring eth0 interface up......NFS root ...Done
Please press Enter to activate this console.
Previous article:mini2440 u-boot linux kernel boot,Mini2440 uboot,kernel,root file system construction
Next article:Porting rtems-4.11 to MINI2440 (Part 2)
Recommended ReadingLatest update time:2024-11-16 12:56
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Thank you for your strong faith
- Overview of MCU bus, three-bus structure of MCU
- Comparison summary of MSP430 FR2xx series MCU BSL and MSP432 P series MCU BSL
- Most Popular Blogs of 2021: Connect, Power, and Protect
- Recruiting circuit engineers with high salary (Nantong Intelligent Perception Research Institute, Shanghai Institute of Technical Physics, Chinese Academy of Sciences)
- Does anyone have the schematic diagram of jmb366?
- RK3399 open source motherboard hardware and software information released - free download
- [ESP32-Audio-Kit Audio Development Board Review] Part 1: Building esp-idf and esp-adf development environments based on vs code
- [Raspberry Pi Pico Review] Pico power supply part
- Live broadcast has ended | Microchip's latest SAM and PIC32 microcontroller software development platform - MPLAB Harmony V3