1. Purpose of writing
This document is used to record the process of AT91SAM9260 LINUX learning. A previously developed 9260 core board is used for development. This core board is designed based on the official AT91SAM9260-EK development board of ATMEL, so it uses the same BOOTLOADER and KERNEL as the official development board.
You can download the software support package of AT91SAM9260-EK development board from www.linux4sam.org or ftp://www.at91.com/pub/ for development. ATMEL no longer maintains this development board separately. The relevant software source code is integrated into the latest AT91 source code. Use make to select the corresponding development board.
www.linux4sam.org has the corresponding software (bootstrap, uboot, kernel) source code and related usage methods. Some of the compilation and installation methods in this document may come from the instructions on this website.
Development environment description: CentOS 6.5 (2.6.32), arm-linux-gcc 4.3.2
2. System Construction
1. Download relevant software packages
Ø sam-ba_2.12.zip (image burning tool)
This tool can be downloaded from the Internet, and registration is required to download from www.linux4sam.org.
( http://pan.baidu.com/s/1o6mHJfW )
Ø at91bootstrap-at91bootstrap-3.x.zip
https://github.com/linux4sam/at91bootstrap/tree/at91bootstrap-3.x
(http://pan.baidu.com/s/1hq1NgeK)
Ø u-boot-at91-u-boot-2013.07-at91.zip
https://github.com/linux4sam/u-boot-at91/tree/u-boot-2013.07-at91
(http://pan.baidu.com/s/1mgC4qwS)
Ølinux-at91-linux-2.6.39-at91.zip
https://github.com/linux4sam/linux-at91/tree/linux-2.6.39-at91
(http://pan.baidu.com/s/1mgC4qwS)
2. Bootstrap compilation
Compile the nand flash image according to the instructions in README.txt in the bootstrap source code directory
1) # make mrproper
2) # make at91sam9260eknf_uboot_defconfig
If a "Permission denied" error message is displayed, this error is usually caused by the executable file not having execution permission. You can grant execution permission to the relevant executable file, or grant execution permission to all files in the folder.
# chmod +x * -R
3) Add 64MB NAND support, gedit ./driver/nandflash.c
4) # make menuconfig
It prompts that ncurses cannot be installed. Use yum to install related tools.
# yum install ncurses-devel
Modify the following configurations:
a) Memory selection ---> NAND flash configuration --->
b) U-Boot Image Storage Setup --->
5) #make CROSS_COMPILE=arm-linux-
In http://www.at91.com/linux4sam/bin/view/Linux4SAM/AT91Bootstrap there are the following instructions:
# make CROSS_COMPILE=arm-none-linux-gnueabi-
Compilation is successful! The generated files are in the binaries directory.
Although it can be compiled successfully, it cannot run after being downloaded to the target board, and there is no serial port output information. I have been trying for a long time without success. Maybe the high version of Bootstrap does not support 9260 well. In order not to affect the overall progress, I will skip this step and use Bootstrap V1.9 for transplantation. For details, please refer to "Bootstrap_V1.9 transplantation.doc".
3. U-BOOT compilation
a) Generate the configuration file using the command make at91sam9260ek_nandflash_config according to the ./doc/README.at91 document in the UBOOT directory.
b) Modify the configuration file gedit ./include/configs/at91sam9260ek.h
i. Modify U-BOOT parameter address
ii. Remove unnecessary instructions and keep only NAND instructions
iii. Modify the startup command
"nand read.jffs2 0x22000000 0xA0000 0x200000; bootm"
After completion, use make to start compiling. Burn the generated u-boot.bin to the 0x00020000 position of NAND, and burn the previously generated bootstrap. For the LINUX image, temporarily use the one made before and burn it to the 0xa0000 position. After the image is burned, restart the development board. You can see that the LINUX boot is successful in the DEBUG window.
4. Linux compilation
a) Unzip the kernel to the current directory
unzip -d ./ /media/sf_ShareDIR/source/linux-at91-linux-2.6.39-at91.zip
b) Enter the kernel source root directory: make mrproper
c) Generate the default configuration for AT91SAM9260EK. The configuration file is in ./arch/arm/configs/
make ARCH=arm at91sam9260ek_defconfig
d) Enter the menuconfig configuration menu
make ARCH=arm menuconfig
e) Board level configuration
gedit ./arch/arm/mach-at91/board-sam9260ek.c
i. MTD partition configuration
/*
* NAND flash
*/
static struct mtd_partition __initdata ek_nand_partition[] = {
{
.name = "bootstrap",
.offset = 0,
.size = 128*1024,
},
{
.name = "uboot",
.offset = 128*1024,
.size = 256*1024,
},
{
.name = "env1",
.offset = 128*1024+256*1024,
.size = 128*1024,
},
{
.name = "env2",
.offset = 512*1024,
.size = 128*1024,
},
{
.name = "linux",
.offset = 640*1024,
.size = 2*1024*1024,
},
{
.name = "root",
.offset = 640*1024+2*1024*1024,
.size = 5*1024*1024,
},
{
.name = "user",
.offset = 640*1024+7*1024*1024,
.size = MTDPART_SIZ_FULL,
},
};
f) Configure the kernel (make menuconfig)
i. Configure support for NFS
File systems --->Network File Systems --->
<*> NFS client support
[*] NFS client support for NFS version 3
[*] NFS client support for the NFSv3 ACL protocol extension
[*] NFS client support for NFS version 4
[*] NFS client support for NFSv4.1 (EXPERIMENTAL)
[*] Root file system on NFS
g) Generate U-BOOT boot image
make ARCH=arm CROSS_COMPILE=arm-linux- uImage
It prompts that the mkimage tool is not installed. This tool can be obtained from the U-BOOT directory and copied to the /usr/bin directory.
cp ../../2.u-boot/u-boot-at91-u-boot-2013.07-at91/tools/mkimage /usr/bin/
5. Download the system image from the TFTP server through the TFTP command of U-BOOT
Refer to the document "Setting up a TFTP server under CentOS.doc" to set up the server. Modify the UBOOT source code to support related commands and set the server IP (this setting is relatively simple and is omitted here).
U-BOOT commands are:
setenv bootcmd 'tftp 0x22000000 /AT91SAM9260EK/uImage;bootm;'
Copy the kernel image to the TFTP directory:
# /bin/cp arch/arm/boot/uImage /opt/TFTP_DIR/AT91SAM9260EK/
6. File system creation
The file system uses the one previously made for the AM1808 core board. The compressed package is fs_lsh_20130320.tar.bz2 (http://pan.baidu.com/s/1pJylrBX). For detailed production methods, please refer to the document "Creating the minimum file system for the AM1808 core board.doc".
7. Mount NFS as root file system
a) Unzip the file system to the /opt/AT91SAM9260EK/4.FS/opt/AT91SAM9260EK/4.FS directory and rename it to NFS
# tar -xvf /media/sf_ShareDIR/source/fs_lsh_20130320.tar.bz2 -C /opt/AT91SAM9260EK/4.FS/
# mv /opt/AT91SAM9260EK/4.FS/fs_lsh/ /opt/AT91SAM9260EK/4.FS/NFS
b) Modify the NFS configuration file
# gedit /etc/exports
Configuration: /opt/AT91SAM9260EK/4.FS/NFS *(rw,no_root_squash,no_all_squash,sync)
c) Restart the NFS server
# service nfs restart
d) Test whether the NFS server is started successfully
# mount -t nfs localhost:/opt/AT91SAM9260EK/4.FS/NFS /mnt/
# umount /mnt
e) Modify U-BOOT parameters (can be fixed in the code, or can be set by entering the setenv command in the U-BOOT command line)
setenv bootargs 'mem=64M console=ttyS0,115200 mac=00:60:6E:42:BA:80 root=/dev/nfs nfsroot=192.168.1.222:/opt/AT91SAM9260EK/4.FS/NFS ip=192.168.1.123:192.168.1.222:192.168.1.1:255.255.255.0:::eth0:off '
f) Set the network parameters of U-BOOT and enable the PING command (to test whether the network is normal)
#define CONFIG_ETHADDR 10:23:45:67:89:AB
#define CONFIG_NETMASK 255.255.255.0
#define CONFIG_IPADDR 192.168.1.123
#define CONFIG_SERVERIP 192.168.1.222
g) Download, run and modify the kernel
i. The error shown in the figure below is displayed. After analysis, the reason is that it is unable to communicate with the NFS server. The NFS function in the kernel has been turned on. It is found that there is no related execution of connecting to the network in the output information. It is estimated that it should be a problem with the network driver. Modify the network driver configuration (this step has been configured in the previous kernel transplantation).
Menuconfig:
Device Drivers --->Network device support ---> Ethernet (10 or 100Mbit) ---> <*> Atmel MACB support
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "nfs" or unknown-block(2,0)
ii. After modifying the network configuration, it can be seen from the printed information that the NFS file system can be mounted. The system is currently stuck in Kernel panic. This may be caused by the compiler version used when compiling busybox. Open the following kernel configuration to solve it.
Menuconfig:
Kernel Features --->
[*] Use the ARM EABI to compile the kernel
[*] Allow old ABI binaries to run with this kernel (EXPERIMENTAL) (NEW
Kernel panic - not syncing: Attempted to kill init!
iii. Now the NFS file system can be successfully mounted, and the operation reaches the position shown in the figure below. It prompts that the IP address setting failed. Since I did not set the IP address intentionally, it still prompts this, so I suspect that it is reset in the startup file. Open the /etc/init.d/rcS file, remove the relevant code, and only keep the following content.
Previous article:AT91SAM9260 uses SAM-BA to debug the BOOT program
Next article:Linux (AT91SAM9260) adds support for UBIFS file system
Recommended ReadingLatest update time:2024-11-23 03:04
- Popular Resources
- Popular amplifiers
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- Problems with batch modification of silk screen printing on PCB
- IGBT super-audio power supply for induction heating
- Keep up with the latest news in 2018: fast charging and wireless charging, Bluetooth and smart home and GaN
- Application of LOTO oscilloscope with VI curve tester in circuit board maintenance
- About PCB board to make a set of playing cards
- [Silicon Labs BG22-EK4108A Bluetooth Development Evaluation] 1. Unboxing + Data Collection + Development Environment Construction + Lighting
- Please help provide the entire PCB board production process and the SMD component mounting process animation. Thank you
- Summary of DSP's real clock system--Explained with TI's DSP TMS320F2812 as an example
- E840-DTU device unresponsive problem
- The Xiaomi IoT module wifi version only costs 9.99 yuan. What would you most like to use it for?