社区导航

 
快捷导航
  • 首页
  • 论坛
  • 查看新帖
  • 最新回复
  • 社区活动
  • 联系管理员
  • 消灭零回复
  • E金币兑换
  • 干货
搜索
查看: 6124|回复: 2

[经验] 【学习Sitara™ AM335x】-PhyCORE-AM335X Linux Quickstart

[复制链接]

6210

TA的帖子

4

TA的资源

版主

Rank: 6Rank: 6

发表于 2012-11-14 23:40:25 | 显示全部楼层 |阅读模式
http://www.phytec.com/wiki/index.php?title=PhyCORE-AM335X_Linux_Quickstart-PD12.1.0
1 About this Quickstart

This document describes how to install and work with the Linux Board Support Package (BSP) for the phyCORE-am335x platform. This BSP provides a fundamental software platform for development, deployment and execution on the phyCORE-AM335X.

The Quickstart contains instructions for:

  • Host Setup
  • Board Setup
  • Building a BSP (Platform, Kernel, Root Filesystem)
  • Flashing images to nand (MLO, Barebox, Kernel, Root Filesystem)
2 Host Setup

The phyCORE-AM335X (PCM-051) has been developed and tested with Ubuntu 10.04 LTS Lucid Lynx. [Installation Guide] Although it is possible to use a different OS, some setup information will contain OS-specific commands and paths for settings.

Update repositories and upgrade installed packages.

  1. sudo apt-get update
  2. sudo apt-get upgrade
复制代码
2.1 Server-side Support

Support for installing and setting up TFTP, NFS, and Samba server settings to enable communication between multiple systems and the target.

2.1.1 TFTP

TFTP allows files to be downloaded from one machine to another. With most embedded Linux devices, TFTP is an efficient way to boot the kernel during development so that the user does not have to flash a new kernel every time it is modified. It is also helpful when updating images in flash from barebox .

First, start by installing the TFTP server.

  1. sudo apt-get install tftpd-hpa
复制代码

Next, files can be accessed from another machine on the same network by simply using the IP address of the host. You must specify a folder where the files will reside on the host by replacing the folder path for TFTP_DIRECTORY with whatever folder you wish to use as your TFTP file storage location, or leave the folder as the default.

  1. sudo gedit /etc/default/tftpd-hpa

  2. # /etc/default/tftpd-hpa

  3. TFTP_USERNAME="tftp"
  4. TFTP_DIRECTORY="/var/lib/tftpboot"
  5. TFTP_ADDRESS="0.0.0.0:69"
  6. TFTP_OPTIONS="--secure"
复制代码

If you made any changes to the settings of the TFTP server, you need to restart it for them to take effect.

  1. sudo restart tftpd-hpa
复制代码

Lastly, if you would like to grant every user on the system permission to place files in the TFTP directory, use the following command, replacing <TFTP_DIRECTORY> with your chosen location.

  1. sudo chmod ugo+rwx
复制代码
2.1.2 NFS

A network file-system (NFS) server gives other systems the ability to mount a file-system stored on the host and exported over the network. In embedded development, this is essential for quickly testing applications and evaluating different file-system setups.

To begin the installation process use the following command:

  1. sudo apt-get install nfs-kernel-server
复制代码

Exported filesystems are designated in the "/etc/exports" file and allow you to choose both the directory to be exported and many settings for accessing the exports. Below is an example for exporting a folder called "nfs_export-ex" located in a user's home directory.

  1. sudo gedit /etc/exports

  2. # /etc/exports

  3. /home//nfs_export-ex  *(rw,sync,no_root_squash,no_subtree_check)
复制代码

The options (rw, sync, no_root_squash, no_subtree_check) for this folder are essential in setting up the NFS export correctly. For more information on additional options, refer to the man page for 'exports'.

  • rw enables
read and write access when the directory is mounted
  • sync
tells the file-system to handle local access calls before remote access
  • no_root_squash
allows root access when mounting the file-system
  • no_subtree_check
reduces the number of checks the server must make to ensure that an exported sub-directory is within an exported tree and also enables access to root files in conjunction with no_root_squash

After modifying this file, in order to mount the directories as an NFS, you must force the NFS server to export all of the directories listed in "/etc/exports".

  1. sudo /usr/sbin/exportfs -va
