About This Document About This Document This document describes the usage of the uClinux NEEK board support package. With the help of the bsp you can develop embedded applications using NEEK kit and uClinux. Table below shows the revision history of the document Version Date July 2008...
Page 4
Typographic Conventions uClinux NEEK BSP System Level Solutions...
uClinux NEEK BSP Typographic Conventions This document uses the typographic conventions shown as below. Visual Cue Bold type with initial capital letters Bold Courier 1, 2 • System Level Solutions uClinux NEEK BSP Development Environment Meaning All headings, subheadings titles in a document are displayed in bold type with initial capital letters.
1. Introduction uClinux NEEK Board support package (BSP) provides developers with the easiest and fastest way to create embedded applications on the NEEK kit (target) using the uClinux operating system. This combination of hardware, firmware, and software form a complete package for building, downloading, and testing applications developed on a host machine: •...
Introduction 16-Mbytes Intel P30/P33 flash and LCD multimedia card. To get the details of NEEK kit, please read NEEK user guide located at /DOCS. 1.3 Supported Devices The NEEK board devices that are currently supported in the uClinux kernel with the uClinux NEEK BSP include: •...
Page 11
uClinux NEEK BSP 4. Apply power to the NEEK board. 5. Connect VGA connector of the monitor to the VGA port of NEEK board if you want to see the images on both the VGA screen and LCD. System Level Solutions uClinux NEEK BSP Development Environment...
2. uClinux NEEK BSP Development Environment This chapter provides information to help setup the development environment for the NEEK board. 2.1 NEEK BSP SOPC System Figure 1 below shows the block diagram of NEEK BSP SOPC system. Figure 1 : NEEK BSP SOPC System NEEK Development Board LCD Controller Controller...
uClinux NEEK BSP 2.2.2 IP Address Used The table below lists the IP address and port used throughout this document. It may be different for your system. Please check your network settings before applying any IP address. IP Address 192.168.0.14 192.168.0.26 192.168.0.205 255.255.255.0...
uClinux NEEK BSP Development Environment #cd Bintools #tar jxfv nios2gcc-20080203.tar.bz2 6. Return to uClinux #cd.. 7. Issue command Here you will see nios2-linux Bintools System-files. 2.3.2 Directory Contents You have now successfully unpacked the BSP package. You will see following directory structure: Directory uClinux...
Page 17
uClinux NEEK BSP 1. Open the Linux terminal. 2. On the terminal, change into the $home/uClinux/uClinux-dist directory and change the environment path. Use one of the four main kernel configuration methods to start the configuration menu. #cd /home/uClinux/nios2-linux/uClinux-dist #PATH=$PATH:/home/uClinux/Bintools/opt/nios2/bin 6. Configure the kernel #make clean #make menuconfig You will see the Kernel configuration main menu as shown in...
Page 18
uClinux NEEK BSP Development Environment Figure 4 : Vendor/Product Configuration Window 2. Select the following options: • Vendor: Vendor (Altera) • Target Product: Altera Products (nios2) ----> 3. Select <Exit>. You will return to Kernel configuration menu Configuring Kernel/Library/Defaults Settings 1.
uClinux NEEK BSP Figure 6 Libc Version Settings 3. Press Enter to select None. 4. Select <Exit> 5. Select <Exit> 6. You will be asked to save the kernel configuration. See Figure 7 : Save Option 7. Select <Yes> and press Enter. You have now finished Kernel/Library/Defaults settings.
Page 20
uClinux NEEK BSP Development Environment Figure 8 : CPU Selection 2. Enter the choice (1). It will ask to select a device to execute kernel from: Figure 9 Figure 9 : Select a Device to Execute Kernel From 7. To select DDR SDRAM, enter: Selection:7 8.
uClinux NEEK BSP You may get error. Ignore it. 2.4.3 Customization of Kernel Settings 1. To customize the Kernel Settings, type on the terminal: #make menuconfig Figure 10 : Linux Kernel Configuration Window 2. Select Kernel/Library/Defaults Selection and press Enter. You will see the more kernel configuration settings as shown in Figure 11 : Customize Kernel/Library/Defaults Selection Window 3.
uClinux NEEK BSP Development Environment 5. Select <exit> 6. Select <yes> for saving all changed settings. Save all the settings and exit. 2.4.4 Building uClinux zImage Once you configured the kernel, build uClinux Image by issuing following commands. #make Here you will get zImage (elf file) at /home/ uClinux/ nios2-linux/uClinux-dist/image uClinux NEEK BSP System Level Solutions...
3. Downloading and Running zImage zImage is one type of elf file which contains compress kernel image and romfs image. Given below are the steps for downloading a running zImage in to the NEEK hardware platform. 3.1 Running zImage on Linux 3.1.1 Using JTAG UART Console To run zImage on Linux, you should have Nios2 EDS installed on your pc with properly set environmental variables.
Page 24
Downloading and Running zImage Figure 12 Minicom Configuration Window1 2. Select the Serial Device, baud rate and other parameters as shown in Figure 13. Here, we have selected Serial device as /dev/ttyS0 but it may differ as per your development machine. Figure 13 : Minicom Configuration Window 2 uClinux NEEK BSP System Level Solutions...
uClinux NEEK BSP 3. Set the baud rate 115200, 8 bit, no parity and one stop bit. See the Figure 14 : Minicom Configuration Window3 4. You may set this configuration as default by selecting Save Setup as dfl option after all configurations. 5.
Downloading and Running zImage 3.2.2 Using Serial UART Console You can build zImage on Linux and run it on windows. This is the description for serial UART console. Go to the "/home/uClinux/uClinux-dist/images" directory. Copy the file named "zImage" and paste it in to your windows PC (make sure your zImage absolute path doesn’t contain a white character i.e.
4. Configuring Device Drivers and File Systems If more functions need to be supported on kernel, then before the kernel rebuild, it needs to do the selected kernel configuration, the following sessions describe the procedures to do configurations. To know more about peripherals and hardware available on the NEEK kit, refer the NEEK Kit Getting Started User Guide located at <BSP Installation Path>/Docs.
Configuring Device Drivers and File Systems 4.2 Flash Memory (MTD) Driver To include the Flash Memory (Memory Technology Device) driver in compilation, the following options should be enabled: Device Drivers ---> Memory Technology Devices (MTD) ---> [*] Memory Technology Device (MTD) support [*] MTD partitioning support [*] Direct char device access to MTD devices [*] Caching block device access to MTD devices...
uClinux NEEK BSP File systems ---> Miscellaneous File systems ---> [*] Journaling Flash File System v2 (JFFS2) support (0) JFFS2 debugging verbosity (0 = quiet, 2 = noisy) [*] JFFS2 write-buffering support 4.3 SLS SD Card IP Driver To include the SD Card Driver in compilation, the following options should be enabled: Device Drivers --->...
Configuring Device Drivers and File Systems File systems ---> DOS/FAT/NT File systems ---> [*] MSDOS fs support [*] VFAT (Windows-95) fs support (850) Default codepage for FAT (Iso8859-1) Default iocharset for FAT Native Language Support --- Base native language support (iso8859-1) Default NLS Option [*] Codepage 437 (United States, Canada) [*] Codepage 850 (Europe)
uClinux NEEK BSP 4.4.1 NFS NFS is a network file system protocol originally developed by Sun Microsystems in 1984, allowing a user on a client computer to access files over a network as easily as if the network devices were attached to its local disks. If you want to use NFS file system on Ethernet then you have to configure both the Ethernet IP driver (as described above) and NFS file system.
Configuring Device Drivers and File Systems 4.7 SLS Touch Panel Controller (TPC) IP Driver To include the SLS TPC IP Driver in compilation, the following options should be enabled: Device Drivers ---> Character devices ---> [*] SLS TPC support 4.8 SLS I S IP Driver To include the SLS I S IP driver in compilation, the following options should be...
uClinux NEEK BSP Device Drivers ---> Character devices ---> Serial support ---> [*] Altera UART support (4) Maximum number of Altera uart ports (115200) Default baudrate for Altera UART ports 4.10 JTAG UART Driver To include the JTAG UART Driver in compilation, the following options should be enabled: Device Drivers --->...
5. User Applications Using the User Applications you can access the drivers, file systems and peripherals available on the board. This chapter describes the following user applications. 5.1 Flash and JFFS2 Application To access Flash and JFFS2 application, include its driver and file system as described in the section Configuration.
uClinux NEEK BSP flash_erase device offset number_of_blocks flash_eraseall /dev/mtdx mount -t jffs2 dev/mtdblockx /mnt mkdir new cp /new /dev/mtdx lock /dev/mtdx Note: (1). Where x=0, 1, 2.. mtd device or mtdblocks in the system. (2). By default sectors of flash device are locked. So you can not write anything before unlocking the flash device.
Network Utilities Before going further, copy .jpg images from your PC in the SD Card and make the following selection. Miscellaneous Applications ---> ---video tools [*] jpegview 5.2.1 Viewing the SD Card Images on the VGA and LCD 1. To mount the SD Card on mnt directory, Issue the following command on the target when the system is up and running.
uClinux NEEK BSP 10176026.jpg dho13v.jpg 4. View the images contained in the SD card on VGA monitor connected to VGA port of NEEK board and NEEK board LCD screen by issuing the following command. /mnt>jpegview -S1 –f 10036828.jpg 10176026.jpg The console displays: SLS_VGA Driver is opened 800 480 800 480 0 0 16 0 -1 -1 framebase = 0x5000000 err=0...
Network Utilities miscellenieous application --> --- Audio tools [*] mp3play Build the zImage with these options. To test this application, copy the MP3 songs in SD card and run the zImage, when it is up and running. Mount the SD card as explained in Viewing the SD Card Images on the VGA and LCD.
Page 39
uClinux NEEK BSP [*] NanoX --- Demos [*] NanoXDemo --- Applications [*] NanoWM --- Settings Screeen PixType (Packed-16bit-5/6/5) ---> [*] Have File IO [*] Have BMP Support [*] Have GIF Support [*] Have PNM Support [*] Have JPEG Support [*] Have PNG Support --- Display Config [*] Frame Buffer Display --- Mouse/Touch Screen...
Network Utilities 5.6 Adding New User Application This section explains you of adding a user application named hello in uClinux. Follow the steps below to add a new user application. 1. Create hello directory in the /home/uClinux/uClinux-dist/user directory. 2. Copy source file (C file) to the hello directory 3.
uClinux NEEK BSP 5.7 Build New User Application Using SLS IP Drivers To build a new user application using SLS IP drivers refer DRIVERSAPI.txt located at /Docs. 5.8 Shell Commands Using Shell commands you can perform operations on the uClinux on the NEEK board.
Page 42
Network Utilities ln –s file1 file2 ls [options] mkdir mkdir dirname mknod mknod type major minor more more filename mount mount –t type device dir mv source dest printenv printenv quit quit rm file rmdir rmdir dir sleep sleep number setenv setenv var value source...
6. Configuring Network utilities and NFS (Client) This chapter introduces you about the network utilities ftp, dhcpcd, telnet, boa, and inetd. First of all follow all steps for Ethernet driver mentioned in the section SLS Ethernet IP Driver. 6.1 Configuring DHCP Client 1.
Root File Systems 6.2 Static IP Allocation To configure the Static IP, do the following settings: BusyBox ----> [*] ifconfig Enable status reporting output (+7k) To allocate static IP to the board, issue following command on the target. />ifconfig eth0 192.168.0.14 6.3 Mounting NFS on NEEK Before mounting NFS on NEEK, select the options as mentioned in IP Driver...
uClinux NEEK BSP 3. Edit the file named exports under /etc directory and add the following line: /home/nfs 192.168.0.0/255.255.255.0(sync,no_root_squash,rw) This setting may differ as per your network 5. Restart NFS server. #service nfs restart 6. Verify it by issuing the following command. #showmount –e 6.3.2 NFS Client (NEEK) Setup When the zImage is up and running, issue the following command:...
Root File Systems #ftp 192.168.0.14 You will see following on the host terminal. Enter the ftp user name and password Connected to 192.168.0.14 220- Welcome to the uClinux ftpd! 220 uClinux FTP server (GNU inetutils 1.4.1)ready User (192.168.0.14 :( none)): ftp 331 Guest login ok, type your name as password.
7. Debugging Kernel and User Application To debug the user application you will require following software and hardware: • Cross/Straight Network cable • JTAG cable • Eclipse IDE for C/C++ developers. You can download Eclipse IDE from http://www.eclipse.org/downloads/download.php?file=/technology/epp/do wnloads/release/20071103/eclipse-cpp-europa-fall2-linux-gtk.tar.gz 7.1 Debugging uClinux kernel using nios2-elf-insight over JTAG To debug the uClinux kernel using nios2-elf-insight over JTAG, first build the zImage by using the following steps:...
Page 48
Debugging Kernel and User Application break *main break *start_kernel 5. Issue the command: #nios2-debug home/uClinux/uClinux-dist/linux 2.6.x/vmlinux.elf Wait for few seconds and following window will get opened. Figure 17 : main.C Now you can debug easily with aid of GUI. You can set the break point, check the content of registers and see the assembly code also.
uClinux NEEK BSP 7.2 Debugging User Application using gdbserver over Ethernet Insight is the GUI of gdb debugger. Often it’s not easy to remember the debug Command. Therefore insight provides the graphical interface so user can debug easily. The aim of the document is to explain how to debug user space application.
Debugging Kernel and User Application #nios2-linux-uclibc-insight Helloworld.gdb 9. A source window will open and display the source Helloworld.c. 10. The open a gdb console, with View>Console, enter gdb command in this window. gdb>target remote 192.168.0.14:9999 11. Then it will report the target address of the program. Now you can set break points and debug.
Page 51
uClinux NEEK BSP 8. Project types, executable, Hello world ANSI C Project, (or empty project and add your source).Finish. 9. Now, setup for nios2 tool chain in Eclipse IDE on the host by following the steps below: a) Select the project Helloworld under Project Explorer. b) Right click on Helloworld and select Properties.
Page 52
Debugging Kernel and User Application • Select workspace>Helloworld>Debug>Helloworld and copy the file into /uclinux-dist/romfs/bin. e) Build the zImage as explained in early section. f) Click OK. 10. Now, select Project-->Build project to compile your project. 11. Copy from your workspace/Helloworld/Debug/Helloworld to romfs/bin in uClinux-dist and build the zImage as explained earlier.
8. Demonstrations & Quick Reference Download Demonstrations and Quick Reference from http://slscorp.com/pages/bspdownload.php. This demo package contains two types of applications: • Applications supported to NEEK Application Selector o SLS uClinux demo o SLS_Player These demonstrations are not the final product but are for demo purpose only It demonstrates how to develop real time application using the uClinux and nios2.
Page 54
Demonstrations Figure 18 : Application Selector 2. In the application selector main menu, touch the SLS_Player to select it. 3. Touch the Load button located on the bottom left corner of the Touch Screen to load the SLS Player application. You will see Figure 19 : Loading SLS Player 4.
Page 55
uClinux NEEK BSP Figure 20 : Running the SLS Player - Main Menu 5. Change the SD Card mode as mentioned in dialog box and click OK. The SLS Player main menu displays. 6. Select MPEG to play MPEG clips. See Figure 21 : SLS Player Main Menu System Level Solutions Debugging Kernel and User Applications...
Page 56
Demonstrations 7. Select Welcome.mpg and click Play. The MPEG clip will get played on the screen. 8. Repeat steps 6 to 7 to play JPEG and MP3 files SLS uClinux Demo The SLS uClinux demo is designed to run multiple applications on uClinux platform.
Page 57
uClinux NEEK BSP Debugging Kernel and User Applications Figure 23 : Running the SLS uClinux Demo - Main Menu 5. Select Start Experiment option. You will see a blank graph window as shown in Figure System Level Solutions...
Page 58
Demonstrations Figure 24 : SLS Player Main Menu 6. Select Start button to start logging the dummy data. The graph will be drawn as shown in Figure 25 Figure 25 : Data Logger - Graph Display 7. To view the logged data in table view, select Table option. See below.
Page 59
uClinux NEEK BSP Figure 26 : Logged Data in Table View 8. To change sampling frequency click on Settings button. Enter the desired frequency. See Figure 27 Figure 27 : Data Logger Settings System Level Solutions Debugging Kernel and User Applications below.
Demonstrations 8.2 Quick Reference Quick Reference gives you quick overview of the applications explained in chapter 5 and 6. When you extract Quick Reference, you will find following directories: • Prebuilt_zImage • Framebuffer_console 8.2.1 Prebuilt_zImage Prebuilt_zImage directory contains files to format the SD Card and other ready to use applications: •...
Page 61
uClinux NEEK BSP Booting uClinux on NEEK LCD Download .sof and zImgae, you will see booting uClinux on NEEK LCD. When the zImage is already up and running, plug PS/2 keyboard in PS/2 port. Now execute the shell command as usual. You can execute all shell commands offered by shell and can run various programs and utilities available in the zImage.
Need help?
Do you have a question about the NEEK Board Support Package uClinux and is the answer not in the manual?
Questions and answers