Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
6 LPC32X0 BSP
NXP LPC32XX Linux 2.6 BSP instructions Installation, building, and deploying Linux on the LPC32x0 MCU
Table of contents
1 Introduction......................................................................................................................................... 4 1.1 1.2 1.3 2 Copyrights and limitations .......................................................................................................... 4 Host system requirements............................................................................................................ 4 About this document .................................................................................................................... 4
2.2 BSP information .......................................................................................................................... 5 2.2.1 LTIB integration ..................................................................................................................... 5 2.2.2 UBOOT .................................................................................................................................. 5 2.2.3 Linux....................................................................................................................................... 5 3 Preparing your host machine............................................................................................................. 8 3.1 3.2 4 Downloading and installing LTIB ............................................................................................... 8 Downloading and installing the LPC32X0 Linux BSP................................................................ 8
Building Linux..................................................................................................................................... 9 4.1 Start LTIB to start the build process ........................................................................................... 9
4.2 Configuring LTIB for building Linux for the Phytec 3250 board................................................ 9 4.2.1 Tool chain options ................................................................................................................ 10 4.2.2 Boot loader choice ................................................................................................................ 10 4.2.3 Linux kernel revision choice and options ............................................................................. 10 4.2.4 Root filesystem package list selection .................................................................................. 11 4.2.5 Target system configuration ................................................................................................. 11 4.2.6 Target image generation ....................................................................................................... 11 4.3 4.4 4.5 5 Selecting Linux kernel configuration options ............................................................................ 11 The root filesystem..................................................................................................................... 11 Re-building the system............................................................................................................... 12
5.2 Setting up the Phytec 3250 board to execute u-boot ................................................................. 13 5.2.1 Setting up u-boot to boot from an SD card ........................................................................... 13 5.2.2 Setting up u-boot to boot from an NAND FLASH............................................................... 13 5.3 Loading and starting the Linux kernel from u-boot................................................................... 14 5.3.1 Booting the Linux kernel over the network .......................................................................... 14 5.3.2 Setting up NFS...................................................................................................................... 14 6 Issues and notes ................................................................................................................................. 16 6.1 6.2 Pre-built configuration for an NFS based system ..................................................................... 16 SD card support and device nodes ............................................................................................ 16
1 Introduction
This document covers the Linux 2.6.25 BSP for the LPC32X0 MCU. This free BSP has been developed to support the LPC32X0 MCU from NXP. The BSP provides an initial port for the Phytec PHY3250 platform using the LPC3250 MCU, but can be easily ported to other platforms. The document explains the host system requirements, installation instructions, build procedure, and deployment options for the BSP.
2 BSP overview
This section gives a brief overview of the BSP contents, features, and supported peripherals. This BSP has been developed to support Linux kernel 2.6.25.
2.2.2 UBOOT
Uboot is the Linux bootloader supported by this BSP. UBOOT provides support for booting the Linux kernel through Ethernet or from NAND FLASH. Uboot relies on the Stage 1 Loader (S1L) to pre-initialize the board and memory prior to executing. See the phy32xx_bl.pdf file included with the LPC32X0 BSP for more information on S1L. Once S1L has initialized the board, it will load and start Uboot from one of the supported S1L boot sources. Although Uboot relies on S1L for system preinitialization, the pre-initialization code is available for free from NXPs website and can be easily added to the startup code of the Uboot source, The PHY3250 version of Uboot supports the following features: Persistent configuration of Uboot and boot parameters Kernel image boot from NAND FLASH or Ethernet Ethernet network configuration
2.2.3 Linux
This section describes the system and driver support included with the PHY3250 Linux 2.6.25 BSP.
2006-2007 NXP Semiconductors. All rights reserved.
NXP Linux 2.6 LPC32X0 BSP The DMA portion of the driver is built into the driver. This quick and dirty fix allows SD card functionality to work, but doesnt follow the DMA driver conventions. This will be fixed in a later driver release. As of this release, write protect is not supported.
NXP Linux 2.6 LPC32X0 BSP cp r <path>/gcc-3.4.5-glibc-2.3.6 /opt To patch LTIB, open a shell and switch to the ltib-8-1-2-sv directory. Make sure you are on your user level account. Issue the following command to install the patch: patch p1 < ltib-8.1.2a-lpc3250-patch After patching, switch to the ltib-8-1-2-sv/config/platform directory and make sure the phy3250 directory and its associated files are all owned by the user account. If they are not owned by the user, then switch to the root user and issue the chown command to change the file permissions to the correct user ID. Also make sure the main.lkc in the ltib8-1-2-sv/config directory is owned by the user. At this point, the installation is complete. Proceed to the next step.
4 Building Linux
This section explains the steps necessary to build the boot loader (u-boot), the Linux kernel image, and the root file system. If all the steps in the previous sections occurred without errors, the images should build without and problems. Depending on what you want in your kernel image and how the image and root filesystem are deployed, some changes may be necessary in the configuration of the build.
4.2 Configuring LTIB for building Linux for the Phytec 3250 board
After selection of the system type for LTIB, the LTIB system configuration menu will appear. This menu allows setting up the following options: Tool chain options Boot loader choice Linux kernel revision choice and options Root filesystem package list selection Target system configuration
2006-2007 NXP Semiconductors. All rights reserved.
The LTIB configuration menu is usually shown only once on the first configuration, After the first build, the menu can be manually displayed by using the config option when invoking ltib. Before exiting this menu, go through the following sections to setup the LTIB configuration. After all options are setup, select EXIT from the menu and save the configuration. The build process will now start and can take up to several hours to complete. If the Linux kernel is being configured for the first time, the Linux kernel configuration menu will eventually appear to allow the kernel configuration options to be setup.
10
NXP Linux 2.6 LPC32X0 BSP If you are doing repeated builds of the Linux kernel, make sure the Always rebuild the kernel option is selected. This will force LTIB to make the kernel on each execution instead of just the first time. Note that only the changed files of the kernel will be built. The Configure the kernel option can be selected to enable the Linux kernel configuration menu. After the kernel has been successfully built, this option will automatically disable itself, so it will need to be manually selected of the kernel configuration is being frequently modified.
11
12
5 Deploying Linux
This section covers the deployment of Linux to the board.
13
NXP Linux 2.6 LPC32X0 BSP data to S1L. Be careful not to press any extra keys before or after the transfer. Send a break sequence to the terminal to get back to the S1L prompt. The nsave, aboot, and prompt commands can then be used to setup execution of u-boot.
14
setenv bootargs console=ttyS0,115200n81 root=/dev/nfs rw nfsroot=192.168.1.51:/home/user/ltib/rootfs ip=dhcp init=/sbin/init This specific command line tells the kernel to use ttyS0 (UART 5) for the console at 115K-8-N-1 parameters, a read/write filesystem from /dev/nfs with nfsroot pointing to the root filesystem on a machine at IP address with the associated path. The Phytec board will get an IP address via DHCP and then initialize the program at /sbin/init (which will likely link to busybox). There are many variances for boot and mount options. Currently, only NFS has been tested.
15
16
NXP Linux 2.6 LPC32X0 BSP consoledev=ttyS0,115200n81 gatewayip=192.168.1.1 netmask=255.255.255.0 ipaddr=192.168.1.193 serverip=192.168.1.51 bootargs=console=/dev/ttyS0,115200n8 noinitrd root=/dev/nfs rw nfsroot=192.168.1.51:/home/usb10132/dev/ltib/rootfs ip=dhcp fileaddr=80100000 netload=tftpboot 80100000; setenv bootargs $(netbootargs); bootm bootcmd=tftpboot 80100000; setenv bootargs $(netbootargs); bootm netbootargs=setenv bootargs console=ttyS0,115200n81 noinitrd root=/dev/nfs rw nfsroot=192.168.1.51:/home/usb10132/d ev/ltib/rootfs ip=dhcp stdin=serial stdout=serial stderr=serial
17