复制代码
2.1.3 Samba

Samba servers are an excellent way to access a Linux file-system on a Windows machine via a network connection. Using a Samba server, it is quick and easy to transfer files between systems. To install a Samba server, use the following command:

  1. sudo apt-get install samba
复制代码

Before the Samba share can be mounted on another machine it's necessary to modify the configuration file to allow write access and access to home directories. Start by editing the "/etc/samba/smb.conf" file.

  1. sudo gedit /etc/samba/smb.conf
复制代码

Inside this file there are four specific things that need to be uncommented (remove the ';' at the beginning of the line) to enable the sharing of home folders and write access. Below is the section that must be modified:

  1. #======================= Share Definitions =======================

  2. # Un-comment the following (and tweak the other settings below to suit)
  3. # to enable the default home directory shares. This will share each
  4. # user's home directory as \\server\username
  5. ;[homes]
  6. ;   comment = Home Directories
  7. ;   browseable = yes

  8. # By default, the home directories are exported read-only. Change the
  9. # next parameter to 'no' if you want to be able to write to them.
  10. ;   read only = no
复制代码

The outcomes after the changes are made follow:

  1. #======================= Share Definitions =======================

  2. # Un-comment the following (and tweak the other settings below to suit)
  3. # to enable the default home directory shares. This will share each
  4. # user's home directory as \\server\username
  5. [homes]
  6.    comment = Home Directories
  7.    browseable = yes

  8. # By default, the home directories are exported read-only. Change the
  9. # next parameter to 'no' if you want to be able to write to them.
  10.    read only = no
复制代码

NOTE: It might also be necessary to change the "workgroup = " line to match the workgroup for your machine.

To apply the changes, the next step is to restart all Samba-related processes.

  1. sudo restart smbd
  2. sudo restart nmbd
复制代码

Lastly, each user needs to have a password enabled to be able to use the Samba server. There are no rules for this password. The simplest method for choosing this password is to make it the same as the UNIX user's password, but it is not a requirement. After typing in the command below, you will be prompted to enter the password for the specified user.

  1. sudo smbpasswd -a
复制代码

As mentioned in the configuration file, the samba share can be connected by accessing "\\<host machine ip>\\<user>" by either mounting a network share or using Windows explorer to navigate to it.

2.2 PTXdist2.2.1 General Information

PTXdist is a set of tools created by Pengutronix to help manage all of the BSP sources, from x-loader to the filesystem and its applications. It makes it easier for a user to manage everything for specific platforms and toolchains without manually repeating relatively complex commands every time it is necessary to build a new image.

2.2.2 Extracting Sources

NOTE: Visit the AM335X's BSP page [phyCORE-AM335X Linux BSP-PD12.1.0] for the correct BSP tools and images.

Note: If your BSP contains a different version of ptxdist (see BSP page), replace ptxdist-2010.11.1.tgz with the correct version as necessary in the instructions below

To install PTXdist you need to extract the archive with the PTXdist software "ptxdist-2010.11.1.tgz."

The PTXdist packet has to be extracted in order to be built before the installation. In this example, we assume that the "ptxdist-2010.11.1.tgz" file has been placed in the ~ (/home/<user>) directory.

  1. ~$ tar -zxvf ptxdist-2010.11.1.tgz
  2. ~$ cd ptxdist-2010.11.1
复制代码

Now that the source has been extracted, the next step is to configure it for building.

2.2.3 Pre-Requisites

PTXdist checks for specific packages that must be installed before it can be successfully built. The following command begins a script that uses GNU autotools to help set up the environment for building the distribution.

  1. ~/ptxdist-2010.11.1$ ./configure
复制代码

This command will automatically stop if it is missing a package, and tell you why and what package to install to continue with the initial setup. After successfully running the configure script, PTXdist is ready to be built and installed.

  1. ~/ptxdist-2010.11.1$ make
  2. ~/ptxdist-2010.11.1$ sudo make install
复制代码

The install location is "/usr/local" by default, which is why the "make install" command must be run with root privileges. If another directory is preferred for the install, use the --prefix option when installing, but be sure to add the "bin/" directory of the installed tools in this new folder to your $PATH by modifying and sourcing ~/.bashrc.

  1. source ~/.bashrc
