uClinux Blackfin Installation and Users Guide The following instructions will guide you through the installation and startup of uClinux Blackfin development environment. 1. ADS-21535 Development board setup ------------------------------------- The following boards were setup to test uClinux on the Blackfin. 1.1 MDS Hawk-35 Setup Board jumper and switch setup. JP2 open. JP3 short both headers closest to CPU chip. JP4 short. JP5 open. S1 1 & 3 on. 2 off. S4 2, 3, 5, 6, 7, 8, 10, & 12 on. 1, 4 & 9 off. 1.2 MDS Eagle-35 Setup Board jumper and switch setup. EXT PF(7:0) open. UART RX SRC short both headers closest to the CPU Chip +3.3VDC shorted PS ON# SRC open BOOTMODE 1,3 on 2 off PLL Setup 6, 7, 8, 10, 11 & 12 on 1, 4 & 9 off 1.3 PUB Board Setup PUB jumpers viewed with PCI edge connector facing towards you. JP3 1-2 (right most pair), the rest open JP4 2 (right most pair), the rest open JP6 1-2, 3-4, 5-6 (left most three pairs), the other 7 pairs open JP8 all open J3 JTAG connector SW5 Position 1=ON, 2=ON,3=OFF,4=ON,5=OFF,6=OFF SW4 Position 1=ON, 2=ON, 3=ON, 4=ON, 5=OFF, 6=ON, 7=ON,8=OFF 2. Visual DSP++ and Summit ICE installation -------------------------------------------- Visual DSP++ and an ICE are required to download the uClinux kernel to the development system. The following steps will guide you through the installation procedure. 2.1 Run setup.exe from the Visual DSP++3.0 CD, VDSP-BLKFN-PC-FULL (alternatively you can download the required software from www.analog.com). You'll be able to run it for 30 days with the test drive license key. After that you'll need a valid license key. 2.2 Have the serial number ready. This should be ADI-xxx-xxx-xxxxxxxx-xxxx 2.3 Install Visual DSP++ 2.4 Next run license installation program (you will need the serial number) and select single user installation. The PC should be running Windows 95 or greater and be connected to the web. (Once your the serial number is registered, you will be sent email with a "validation code" matching your serial number. Run Install License program again, select Install Validation Code. Follow the directions to enable your permanent VDSP++ license.) 2.5 If necessary, get the ICE drivers from the Analog Devices web site. 2.6 Power down the PC and install your Summit ICE PCI board. Your Windows should auto detect the new hardware and if necessary install the Summit ICE drivers from step 2.5. 2.7 START->Settings->Control Panel->System->Device Driver Tab->DSP Emulators ->Summit ICE Emulator->Resources. Make a note of the 1st hex address in the second I/O range. For example, on my machine it looks like this: Resource Type Setting Input/Output Range FC00 FC7F Input/Output Range FFA0 FFAF Record 0xFFA0 from this example. You will use this later as the Base Address when configuring, testing and launching the emulator. 2.8 Configure the ICE and create a new platform for the development board. START->Programs->Visual DSP->JTAG ICE Configurator NEW->Platform Properties Name Hawk platform (or whatever you choose) Type Summit ICE Description Blackfin ADSP21535 HAWK board Base Address FFA0 (from my example your's may be different!) Devices Device#0 (TD0) 2.9 Connect the JTAG cable to the development board header and apply power to the board. 2.10 If you installed your development board (Hawk and PUB only) in the VDSP host PC you should not install any drivers for the development board - just check for conflicts. Check the PCI base address for the JTAG - ICE board again to see if it changed. 2.11 Assuming the base address is unchanged, test the ICE configuration. START->Programs->Visual DSP->ICE Test Utility. Remember to use the base address as the Emulator I/O Address (FFA0 from previous step). All five tests should pass: - Opening Emulator Interface - Resetting ICEPAC module - Testing ICEPAC memory - JTAG devices detected - Performing Scan Test If the second test fails, check your base address again 2.12 Launch VDSP++ START->Programs->Visual DSP->VDSP++ IDE Now that you are in VDSP++ you can build and launch the kernel. (Instructions for building a kernel are given later in this document. There is a prebuilt kernel that you can try in the uClinux_dist/images/ directory.) NOTE: Make sure that the ACTIVE session selected is the ICE and not the simulator. If you want to work in the simulator that's fine, but it's slow! 2.13 VDSP Setup Make the following selections under Target Options: - Core Reset - Use opcode scan method Optional: - System Reset (This will reset the system registers each time reset is clicked. I leave this unchecked.) Make the following selections under Preferences->General: - Unselect everything in this window. 3. Install Linux ------------------ (Skip to section 4 if Linux is already installed.) The following are instructions for installing SUSE Linux. There are many versions of Suse Linux and there are many different distributions of Linux. You may need to install some missing packages if your build fails. The following instructions will at least help you determine some of the necessary packages. I have successfully built system on several different versions of the packages below, specific package versions may or may not be required. 3.1 Install SUSE Linux Verify the boot from CD option is selected in the BIOS setup. Insert disk (1) into the CD drive and power the machine on. Login as root. Start a Konsole session. 3.2 Package Installation Insert DISK (1) of the SUSE installation disks. # mount cdrom # cd /cdrom/suse/d2 3.3 Install RPMs Installation of rpms is done using the "rpm -i" command followed by the name of the rpm file as follows: # rpm -i binutils-2.11.92.0.10-89.i386.rpm # rpm -i glibc-devel-2.2.5-38.i386.rpm # rpm -i gcc-2.95.3-216.i386.rpm # rpm -i make-3.79.1-292.i386.rpm # rpm -i ncurses-devel-5.2-262.i386.rpm # cd / # umount cdrom 3.4 Install RPMs continued Insert DISK 2 and install the following rpm's. This was Disk 3 in my Suse CD set. # cd / # mount cdrom # cd /cdrom/suse/d3 # rpm -i flex-2.5.4-524.i386.rpm # rpm -i bison-1.33-31.i386.rpm # rpm -i gperf-2.7.2-239.i386.rpm # cd / # umount cdrom 3.5 Install RPMs continued Insert DISK 1 and install the following rpm's: # cd / # mount cdrom # cd /cdrom/suse/d2 # rpm -i autoconf-2.52-230.i386.rpm # rpm -i automake-1.5-151.i386.rpm # cd /cdrom/suse/a2 # rpm -i texinfo-4.0-389.i386.rpm # umount cdrom 4. Install Blackfin uClinux ---------------------------- The Blackfin uClinux tool chains are distributed as RPMs and install to the /opt/uClinux/blackfin directory. The kernel, uClibc library, and user applications are in the uClinux-dist tar file and can be installed anywhere. 4.1 RPM installation Insert the Blackfin CD. As root install the following rpms. # cd /cdrom/RPMS # rpm -U nisa-elf-binutils-2.9-5.i386.rpm # rpm -U nisa-elf-gcc-2.95.3-9.i386.rpm # export PATH=$PATH:/opt/uClinux/blackfin/bin (You might want to add this to your default $PATH.) 4.2 Blackfin System Installation. In any desired directory install the kernel, uClibc, and the user applications using the following command: # tar zxvf uClinux-dist-"date".tar.gz 4.3 Blackfin Executable Compilation # cd ./uClinux-dist/ # make xconfig # make dep # make 4.4 Kernel and user configuration changes. The default build system includes the user applications and kernel setup that was tested for this release. If you want to try other software packages and kernel features that is possible. Just be aware that there are many combinations that won't run or even compile. To change the kernel or user applications: # make xconfig select "Target Platform Selection" set "Customize Kernel Settings" or "Customize Vendor/User Settings" to y Save and Exit The configuration menus will appear after this step. 4.5 Blackfin Executable Location A lengthy build of uClibc, all the selected user applications, and the kernel are all compiled for the first time. When this completes you should be able to find the executable in the ./uClinux-dist/images/ directory. It's called linux.dxe. This is the file you can download to the JTAG emulator device for execution. 5. Development Board Setup --------------------------- 5.1 Eagle-35 Board Memroy Register Setup The following registers need to be set with the appropriate values: EBIU_SDGCTL - 009199FB (changes to 001199FB) EBIU_SDBCTL - 04040505 EBIU_SDRRC - 0817 5.2 PUB SRAM Init Setup Run the SRAM Init Project in VDSP. This step is required to setup the PUB memory in the proper state. - Load and rebuild the SRAM init project. - Set a breakpoint after the "Done:" label . - Run to the breakpoint. If this takes longer than about a minute then something is wrong with the setup. It probably means you're in Simulator mode. 5.3 Hawk-35 Board Setup Usually the Hawk board is left with the correct memory setup by the boot rom. However, if you have difficulties downloading an executable verify the memory registers have the same values listed in 5.1. (This usually means you have the System Reset Option selected under Target Options.) 6. Loading and Running the Kernel ---------------------------------- 6.1 JTAG ICE Setup. Make a new connection in JTAG ICE Configuration box and give the address after looking at the hardware setting in the control panel. 6.2 Serial connections. Connect a serial cable to UART1 of the development board. Connect the other end to the host computer serial port. Using minicom or some other serial communications utility configure the serial port with the following parameters. Baud Rate = 57600 Number of bits = 8 Parity = None Stop bits = 1 6.3 Kernel Loading. Load the linux.dxe file created in step 4. You will need to copy the kernel file to a known location in the Windows machine. (SAMBA mounting a hard drive from the Linux host machine is a convenient method of accomplishing this step.) 6.4 Starting Address and Execution. Set the Program Counter to 1000h. Press F5 to run the linux.dxe kernel. You should see something similar to the following Linux kernel boot messages on the terminal. Note: there is limited symbolic debugging capability in VDSP++. ************************************************************ Linux version 2.4.6 (mattw@etna) (gcc version 2.95.3 20010315 (release)) #244 Thu Sep 18 16:18:50 MDT 2003 uClinux/Blackfin Blackfin support by Metrowerks (www.metrowerks.com) Memory map: text = 0x001000-0x0645e4 data = 0x0645f0-0x190050 bss = 0x190050-0x190050 romfs= 0x190050-0x191000 mem = 0x191000-0x1000000 stack= 0x1000000-0x1000000 On node 0 totalpages: 4096 zone(0): 4096 pages. zone(1): 0 pages. zone(2): 0 pages. Kernel command line: ADI21535 Cache disabled Calibrating delay loop ... 6.54 BogoMIPS Physical pages: 1000 Memory available: 14492k/15982k RAM, 0k/0k ROM (397k kernel code, 1198k data) Dentry-cache hash table entries: 2048 (order: 2, 16384 bytes) Inode-cache hash table entries: 1024 (order: 1, 8192 bytes) Mount-cache hash table entries: 512 (order: 0, 4096 bytes) Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes) Page-cache hash table entries: 4096 (order: 2, 16384 bytes) POSIX conformance testing by UNIFIX Linux NET4.0 for Linux 2.4 Based upon Swansea University Computer Society NET3.039 Starting kswapd v1.8 block: queued sectors max/low 9573kB/3191kB, 64 slots per queue RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize BlackFin serial driver version 1.00 ttyS0 at irq = 19 is a builtin BlackFin UART ttyS1 at irq = 21 is a builtin BlackFin UART Enabling Serial UART0/1 Interrupts RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize Blkmem copyright 1998,1999 D. Jeff Dionne Blkmem copyright 1998 Kenneth Albanowski Blkmem 1 disk images: 0: 8F000-18F3FF [VIRTUAL 8F000-18F3FF] (RO) Blackfin UDC driver for uClinux Ver 1.0.0 Blackfin UDC driver: Dma Buf=0x8a998 Blackfin UDC driver: EP0 Dma Buf=0x8b000 Blackfin UDC driver: usb_drv_init() done RTC: major=10, minor = 135 Real Time Clock Driver v1.10d blackfin_timer_init timer0: major=10, minor = 101 timer1: major=10, minor = 102 timer2: major=10, minor = 103 init success: MemDMA testing started MemDMA testing passed VFS: Mounted root (ext2 filesystem) readonly. Freeing unused kernel memory: 0k freed Shell invoked to run file: /etc/rc Command: hostname blackfin Command: /bin/expand /etc/ramfs.img /dev/ram0 Command: mount -t proc proc /proc Command: mount -t ext2 /dev/ram0 /var Command: mkdir /var/tmp Command: mkdir /var/log Command: cat /etc/motd Welcome to _ _ | | |_| _ _ _ _ ____| | _ ____ _ _ / \/ \ | | | / ___| | | | _ \| | | |\ / | |_| | |__| |___| | | | | |_| |/ \ | ___\____|_____|_|_| |_|\____|\_/\_/ |_| For further information see: http://www.metrowerks.com/ http://www.analog.com/ Execution Finished, Exiting /etc/issue www.metrowerks.com 7 Aug 2003 blackfin login: root Password: uClinux Sash command shell (version 1.1.1) />