复制代码

Now that the install is complete, the PTXdist folder in the ~ (/home/<user>) directory can be removed, as well as the original archive, but this is not necessary.

Optional:

  1. ~/ptxdist-2010.11.1$ cd ..
  2. ~$ rm  -rf ptxdist-2010.11.1*
复制代码
2.2.4 Setup

The first time PTXdist is used, there are some setup properties that have to be configured. To run PTXdist's setup, use the following command:

  1. ~$ ptxdist setup
复制代码

Once in the ptxdist setup, the only settings that should be modified are the User->Name and User->eMail. This is mainly for general logging purposes. If you wish to modify any other settings, please refer to the Getting Help section for a link to PTXdist documentation.

Since PTXdist works with sources only, it needs to grab source archives from the web using wget as it advances through its setup if they do not exist already.

2.3 Toolchains

In order to build images or applications for an embedded device, it is necessary to have a cross toolchain that will perform the necessary operations to compile code for a specified processor and system setup.

Each toolchain will have a modified GNU Compiler Collection (gcc) designed for the desired setup.

For example, the following are all toolchains contained in the OSELAS Toolchain-1.99.3.7 distribution:

  • arm-cortexa8-linux-gnueabi-gcc
  • arm-1136jfs-linux-gnueabi-gcc
  • arm-v5te-linux-gnueabi-gcc
  • powerpc-603e-linux-gnu-gcc
2.3.1 existing Toolchains

If a working toolchain is already installed for a given architecture, it is possible to use this instead of building an OSELAS Toolchain. Do note that since external toolchains have not been tested it is possible that they may not work properly across all environments.

An extra step needs to be taken if the plan is to use an external toolchain. By default, the software package will be set to check for the vendor toolchain that it was compiled with. In order to change this, use the following command inside the root directory of the BSP:

  1. ptxdist platformconfig
复制代码

Navigate to "architecture->toolchain" and clear the "check for specific toolchain vendor" field.

2.3.2 Building OSELAS Toolchains

Download [OSELAS.Toolchain-2011.02.0] and place it in the ~ (/home/<user>) directory then perform the following commands:

  1. ~$ tar -jxvf OSELAS.Toolchain-2011.11.0.tar.bz2
  2. ~$ cd OSELAS.Toolchain-2011.11.0
  3. ~/OSELAS.Toolchain-2011.11.0$ ptxdist select ptxconfigs/arm-cortexa8-linux-gnueabi_gcc-4.6.2_glibc-2.14.1_binutils-2.21.1a_kernel-2.6.39-sanitized.ptxconfig

  4. ~/OSELAS.Toolchain-2011.02.0$ ptxdist go
复制代码

Optional:

  1. ~/OSELAS.Toolchain-2011.11.0$ cd ..
  2. ~$ rm  -rf OSELAS.Toolchain-2011.11.0*
复制代码

The toolchain is now built and installed in "/opt/OSELAS.Toolchain-2011.11.0/arm-cortexa8-linux-gnueabi" and ready to be used for building the BSP.

2.3.2.1 Protecting Toolchains

It is recommended, although completely optional, to set the "/opt/OSELAS.Toolchain-2011.02.0/arm-cortexa9-linux-gnueabi" directory and its contents as read-only to prevent accidental modifications to the toolchain.


3 Board Setup-phyCORE-AM335X

The phyCORE-AM335X comes pre-flashed with MLO, barebox, linux kernel, and root filesystem. After the device is out of the box and setup, simply applying power will boot the pre-installed images from NAND flash.

3.1 Connections

Power and host-PC connections must be made to the target device. The hardware manual, included with the Rapid Development Kit, may be referred to for specific connection information.

3.1.1 Power

The primary input power for the phyCORE-AM335X Carrier Board comes from the wall adapter jack, X3 (+5 V). Upon application of power, LED D2 should light up (red) and initial serial data will be sent by uart0. The Carrier Board provides options for a warm reset or system power ON/OFF without the removal of the power source through push buttons S6 and S7, respectfully.

3.1.2 Serial

A serial connection is used as system communication for boot-up interaction throughout start-up and as a monitoring/debugging interface. This connection is made between the Host and UART0 on the phyCORE-AM335X.

The following provides a summary of the serial settings required to allow console access over the serial port in a communications program on the host such as Minicom:

Setting
Value
Bits per second115200 bsp
Data bits8-bits
Stop-bit1
Flow ControlNone
3.1.2.1 Minicom

Minicom is the recommended communications program on the host for serial communication to the device.

To install Minicom, execute the following in a terminal on the host:

  1. /* if Minicom is not installed */
  2. sudo apt-get install minicom
复制代码

Start minicom from the terminal in the following way:

  1. minicom -c on -s
复制代码

Minicom will be executed and the main menu will be displayed in the terminal:



Navigate to "Serial port setup" in the Minicom main menu and modify line A - Serial Device : to read /dev/ttyS0 and line E - Bps/Par/Bits : to have a speed of 115200 and 8-N-1 (8N1) for the stop bits:




Note: The serial device is dependent on what COM port you are connected to on your system, so /dev/ttyS0 is merely an example.

Return to the main menu of minicom and select Save setup as dfl to make this the default setup anytime Minicom is loaded, meaning minicom -c on is all that needs to be done in the future for this machine to be able to communicate with the kit. Be sure that permissions allow writing to minirc.dfl by:

sudo chmod ugo+rwx /etc/minicom3.1.3 Ethernet

The Ethernet connection is used for flashing, downloading, and debugging images and applications. Connect the cross-over Ethernet cable to the Ethernet connector on the target, X12, and appropriate network card on the host. LED D15 (green) on the Carrier Board verifies the connection.

3.2 Image Format

The bootloader, kernel, and root filesystem specific to the phyCORE-AM335X can be provided over a wide variety of sources such as the PHYTEC FTP, preloaded to NAND Flash, SD Card, TFTP Server, or NFS Server. Refer to the Flashing Images section for information on how to flash these images.

3.2.1 PHYTEC FTP

If for any reason it is necessary to re-flash the example images, they are located on the PHYTEC America FTP [here].

3.2.2 NAND Flash

The images on NAND Flash should be named in the following way:

File
File Name
MLOMLO
bareboxu-boot.img
barebox environmentbareboxenv
Linux kerneluImage
Root filesystemroot.ubifs
3.2.3 SPI NOR Flash

When used, SPI NOR Flash, suitable for small code footprint applications, can be used for booting. Since the MLO for SPI NOR Flash must be byte-swapped, the MLO is built under a different configuration (Section 4.2.1.1). The files on SPI NOR Flash should match the following format:

File
File Name
MLOMLO
bareboxu-boot.img
barebox environmentbareboxenv
Linux kerneluImage
Root filesystemroot.ubifs

NOTE: Do not use the newly created u-boot.bin, it will not work properly and has a known bug.

3.2.4 SD Card

Images can be placed on a SD/MMC card in the following way:

  • Insert SD/MMC Card on host machine
  • Configure SD/MMC Card with 64MB fat partition and mark as bootable [instructions here]
  • Copy the files, in order, to the SD Card. The files copied to the SD Card depend on the intended use and are summarized by the following:
User Intentions
File Order
File Name
Boot from SD CardMLO
barebox
Linux kernel
root filesystem
MLO
u-boot.img
uImage
root.tgz
Flash NANDMLO
barebox
Linux kernel
root filesystem
MLO
u-boot.img
uImage
root.ubifs
Flash SPI NORMLO
barebox
Linux kernel
root filesystem
MLO.spi
u-boot.img
uImage
root.ubifs

In the case of booting Linux from the SD Card, extract the contents of root.tgz to the second partition of the SD Card in the following way:

sudo tar -zxf root.tgz -C /media/rootfs3.2.5 TFTP Server

Images are available over the TFTP server, setup in Section 2.1.1.

The following files are present in a directory, such as <TFTP_DIRECTORY>/phyCORE-AM335x/images, on the server:

File
File Name
MLOMLO
bareboxu-boot.img
barebox environmentbarebox-default-environment
Linux kerneluImage


3.2.6 NFS Server

An entire root filesystem can be made accessible over the NFS Server, setup in Section 2.1.2.

To have the ability to mount the file system, root.tgz can be extracted to a NFS server directory such as /home/<user>/phyCORE-AM335x/NFS:

  1. sudo tar -zxf root.tgz -C /home//phyCORE-AM335x/NFS/
复制代码
3.3 Booting Configurations

The bootloader, one of the key software components included in the BSP, completes the required hardware initializations to download and run operating system images. The boot mode, selected from the S5 dipswitch on the Carrier Board, determines the location of the x-loader, MLO. Commonly, the Carrier Board switches will also determine the location of barebox, which is booted by MLO. The S5 switch settings for the boot modes of NAND, SPI NOR, and MMC/SD Card are shown by the following:

3.3.1 NAND

To boot from NAND, using the following switch settings:

S2-1 to S2-8 OFF

3.3.2 SPI NOR

To boot from SPI NOR, use the following switch settings:

S5-1, S5-2, S5-5, S5-6 ONS5-3, S5-4, S5-7, S5-8 OFF

3.3.3 SD Card

To boot from SD Card, use the following switch settings:

S5-1 to S5-4, S5-6 ONS5-5, S5-7, S5-8 OFF

3.4 Working with Barebox

The phyCORE-AM335X uses barebox as its bootloader, which is provided with a predefined environment setup to support the target device. The boot loader allots approximately three seconds to halt autoboot and enter barebox, in which any key must be pressed:

In barebox there are a wide variety functions which can be viewed by using the help command:

  1. help
复制代码

Barebox can be customized with environment variables and scripts to support a wide variety of booting and flashing options.

3.4.1 Environment Variables

The settings most necessary for operation are environment variables in barebox. To obtain a list of current environment variables, use the printenvcommand:

  1. printenv
复制代码
3.4.2 Configuration File

The configuration file provided by barebox is located in /env/config, this file allows the user among many things, to modify environment variables and setup networking parameters. To open and make edits to the /env/config file, do the following in barebox:

  1. edit /env/config
复制代码
3.4.2.1 Remote Settings

A part of setting network parameters is to enter the IP address of the TFTP and NFS servers, which is likely the IP address of the host if setup inSection 2.1.2. Therefore, search for the line beginning with eth0.serverip and modify to reflect the correct IP address, 192.168.3.10 is the default:

  1. eth0.serverip=192.168.3.10
复制代码
3.4.2.2 NFS Root Directory

If intending to mount the root filesystem by NFS it is required to specify the path. The NFS root path is determined by the location of the files extracted from rootfs.tgz in Section 3.2.4, such as /home/<user>/phyCORE-AM335x/NFS/. In the configuration file, search for nfsroot=”/path/to/root" and modify to read the proper path:

nfsroot="/home/<user>/phyCORE-AM335x/NFS/"

After making any changes, quit the program and return to the barebox prompt by pressing CTL+D, type saveenv to save changes:

saveenv3.4.3 Restore to Default

If the barebox environment variables need to be restored for any reason, simply delete the parameter save location in NAND, and the defaults will be restored with the next boot.

  1. erase /dev/nand0.bareboxenv
复制代码
3.4.4 Booting Options

From barebox, the boot process continues by loading the kernel which then mounts the root filesystem. Both the kernel and root filesystem locations are determined from the barebox environment. The locations classify booting Linux stand-alone or remote, where the components required are provided in the onboard media (NAND, SPI NOR, SD/MMC Card) or via a network (TFTP or NFS).

3.4.4.1 Boot Command

Selection of the location to continue booting is provided as a boot command in the current barebox environment. This command allows the user to specify the mode over which it will boot with respect to the kernel, root filesystem, ip, and oftree options. The generic usage of this command is described by the following:

  1. boot [-m ] [-k ] [-r ] [-i ] [-o ]
复制代码

By typing _boot_help in the barebox prompt, a summary of the syntax, options, and parameters are provided.

3.4.4.2 Stand-Alone NAND Booting

By default, the kit comes setup for a standalone boot from NAND Flash. Therefore, without modification to environment variables and the correct NAND boot switch settings described in Section 3.3.1, barebox will boot the preloaded Linux kernel from NAND.

Alternatively, executing commands given by the following, tells the system to boot using the Linux kernel and/or filesystem located in NAND, which is useful in the case where the boot mode on the Carrier Board is set in a configuration other than NAND boot:

Description
Barebox
Boot kernel from NAND Flash and mount rootfs from defaultboot –k nand
Boot kernel from default and mount rootfs from NAND Flashboot -r nand
Boot kernel and mount rootfs from NAND Flashboot -k nand -r nand
boot -m nand
3.4.4.3 Stand-Alone SPI NOR Booting

With the Linux kernel and root filesystem located on the SPI NOR Flash, uses of the boot command can be done in the following way:

Description
Barebox
Boot kernel from SPI NOR Flash and mount rootfs from defaultboot –k nor
Boot kernel from default and mount rootfs from SPI NOR Flashboot -r nor
Boot kernel and mount rootfs from SPI NOR Flashboot -k nor -r nor
boot -m nor
3.4.4.4 Stand-Alone MMC/SD Card Booting

For the case of the Linux kernel and root filesystem located on the SD/MMC Card, a script included in barebox to perform the standalone boot is currently in development.

3.4.4.5 Remote Booting

For development it may be beneficial to modify the boot settings to allow the kernel to be loaded from TFTP, and/or mount a network filesystem hosted on the NFS, setup in Sections 3.2.3 and 3.2.4, respectfully. Examples of the wide variety of remote booting options the barebox boot command supports is given by the following:

Description
Barebox
Boot kernel from TFTP and mount rootfs from defaultboot –k tftp
Boot kernel from default and mount rootfs from NFSboot -r net
Boot kernel from TFTP and mount rootfs from NFSboot -k tftp -r net
boot -m tftp
3.5 Booting the Target

After selecting the boot source, the target starts booting. When prompted, after the target has finished loading the system, the default login of rootcan be used:

NEED TO UPDATE THIS IMAGE TO REFLECT AM335X

4 Building a BSP4.1 Modifying the BSP

The BSP provided can be modified through the source code in the board files or through configuration management.

4.1.1 Board Files

All source code is located in the BSP-phyCORE-AM335x-PD12.1.0/platform-phyCORE-AM335/build-target directory. To help integrate and modify features on the system for both driver development and general settings or Carrier Board design, it is necessary to know about the three board files summarized by the following:

Board File
Location
Board Config File
Linux kernellinux3.3/arch/arm/mach-omap2/board-pcm051.c
BareboxINSERT: BAREBOX FILE NAME/arch/arm/boards/pcm051/env/config
Barebox MLOINSERT: MLO FILE NAME/arch/arm/boards/pcm051/env/config
4.2 Managing Configurations

PTXdist uses the kernel configuration, KConfig, files present throughout the BSP for straightforward user configuration of individual settings and drivers. The platform, kernel, and project’s root filesystem configuration menus will be the most beneficial.

4.2.1 Platform

The platform configuration menu contains the default settings for each platform including what bootloaders, kernel, and filesystem images are to be built and located. The settings for the platform are modified using the following command:

  1. ptxdist platformconfig
复制代码

This menu can be used to select the build configurations specific to the SPI NOR bootloader. Otherwise, as a user, it is very rare to modify these settings, but it may be useful to view them:

4.2.1.1 Creating MLO.spi

Since the MLO used for SPI NOR Flash has to be byte-swapped, the u-boot target configuration settings must modified and the boot images will need to be rebuilt. In ptxdist platformconfig select bootloaders and then U-boot, by changing (pcm051) U-Boot config target to (pcm051_spiboot) U-Boot config target the required modifications are made. Save and exit platform config and rebuild the bootloader images:

  1. ptxdist clean u-boot
  2. ptxdist targetinstall u-boot
复制代码

This will create the SPI NOR Flash specific MLO.spi file. Also, it will create u-boot.bin, however, this file has a known bug and does not work properly, therefore use of it is not recommended.

4.2.2 Kernel

The kernel configuration menu allows the user to adjust the drivers and support included in a linux kernel build. The settings are available by using the following command:

  1. ptxdist kernelconfig
复制代码

4.2.3 Root Filesystem

Configuration of the project’s filesystem can be done in the overall menuconfig. By toggling the options in the base configuration, the applications and content built into the filesystem can be modified directly. This allows both minimal and more complete filesystem builds to be created easily. The following command will open the configuration menu:

  1. ptxdist menuconfig
复制代码

4.3 Building Images with PTXdist

Building and creating images with PTXdist is very simple. All the required steps to compile sources and build packages in the correct order are done using the ptxdist go command. Following a successful build, the command, ptxdist images, will create images to deploy on the target. Additional setup is required for the first build of the BSP images. The file, http://museum.php.net/php5/php-5.3.3.tar.bz2, must be downloaded and placed in the BSP-phyCORE-AM335x/src directory. Also, both the platform configuration and toolchain paths must be specified using the ptxdist platform and ptxdist toolchain commands, respectfully.

  1. ptxdist platform configs/phyCORE-AM335x-2012.01.0/platformconfig
  2. ptxdist toolchain ../opt/OSELAS.Toolchain-2011.02.0/arm-cortexa9-linux-gnueabi/gcc-linaro-4.5-2011.02-0-glibc-2.13-binutils-2.21-kernel-2.6.36-sanitized/bin
复制代码

To build and create images, execute the following commands from the project directory:

  1. ptxdist go
  2. ptxdist images
复制代码

All images are stored in BSP-phyCORE-AM335x/platform-phyCORE-AM335x/images, the following can be expected:

  • barebox-default-environment
  • barebox-image
  • linuximage
  • MLO
  • root.tgz
  • root.ubifs
  • root.ubi
5 Flashing Images

Flashing images can be relatively complex and there are two main ways to accomplish this, the barebox update command and MMC.

5.1 Update Command (Remote Flashing)

To update the bootloader, kernel, or filesystem in flash, the current barebox environment provides the update command. This command allows the user to specify the file to be flashed, the mode over which it will be flashed, and the path to the image. The generic usage of this command is described by the following:

  1. update -t -d [-m tftp|xmodem] [-f imagename] –c
复制代码

By typing _update_help or update in the barebox prompt, a summary of the syntax, options, and parameters are provided.

5.1.1 TFTP

TFTP is one of the simplest ways to apply modifications during development; it is commonly used for single file updates such as the bootloader, kernel, and files from the root filesystem.

The update command in barebox can be used to flash images to NAND or NOR flash from the TFTP Server in the correct format and located, for example, at<TFTP_DIRECTORY>/phyCORE-AM335x/images as specified in Section 3.2.3:

Update file
NAND
NOR
MLOupdate -t xload -d nand –m tftp -f phyCORE-AM335x/images/MLO update -t xload -d nor –m tftp -f phyCORE-AM335x/images/MLO
bareboxupdate -t barebox -d nand –m tftp -f phyCORE-AM335x/images/u-boot.imgupdate -t barebox -d nor –m tftp -f phyCORE-AM335x/images/u-boot.img
bareboxenvupdate -t bareboxenv -d nand –m tftp -f phyCORE-AM335x/images/barebox-default-environmentupdate -t bareboxenv -d nor –m tftp -f phyCORE-AM335x/images/barebox-default-environment
kernelupdate -t kernel -d nand –m tftp -f phyCORE-AM335x/images/uImageupdate -t kernel -d nor –m tftp -f phyCORE-AM335x/images/uImage

NOTE : TFTP is the default mode, as set in /env/config in barebox, therefore, “-m tftp” can be omitted from update commands.

5.2 SD/MMC Flashing
此帖出自DSP论坛
生活就是油盐酱醋再加一点糖,快活就是一天到晚乐呵呵的忙
===================================
做一个简单的人,踏实而务实,不沉溺幻想,不庸人自扰


回复

使用道具 举报

8

TA的帖子

0

TA的资源

一粒金砂(初级)

Rank: 1

发表于 2014-2-16 12:50:31 | 显示全部楼层
太好了 刚开始学linux 对我很有帮助


回复

使用道具 举报

39

TA的帖子

0

TA的资源

一粒金砂(中级)

Rank: 2

发表于 2014-6-30 16:10:00 | 显示全部楼层
非常需要,谢谢,~~~~~~~~~


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

  • 论坛活动 E手掌握

    扫码关注
    EEWORLD 官方微信

  • EE福利  唾手可得

    扫码关注
    EE福利 唾手可得

小黑屋|手机版|Archiver|电子工程世界 ( 京ICP证 060456

GMT+8, 2017-11-18 19:51 , Processed in 0.454682 second(s), 16 queries , Redis On.

快速回复 返回顶部 返回列表