Home
OpenRISC OpenRISC - Index of
Contents
1. 73 40 Eclipse debug Commands tab FF FI GG GG 73 List of Tables 1 UOpenRISU Products Comparison 065 A a RA 8 2 R5422 48b Jumper Configuration sr Re A RR ROF a ER R gt A WA 14 Be 2GB System Mage ul gk e Wy BL RR RIO Ry R a 15 4 Enable disable services FFF ug 17 5 Watchdog Timer IOCTLS e e Ri ee eet ee RD 40 6 BIOS hwtest parameters 20o 0 2 0 5022024 naeia 51 7 Common parameters and test modules a 63 amp Serial Test Cable Wiring es Le A Ai AE Bn a toa d aa 64 9 I O Pin Connections for Alekto left and Alena right 65 10 Optically Isolated Input Channels and Relays 0 000000 4 65 Ti Gime Loa cal parameters o s Fl e e e ea a 69 1 Toobin OS LL we ee RA Bae Ge wo BYT RE in 74 April 2010 OpenRISC User Manual 6 1 Introduction 1 Introduction The OpenRISC is an ARM9 based RISC industrial embedded computer The great variety of interfaces like LAN CF microSD USB CAN I2C serial interface and digital I O makes it easy to connect various industrial devices to the OpenRISC Compact dimensions and DIN Rail mounting capability make the OpenRISC to a space saving and flexible mounting industrial computer It is feasible to be installed even in space limited environments Due to RISC based architecture the OpenRISC has very small power consumption 6 5 Watt so fanless heat dissipation
2. Example hwtest cycles 1 epld eplddev dev ttyS1 eplddev dev ttyS2 executes the EPLD test for both serial ports B 8 USB Test For USB test USB mass storage device should connected to the USB port The device must be properly detected and mounted usbmntdev option defines which device to mount Usage examples hwtest cycles 1 usb usbmntdev dev sdal executes the USB test for the first detected mass storage device hwtest cycles 1 usb usbmntdev dev sdai usbmntdev dev sdb1 executes the USB test for the first and the second detected mass storage devices B 9 CAN Test The CAN test will be made between the internal CAN interface and the VScom USB CAN device At first the USB CAN sends one frame with the following data 0xDEADBEEF00000001 after internal interface receives this frame it send the same frame in return There is only one parameter canpseed to configure the CAN baudrate hwtest cycles 1 can canspeed 20000 executes CAN test at 20Kbit s B 10 WLAN Button Test WLAN Button test checks if WLAN button and WLAN button LED are functioning properly Starting the test will let the WLAN button LED light on The button must be pressed during the via wbtimeout specified time slot After pressing the button the LED will go off and the test is successful hwtest cycles 1 wlanbtn wbtimeout 5 executes WLAN button test for 5 seconds April 2010 OpenRISC User Manual 66 B Hardware Test Ut
3. e with echo EPLD_RS485_RTS_ECHO EPLD_RS485_ART_ECHO both outgoing and incoming mes sages will be received by application e without echo EPLD_RS485_ART_2W EPLD_RS485_RTS_2W application receives only incoming messages Baud rate generation interface The OpenRISC provides full support for the 16C950 UART baud rate generation This allows the user to use the serial interfaces with arbitrary speeds up to 3 6Mbit s To use this capability the current baud rate must be set to B38400 and the custom divisor to the negative value of the desired baud rate In the source code below the baud rate will be set to 500000bit s so the custom divisor was set to 500000 see the lines 26 39 and the current baud rate to 38400 see the lines 41 66 include lt stdio h gt include lt stdlib h gt include lt sys types h gt include lt sys time h gt include lt sys ioctl h gt include lt sys stat h gt include lt unistd h gt include lt termios h gt include lt fcntl h gt include lt linux serial h gt include lt string h gt int main int argc char argv int fd ret struct termios ser_termios struct serial_struct ss_st fd open dev ttyS1 O RDWR O NOCTTY if fd lt 0 April 2010 OpenRISC User Manual 37 AS AS CU OU UD AA Mp _O O LANA WIN ol Ro 55 7 OpenRISC Hardware API perror open return 1 set custom divisor to 500000 to achieve 500000bit s
4. workgroup debian netbios name debianserver server string h server Samba v log file var log samba log m max log size 1000 syslog 0 SAMBA path samba browseable yes writeable yes valid users user admin users debian Now you need to restart the samba to take the new changes effect etc init d samba restart 4 7 6 Web Server Apache2 2 The Apache HTTP Server Project is an effort to develop and maintain an open source HTTP server for modern operating systems including UNIX and Windows NT The goal of this project is to provide a secure efficient and extensible server that provides HTTP services in sync with the current HTTP standards Apache has been the most popular web server on the Internet since April 1996 In addition to the Apache2 packages the openssl package is installed to enable a SSL certificate creation Apache2 is already equipped with SSL certificate and is ready to accept https connections needed for example to configure mail server via webadmin tool see 4 7 7 To create your own certificate or to install the official certificate take a look at the following paragraph How to Configure SSL To enable https connections a SSL certificate must be created and then registered by the Apache2 web server 1 mkdir etc apache2 ssl 2 openssl req new x509 days 365 nodes out etc apache2 ssl apache pem keyout etc apache2 apache pem chmod 600 etc apache2 ssl apache pem c
5. 36 Embedded debug Cygwin Y 56 Embedded debug Native Efioctls_remote amp Equinox OSGi Framework ioctls Search Project Browse Java Applet Java Application JuJUnit Ju JUnit Plug in Test 3 Remote Java Application Ee SWT Application o aew Figure 38 Eclipse debug Main tab April 2010 OpenRISC User Manual 72 D Eclipse Debug Create manage and run configurations S DBX o He di Name ioctls_remote El Main ESSEN Commands e Source E Common E c C Attach to Local Application WW Debugger Embedded E Stop on startup at Advanced E c C Local Application E C C Postmortem debugger Debugger Options n 8 Eclipse Application Main 36 Embedded debug Cygwin GDB debugger arm linux gdb Browse Y 56 Embedded debug Native mne Y Equinox OSGi Framework Warning Some commands in this file may interfere with the startup operation of the debugger for example run SijJava Applet java Application GDB command set Standard asun Protocol mi y J JUnit Plug in Test E Remote Java Application E SWT Application Verbose console mode Figure 39 Eclipse debug Debugger tab Debug x Create manage and run configurations E tb x a Name ioctls_remote
6. 3 byte pad 1 4 ushort szram direct in MB 5 ushort szflash2 6 ushort szflashl direct in MB 7 byte mac2 6 8 byte macl 6 9 ushort biosid 10 char prddate 11 as a string ie 01 01 2006 11 ulong serialnr 12 ulong hwrev 13 ulong magic 14 _ attribute___ packed See hwtest hwtest c gt param_read_hw_params routine on how to read the parameters from flash 7 9 WLAN Button Alekto LAN Only OpenRISC Alekto LAN provides an additional button By default this button is used to control WLAN card s transmit power This button is just connected to GPIO line and will be controlled by wland service refer to Section 5 1 3 To use it for other needs just disable the wland service Following ioctl command for dev gpio is provided to get button s state GPIO_CMD GET BTN_ WLAN return value is 0 for not pressed and 1 for pressed April 2010 OpenRISC User Manual 41 8 proc Extensions for the OpenRISC 8 proc Extensions for the OpenRISC In the proc vsopenrisc directory reside several files to manipulate the OpenRISC hardware epld_ttyS configure serial driver e g rs232 rs422 rs485 For exact values execute echo proc vsopenrisc epld_ttySn n 1 4 For detailed description see 7 4 gpio_ set and read digital IO channels For detailed description see 7 1 leds set and read LEDs values For detailed description see 7 3 buzzer buzzer_frq configure the buzzer For detailed descri
7. B Main Debugger E Source E Common E c c Attach to Local Application E c C Local Application Initialize commands E c c Postmortem debugger target remote 192 168 1 66 9000 8 Eclipse Application 36 Embedded debug Cygwin Y 56 Embedded debug Native amp Equinox OSGi Framework m E Java Applet GiJava Application JuJUnit Jt JUnit Plug in Test E Remote Java Application E SWT Application Figure 40 Eclipse debug Commands tab April 2010 OpenRISC User Manual G Frequently Asked Questions FAQ E Cross Compiler Tools Name Description ar Creates and updates static library files as Assembler g C compiler cpp C preprocessor gcc C compiler Id Linker nm Lists symbols from object files objcopy Copies and translates object files objdump Displays information about object files ranlib Generates indexes to archives static libraries readelf Displays information about ELF files F DVDs Content Table 12 Toolchain items The OpenRISC will be shipped with two DVDs e DVD Debian is the Debian for ARM distribution e DVD Software includes documentation development tools and sources development arm linux toolchain and kernel source documentation manuals and data sheets images CF microSD images with prein
8. In the case of OpenRISC take the following steps host gt ls src host gt mkdir insight arm cd insight arm host gt src configure target arm linux program prefix arm linux host gt make host gt make install You can also use Eclipse to debug your application see Appendix D 2 19Please make sure to install gdb package apt get install gdb H http sourceware org insight April 2010 OpenRISC User Manual 33 7 OpenRISC Hardware API 7 OpenRISC Hardware API Such hardware as digital I O buzzer serial interface will be controlled via IOCTL commands These commands are defined in the vsopenrisc h header file Almost all IOCTL commands are reflected in the proc filesystem see Section 8 To control the hardware the dev gpio device must be opened int fd fd open dev gpio O RDWR if fd lt 0 exit 1 Listing 3 Open dev gpio Some examples for the OpenRISC hardware are provided in the examples ioctls c and examples ioctls2 c For the usage in real applications see the source code of the Hardware Test Utility hwtest provided on SVN repository 7 1 Digital 1 O The OpenRISC provides up to 8 digital input output channels 2 optically isolated inputs and 2 relays The data direction for each I O channel not for optically isolated inputs or relays can be independently set to input bit value 0 or output bit value 1 An interrupt for an input channel can also be independently enabl
9. To view info such as version dependencies installed size etc execute apt cache show pkg name To install packages execute apt get install pkg1 pkg2 su rights needed To update the list of package known by your system execute apt get update su rights needed To upgrade all the packages on your system apt get upgrade su rights needed To remove packages from your system execute apt get remove pkgi pkg2 su rights needed To install a package that is not contained in the repository download the deb file and execute dpkg i pkg file name su rights needed One of the on line repositories is already configured to use the enclosed DVD Debian uncomment the first repository entry deb cdrom Debian GNU Linux 4 0 r0 _Etch_ Official arm DVD Binary 1 20070407 18 08 etch contrib main deb http security debian org etch updates main contrib deb src http security debian org etch updates main contrib deb http ftp de debian org debian stable main 54for detailed information visit http www debian org doc FAQ ch pkgtools en html April 2010 OpenRISC User Manual 60 A Debian Maintenance Notes A 2 Keep a Track on Disk Usage To get the list of all installed packages with its installed sizes execute dpkg guery W f Package t Installed Size t Status n awk installed print 2 t 1 To estimate the file space usage execute du h To get a HTML output execute durep w
10. hciconfig hci0 piscan auth lm master the default passkey configured in etc bluetooth hcid conf is 1234 4 pand listen role NAP 5 after the client has connected the bnep0 must be also set up To connect to the OpenRISC from MS Windows use the on board tools or the software supplied with the Bluetooth device For the on board tools 1 select Join a Personal Area Network 2 search for the OpenRISC 3 select it and try to connect Enter 1234 as passkey 4 configure the network interface 5 3 Telnet The telnet console can be accessed with following command telnet ip address This connection can be used only for normal users not for the super user To execute super user commands login as user and then execute su For further information see man telnetd or man issue net 5 4 SSH To access the OpenRISC via SSH from Linux execute ssh ip address To access OpenRISC via SSH from Windows you need a ssh client such as PuTTY 9 To exchange files several tools could be used e scp Linux secure copy tool 29http www chiark greenend org uk sgtatham putty April 2010 OpenRISC User Manual 26 5 Network Services and Tools Provided by OpenRISC e pscp Windows secure copy tool included in PuTTY distribution e WinSCP5 Windows secure copy tool with graphical interface For further information see man sshd 5 5 FTP OpenRISC provides vsftpd as FTP server The files to be share
11. bootdir with other computers on the network File Folder i f Date Modified Today May 03 lt 2 2007 2 47 PM Cancel Apply a Shared Folder Properties bootdir Que O 2 serh rods E address D shared foldersibootdir File and Folder Tasks 2 kparam zImage 7 Make a new folder Publish this Folder to the Web Share this Folder b Boot Image Files Figure 20 Windows Share 10 2 Starting Debian Installer Exit BIOS and save changes if required Press Tab to access bootlist and choose USB Mass Storage Device see Figure 21 a or Network see Figure 21 b The Installer will be put into low memory mode see Figure 22 Press Enter and choose your country in the next dialog lel Parameter a Mass storage b Windows share Figure 21 Bootlist April 2010 OpenRISC User Manual 53 10 Debian Installation Figure 22 Low Memory Mode 10 3 Choosing CD ROM Debian Installer will try to find a device driver for your USB CD ROM This could fail as for Debian Etch installer To select the device manually answer with No see Figure 23 In the second dialog say Yes to manually select your CD ROM module In the third dialog select none In the fourth dialog press Enter to select dev cdrom device file to access the CD ROM The Debian Installer will now scan your CD ROM Figure 23 Detect and mount CD ROM 10 4 Lo
12. dev sda dev sdb etc If CF card is attached to IDE channel then CF card could be found under dev hdx for example dev hda dev hdb etc Please note that the system images provided on the DVD Software are complete images of a CF microSD card not of the single partition and must be applied to the device like dev sda and not dev sda1 For the example below it will be assumed that DVD Software is mounted to mnt the CF microSD card is assigned to dev sda device and the system image is 27032008_etch_complete bin su mount dev cdrom mnt exit dd if mnt images 27032008_etch_complete bin of dev sda bs 4096 To create an image from the CF microSD card execute following dd if dev sda of home user image bin April 2010 OpenRISC User Manual 70 D Eclipse D Eclipse D 1 Installation Notes Eclipse is an open source community whose projects are focused on building an extensible develop ment platform runtimes and application frameworks for building deploying and managing software across the entire software life cycle In Debian run apt get install eclipse to install it Additionally you ll need to download and install Java 2 SDK or Java 2 JRE from Sun Microsystems It can happen that Eclipse doesn t find Java binary in this case execute eclipse vm java To get working with C projects you ll need the CDT and Embedded CDT plug ins to compile and debug your software for the OpenRISC If you d like
13. e kparam kernel parameter The OpenRISC BIOS refer to Section 9 is searching for these files to boot the system from an external medium Mass storage devices network etc Due to the fact that USB devices need more time to be detected it is recommended to increase the Start Timeout value to at least 5 seconds refer to 9 5 The kernel parameter will be described below root parameter tells kernel from where to take the root filesystem If this parameter is not supplied BIOS defines it using the device name containing zImage So if root filesystem is on the same device partition as the kernel it is recommended not to define root parameter Example Specifying root dev hda1 will mount dev hda1 as root filesystem Specifying root dev sda1 will mount dev sdal as root filesystem If CF card is inserted into the internal CF Slot and kparam doesn t supply root parameter dev hda1 will be mounted as root filesystem rootwait parameter tells kernel to wait till root device appears This is important for booting from USB devices because they will be detected much later than CF This parameter is integrated into BIOS since version 2 0 mem parameter defines the amount of RAM that kernel can use This parameter is integrated into BIOS since version 2 1 but it can be overridden in the kparam 5http www debian org ports arm since BIOS version 2 1 April 2010 OpenRISC User Manual 15 4 Software Configuration 4 2 Swappi
14. including but not limited to its particular purpose Vision Systems reserves the right to make improvements and or changes to this manual or to the products and or the programs described in this manual at any time Information provided in this manual is intended to be accurate and reliable However Vision Systems assumes no responsibility for its use or for any infringements on the rights of third parties that may result from its use This product might include unintentional technical or typographical errors Changes are period ically made to the information herein to correct such errors and these changes are incorporated into new editions of the publication April 2010 OpenRISC User Manual 2 Contents Contents 1 Introduction 7 2 Getting Started 9 21 Connect to OpenRISC via Serial Link lt e p ee e ni 9 Ze Terminal Type sek ei aca a we Ae eo EY ee ae ee ee A ee 9 23 Configure Network 2 6 cesa ef ea a ae ee ee ee 10 SA Dilart Proeramiming o 6 ene Li ea ee Rd ee ee GW AE 11 3 Hardware Configuration 13 li Poter DUI ua ek ee E A ee ee 13 o ee Be ee eee eee be ee Bee ee PO eo nei ee 13 Sala WLAN ANDE ca ee eS e Se ee Ww Eee Dee A 13 3 38 WLAN Connemrabl6d cei eee ea a 13 CI SA FAD Gules OS ON eek Gee 13 da Lera soa Eee i we cae ee ae A A Gi we mee ee Rd e GNU ee A RG 13 3 4 RS422 485 Electrical Configuration FFF UR 14 3 4 1 Termination Resistors I GI ee 14 42 B
15. is again possible This functionality will be managed by wland service running on start up The source code for wland service is available via our svn repository at http svn visionsystems de 5 2 Bluetooth Support The Bluetooth support is already integrated in the kernel To use a USB Bluetooth adapter you ll need to install some additional software apt get install bluetooth To connect to the Bluetooth network access point NAP execute 1 hcitool scan you ll get the list of available Bluetooth devices with their addresses 2 select the needed one and connect to it pand c lt bdaddr gt 3 check var log daemon log to verify that the connection is established or execute ifconfig a if you can see bnep0 interface the connection is definitely established 4 set up the bnepo interface For example ifconfig bnep0 192 168 10 1 5 assuming the NAP has an address 192 168 10 2 try to ping it ping 192 168 10 2 April 2010 OpenRISC User Manual 25 5 Network Services and Tools Provided by OpenRISC To set up the NAP execute 1 edit etc bluetooth hcid conf and set the security option to auto Security Manager mode none Security manager disabled auto Use local PIN for incoming connections user Always ask user for a PIN security auto 2 execute etc init d bluetooth restart to activate the new configuration 3 hciconfig hci0 piscan lm master to enable authentication required by MS Windows execute
16. 1 user user user user user user user user user user user user user user user user user user user user user user user user user user user user user user user user 349 Aug 27 14 32 CMakeLists txt 392 Aug 27 14 57 Makefile 68577 Aug 27 17 12 ioctls 8865 Aug 27 14 54 ioctls c 8568 Aug 27 17 12 ioctls strip 91036 Aug 27 17 12 ioctls2 3097 Aug 14 14 01 ioctls2 c 5352 Aug 27 17 12 ioctls2 strip 93286 Aug 27 17 12 rawsrv 5682 Aug 14 14 01 rawsrv c 8720 Aug 27 17 12 rawsrv strip 50619 Aug 14 14 01 vsopenrisc doxyfile 2243 Aug 27 14 50 vsopenrisc h 61988 Jul 24 05 44 wdtimer 1042 Aug 14 2008 wdtimer c 3868 Jul 24 05 44 wdtimer strip Figure 1 Compilation example April 2010 OpenRISC User Manual 12 3 Hardware Configuration 3 Hardware Configuration 3 1 Power Supply The OpenRISC device is powered by a single 9 30V power supply A suitable power supply adapter is part of the packaging Connect the cable to the power jack at the right side of OpenRISC and put the adapter into the socket The Power LED on OpenRISC red will light You can connect a power supply of your choice providing the technical requirements are met 3 2 Network The OpenRISC can use all three network interfaces Ethernet and WLAN independently The default IP addresses are e 192 168 254 254 for eth0 first network interface e 192 168 253 254 for ethl second network interface e 192 168 127 254 for wlan0 w
17. 33 Software selection At the moment only the core of the system is installed To tune the system to your needs you can choose to install one or more of the following predefined collections of software Choose software to install lt Continue gt Figure 33 Software Selection April 2010 OpenRISC User Manual 58 10 Debian Installation 10 11 Finish the Installation Due to the lack of the official support by Debian there is no boot loader see Figure 34 After reboot enter BIOS and go to the console Mount the first partition mount dev hdal mnt Copy zImage either from your host or USB mass storage device into the boot directory and execute echo mem 59M root dev hdai gt boot kparam Exit BIOS and enter the bootlist by pressing Tab You can now boot from dev hda1 To enable the console port edit etc inittab so that tty1 tty6 are commented and console is configured for 115200bps Note that on most Debian systems tty7 is used by the X Window System so if you want to add more getty s go ahead but skip tty7 if you run X 1 2345 respawn sbin getty 38400 tty1 2 23 respawn sbin getty 38400 tty2 3 23 respawn sbin getty 38400 tty3 4 23 respawn sbin getty 38400 tty4 5 23 respawn sbin getty 38400 tty5 6 23 respawn sbin getty 38400 tty6 Example how to put a getty on a serial line for a terminal T0 2345 respawn sbin getty L con
18. 36 GPIO CMD SET LED GREEN 36 GPIO_CMD SET LED POWER 36 GPIO_CMD_ SET LEDS 36 Greenwich Mean Time GMT 17 GUI 23 HTTP 21 hwtest 51 62 I2C 40 IMAP 21 Insight 33 ioctls c 34 ioctls2 c 34 Java 71 JRE 71 LDAP 21 LEDs 36 LinCAN 39 Mail Server 21 MicroDrive 13 NAP 25 netcat 19 74 NES 28 NTP 21 poll 35 POP3 21 Real Time Clock RTC 65 RedBoot 14 resolv conf 10 Samba 27 32 45 select 35 services 16 socat 19 sredird 22 Index SSH 26 SSL 20 Subclipse 71 Subversion 30 swap 16 18 syslog 16 telnet 26 TERM 9 TIOCGEPLD 36 TIOCSEPLD 36 udev 17 Universal Time Coordinated UTC 17 Vim 30 vsimgtool 15 69 74 vsopenrisc h 34 vt100 9 Watchdog Timer WDT 40 WEP 24 WindowMaker 23 WLAN 24 wland 25 41 WPA 24 WPA2 24 wpa_supplicant 24 X Server 23 X Window 23 X11 23 Xming 23 April 2010 OpenRISC User Manual 76
19. 64MB SDRAM 64MB SDRAM 64MB SDRAM Flash Memory on Board 4MB 4MB 4MB Serial Interfaces 2 x RS232 RS422 RS485 1 x RS232 RS422 RS485 2 x RS232 RS422 RS485 2 x RS232 only CAN Interface on board 1x Digital I O channels 8 x I O channels 8 x I O channels 4 x I O channels 2 x Relays 2 x optically isolated inputs CF Slot True IDE mode 1 x also accepts MicroDrives 1 x also accepts MicroDrives 1 x also accepts MicroDrives microSD Slot 1 x internal slot 1 x internal slot 1 x internal slot USB 2 x USB 2 0 as Host 2 x USB 2 0 as Host 2 x USB 2 0 as Host Expansion Slot MiniPCI slot MiniPCI slot MiniPCI slot Ethernet 2x 5 x WAN and 4 x LAN switch 2 x PC bus 1x 1x 1x RTC 1x 1x 1x Watchdog Timer 1x 1x 1x WLAN On Off Button 1 Table 1 OpenRISC Products Comparison I uoi32npoJ3u 2 Getting Started 2 Getting Started 2 1 Connect to OpenRISC via Serial Link Connect the OpenRISC to the serial port of your PC and start a terminal software HyperTerminal ZOC minicom etc with 115200 8 n 1 settings no hardware software handshake is needed Set the terminal type according to Section 2 2 Insert a CF microSD card with one of the preinstalled systems refer to Section 4 Power your OpenRISC according to Section 3 1 You ll see Linux booting After the boot procedure you ll be asked to log in Two users are already added
20. Cross compile your software on the PC For more convenience you can also use a PC with Linux running on it This can be either a directly installed Linux or Linux running in a virtual machine for Windows users For the compilation of your own applications outside of the OpenRISC you ll need a cross compiler 3 for the ARM platform You ll find one on the DVD Software Depending on your Debian version you ll need the appropriate version 1 toolchain gcc 4 2 2 libc 2 3 6 tar bz2 for Debian 4 0 Etch 2 arm linux gcc 4 3 2 gnueabi tar bz2 for Debian 5 0 Lenny Please decompress one of these archives into the opt directory of your PC To install the toolchain for Debian 4 0 execute su mount dev cdrom mnt cd opt tar xvjf mnt development toolchain_gcc 4 2 2_libc 2 3 6 tar bz2 Add opt arm linux gcc 4 2 2 bin to your PATH environment variable export PATH opt arm linux gcc 4 2 2 bin PATH Following utilities prepent with arm linux will be available after extracting the files from the archive refer to Table 12 Warning please note that your software compiled for Debian 4 0 Etch can t be executed on Debian 5 0 Lenny without recompilation due to new ABI 32You can use free VM Software like VMWare Player www vmware com or VirtualBox www virtualbox org 33See http en wikipedia org wiki Cross compile for explanation 3 E ABI http en wikipedia org wiki EABI interface is mandatory for new Debian versions
21. Debian 5 0 is the last version where you can choose between old ABI and EABI The next version will be based only on the new interface April 2010 OpenRISC User Manual 29 6 Software Development 6 1 3 Integrated Development Environment For an Integrated Development Environment IDE following programs can be used e Eclipse www eclipse org See Appendix D for installation and configuration notes e Vim www vim org e many more For ease of creating Makefiles the CMake utility can be used For that purpose the CMakeLists txt file was added to the examples directory After installing CMake on your OpenRISC directly or on your development host execute cd home user examples cmake After that the Makefile is created This Makefile has the same targets as the original one 6 2 Linux Kernel The OpenRISC uses 2 6 series Linux kernel The source code for one of thess kernels can be obtained both from DVD Software and from Subversion repository at http svn visionsystems de For the kernel archive on DVD execute su mount dev cdrom mnt exit cd home user projects tar xvjf mnt development linux 2 6 26 ks8695 tar bz2 To check out the repository to your development host execute svn co svn svn visionsystems de linux 2 6 26 ks8695 trunk linux 2 6 26 ks8695 trunk After extracting the kernel sources from the archive or checking out the repository execute cd linux 2 6 26 ks8695 trunk to get to the kern
22. Figure 4 Kernel Configuration Menu April 2010 OpenRISC User Manual 31 6 Software Development 6 3 Programming Examples Repository Some programming examples were prepared to show test the abilities of OpenRISC hardware The latest version of this software can be obtained from our repository by executing the following command svn co svn svn visionsystems de OpenRISC_Software trunk OpenRISC_Software trunk This repository contains three folders e examples some basic programming examples as described in Section 2 4 e hwtest Hardware Test Utility enables the testing of OpenRISC peripherals see Section B e installation this folder provides files needed for Debian installation as described in Section 10 6 4 Setup Shared Source Directory To avoid permanent copying the compiled files you can share the examples folder on your PC via Samba Assuming your PC has the IP address 192 168 254 253 and a valid user like user from group user registered in the Samba server do e On the PC side cd home user mkdir openrisc_examples copy all files from examples folder to openrisc_examples edit as su etc samba smb conf Add the openrisc share openrisc comment OpenRISC programming examples path home user openrisc_examples browsable yes writable yes valid users user etc init d samba restart e On the OpenRISC login as user mkdir openrisc_examples su mount t ci
23. across network connections using the TCP IP protocol It is designed to be a reliable back end tool that can be used directly or easily driven by other programs and scripts At the same time it is a feature rich network debugging and exploration tool since it can create almost any kind of connection you would need and has several interesting built in capabilities 4 7 4 Socat socat is a relay for bidirectional data transfer between two independent data channels Each of these data channels may be a file pipe device serial line etc or a pseudo terminal a socket UNIX IP4 IP6 raw UDP TCP an SSL socket proxy CONNECT connection a file descriptor stdin etc the GNU line editor readline a program or a combination of two of these These modes include generation of listening sockets named pipes and pseudo terminals 4 7 5 Samba Samba is an Open Source Free Software suite that has since 1992 provided file and print ser vices to all manner of SMB CIFS clients including the numerous versions of Microsoft Windows operating systems Samba is freely available under the GNU General Public License To share an extra directory for users create this directory mkdir samba Edit etc samba smb conf global l4http gcc gnu org gccmission html l5http netcat sourceforge net l http www dest unreach org socat hnttp us3 samba org samba April 2010 OpenRISC User Manual 19 4 Software Configuration
24. create a user adduser ingroup users testuser login as testuser cd home testuser maildirmake Maildir this creates user s maildir folder structure Execute webmail tool https mail server address cgi bin sqwebmail and log on From now on one can send and receive e mails 4 7 8 NTP NTP is a protocol designed to synchronize the clocks of computers over a network to a common timebase usually UTC Configuration Client For client configuration edit etc ntp conf as follows client etc ntp conf driftfile var lib ntp ntp drift NTP server in LAN server 192 168 1 1 Grant access from other NTP server restrict 192 168 1 1 Grant access from localhost ntpq p restrict 127 0 0 1 deny access for other peers 1 http www courier mta org 20http www ntp org April 2010 OpenRISC User Manual 21 4 Software Configuration restrict default notrust nomodify nopeer HHHHHHH HH HHH HERRERA Then restart ntpd Configuration Server For server configuration edit etc ntp conf as follows server etc ntp conf driftfile var lib ntp ntp drift NTP server server ptbtimel ptb de server ptbtime2 ptb de Grant access from other NTP server restrict ptbtimel ptb de restrict ptbtime2 ptb de Grant access from localhost ntpq p restrict 127 0 0 1 grant access for local network restrict 192 168 1 0 mask 255 255 255 0 deny access for other
25. if ioctl fd TIOCGSERIAL amp ss_st lt 0 perror TIOCGSERIAL return 1 ss_st custom_ divisor 500000 ss_st flags ASYNC_SPD_CUST if ioctl fd TIOCSSERIAL amp ss_st lt 0 perror TIOCSSERIAL return 1 set baud rate to 38400bit s to activate custom divisor ret tcgetattr fd amp ser_termios if ret lt 0 perror getattr return 1 ret cfsetispeed amp ser_termios B38400 if ret lt 0 perror ispeed return 1 ret cfsetospeed amp ser_termios B38400 if ret lt 0 perror ospeed return 1 ret tcsetattr fd TCSANOW amp ser_termios if ret lt 0 perror getattr return 1 close fd return 0 Every time the baud rate will be changed a special baud rate generation function will be invoked in the serial driver drivers char serial c namely serial16C950_get_divisors This routine calculates appropriate values for the clock prescaler register CPR times clock register TCR and 16 bit divisor supported by 16C950 UART If the routine couldn t find the appropriate values the baud rate 9600bit s will be set To disable this functionality comment the following definition in drivers char serial c define ENABLE 160950 BAUD GENERATION FEATURES April 2010 OpenRISC User Manual 38 IO DAWN 7 OpenRISC Hardware API 7 5 CAN The OpenRISC Alena has an integrated CAN interface based on th
26. peers restrict default notrust nomodify nopeer HHHHHHH HH HHA Raa A Then restart ntpd 4 7 9 sredird Sredird is a serial port redirector that is compliant with the RFC 221777 Telnet Com Port Control Option protocol This protocol lets you share a serial port through the network Configuration sredird runs only under inetd To configure inetd two files must be edited e the following line must be appended to etc inetd conf to share dev ttyS1 sredir stream tcp nowait root usr sbin tcpd usr sbin sredird i 5 dev ttyS1 var lock LCK ttyS1 e sredir service must be defined in etc services sredir 7051 tcp Four serial ports dev ttyS1 dev ttyS4 have been already configured in etc inetd conf and etc services ports 7051 7054 Following clients could be used with sredird e Serial IP COM Port Redirector http www tacticalsoftware com products serialip htm for Windows Clients e cyclades serial client http freshmeat net projects cyclades serial client for Linux Clients 1 http freshmeat net projects sredird 22http www rfc editor org rfc rfc2217 txt 2 port 7051 is an example port number April 2010 OpenRISC User Manual 22 4 Software Configuration 4 7 10 WindowMaker Window Maker is an X11 window manager originally designed to provide integration support for the GNUstep Desktop Environment In every way possible it reproduces the elegant look and feel of the NEXTSTEP tm u
27. sblock 200 rtscts executes the serial test for default on board serial interfaces dev ttyS1 and dev ttyS2 using hardware handshake and write block size of 200 bytes hwtest cycles 1 size 4096 serial seri dev ttyS1 sero dev ttyUSB0 executes the serial test using a USB to Serial adapter based on the FTDI chip B 4 GPIO Test The GPIO test module consists of following tests e IO test will be activated with io option e poll select and interrupt functionality test will be activated with po11 option e buzzer test will be activated with buz option e LEDs test will be activated with led option April 2010 OpenRISC User Manual 64 B Hardware Test Utility hwtest The I O pins must be connected with each other for the IO test using 4 7k resistors for example see Table 9 The optical isolated input channels will be connected to relays by Alena without any resistors see Table 10 1100 DIOL 1102 DIO3 DIO2 DIO3 DIO4 DIOS DIO4 DIO5 DIO6 DIO7 Table 9 I O Pin Connections for Alekto left and Alena right DIO G DO6 B DIO S DO6 C DH G gt DOT B 1115 DO7 C Table 10 Optically Isolated Input Channels and Relays Usage examples hwtest cycles 1 gpio io poll buz led mode fint executes the complete GPIO test in full interactive mode hwtest cycles 1 gpio io executes only the IO test in userless mode B 5 CompactFlash Test The CompactFlash
28. to checkout Kernel or examples from our Subversion repository use doxygen etc you could also find these plug ins as useful e Subclipse subclipse tigris org e Eclox home gna org eclox e Gengetopt Eclipse ggoeclipse sourceforge net e CMake Editor www cthing com CMakeEd asp 59java sun com javase 60 planeteclipse net cdt 81 www zylin com embeddedcdt html April 2010 OpenRISC User Manual 71 D Eclipse D 2 Debugging Assuming your OpenRISC has IP address 192 168 1 66 Start your ioctls executable on the OpenRISC with following command gdbserver 9000 ioctls On the PC side open examples project the project and cdtproject file are already created Select Run gt Debug Double click Embedded debug Native After that you ll get new configuration entry select the project corresponding to yours see Figure 38 select C C Application to ioctls choose Debugger tab see Figure 39 GDB debugger arm linux gdb choose Commands tab see Figure 40 Initialize commands target remote 192 168 1 66 9000 Run commands c Apply Debug Debug x Create manage and run configurations S sex ep Name ioctls_remote type filter text z gt OUTTA Debugger IM Commands fy Source D common E c C Attach to Local Application E c C Local Application Project E C C Postmortem debugger ibox_exam Browse 9 Eclipse Application C C Application
29. A MER 49 16 BIOS Update lige gt i ER wed Y WU RA E R AR FD EU ha 49 17 BIOS Update Reboot Systemi Lilli i GR E a 49 18 BIOS Update via Network sempr ecaa ipe dumpade a Kapaa 50 19 BIOS View Board Information lt lt lt 4 lt 51 20 Windows Glare c e co e caa a a E i 53 Sl BOIB oi ia bw bee a ea ar Be i OS Oe 53 22 Low Memory Mode o E aa eee ee 54 23 Detect and mount CD ROM GG lt 54 24 No Modules Found Warning o mop 54 25 Network Configuration 55 20 Proy Lonfleimalio s s e s se r a e a e i a a he ee el 55 27 Mirror CORSO lt 2 gie e e e da ee TE a ee NE 55 Poe a e A a lei a a A eed 56 20 Partitioning Method coco erat a e a 56 30 Partitioning Scheme spas ei ko ew A A ed 57 SL Partition Table Type e 65 2 oe RG eR Re ee WYR UEN 57 32 Partition Table so ss Bee SS ad eae a ol BW ae a ee 57 33 Software R lecHOM lt oa pee CE ed Re ke adani ER SO e Bw he bs 58 34 Continue without Boot Loader a agoa a matane p 59 35 Serial Test Cable Wittig LL ss OE eRe a a He a Rd 64 36 Dloditied USB cable 4 04 OR PR eee RR ROF ae PR Ree WR EG 67 07 Special Board tor GPIO Testas poa s mop e eye RR e 67 oo Eclipse debus Maim tab ea mi 72 39 Eclipse debug Debugger
30. CCMP TKIP group CCMP TKIP psk xxxxxxxxxxxxxx Listing 2 etc wpa_supplicant conf WLAN interface is automatically configured on system s startup see Section 2 3 To test the configuration just run etc init d networking restart Wpa_ supplicant can also be called manually to investigate configuration problems 8http hostap epitest fi wpa_supplicant April 2010 OpenRISC User Manual 24 5 Network Services and Tools Provided by OpenRISC wpa_supplicant iwlan0 c etc wpa_supplicant conf dd Dwext Further information about configuring the WLAN interface can be taken from wpa_ supplicant s manual page man wpa_supplicant 5 1 2 Ad hoc Wireless Network wireless tools To connect to another node with SSID Nodel not using encryption execute following com mands ifconfig wlan0 down iwconfig wlan0 mode ad hoc key off essid Nodei ifconfig wlan0 up For WEP encrypted connection ifconfig wlan0 down iwconfig wlan0 mode ad hoc key restricted key 1 some WEP key essid Nodel ifconfig wlan0 up 5 1 3 WLAN On Off Button Alekto LAN only OpenRISC Alekto LAN provides a special button to enable disable the WLAN adapter Pressing the button will result in button LED going off and WLAN transmit power turning off so no communication via WLAN is possible Pressing the button for the second time will result in button LED going on and WLAN transmit power returning to the previous value so WLAN data transfer
31. CTL FLAG ERR WARNING 1 lt lt 2 define CAN IOCTL FLAG DATA OVERRUN 1 lt lt 3 define CAN IOCTL FLAG UNUSED 1 lt lt 4 define CAN IOCTL FLAG ERR PASSIVE 1 lt lt 5 define CAN IOCTL FLAG ARBIT LOST 1 lt lt 6 define CAN _IOCIL FLAG BUS ERROR 1 lt lt 7 Listing 6 CAN Status Register Values See hwtest module_can c for usage example 44 45 www can cia org www canfestival org 4Shttp sourceforge net projects ocera April 2010 OpenRISC User Manual 39 7 OpenRISC Hardware API 7 6 Watchdog Timer The OpenRISC provides a watchdog timer WDT that can work in intervals from 1 second to maximal 171 seconds The access to the WDT occurs via dev watchdog device After starting the WDT it should be turned off or reloaded after the critical part otherwise the system will reboot Table 5 shows the most important IOCTLs to control WDT IOCTL Description WDIOC_SETTIMEOUT set timeout and start the timer WDIOC_GETTIMEOUT get timeout WDIOC_SETOPTIONS enable WDIOS_ENABLECARD disable WDIOS_DISABLECARD the timer WDIOC_KEEPALIVE reload the timer Table 5 Watchdog Timer IOCTLs The WDT driver provides a special option called Disable watchdog shutdown on close to prevent stopping the timer on WDT descriptor close see Figure 6 This is a compile time option It is deactivated by default so you have to build your own kernel if you need it A Watchdog Timer Suppor
32. Configure Network Parameter April 2010 OpenRISC User Manual 46 9 BIOS 9 5 Configure Miscellaneous Parameter Following parameters can be set up here see Figure 13 e Date e Time e Start Timeout the time in seconds during that the BIOS or bootlist could be accessed e Terminal Type Console Telnet emulation type to choose by terminal software such as Hyperterminal ZOC etc while connecting via serial link or telnet The OpenRISC can emulate three types of terminals Linux ANSI VT100 e Password BIOS protecting password Start Timeout Terminal Type C Terminal Type Telnet VT100 Pe 1 Figure 13 BIOS Configure Miscellaneous Parameter for devices with internal microSD card reader the timeout should be set to at least 5 seconds April 2010 OpenRISC User Manual 47 9 BIOS 9 6 Edit Bootscript The bootscript can be edited here see Figure 14 bin sh Insert your own bootscript here It s called on every automatic startup not in the bootmenu E ti id tt SF SE id var bootscript line 1 of 3 33 Figure 14 BIOS Edit Bootscript April 2010 OpenRISC User Manual 48 9 BIOS 9 7 BIOS Update BIOS update can be done either via serial connection or via network connection a Update prompt b Waiting for data Figure 15 BIOS Update Update procedure via serial connection In the dialog shown in Figure 15 a choose O
33. LAS Function 2 se ria nela pre E ORA TR 14 3 5 Internal Flash Write Protection LL Ree ew eS 14 4 Software Configuration 15 41 Booting from CFAMIOSD iii CWRDD DO UU UR he ew a eas 15 42 Swapping and L gne o s seppi aa eee ee aD 16 4 3 Activating and Deactivating Services Fu uu 16 Lol E a ew nee Ee e kee ee He e 17 do BONG oso ee E A BS ee ee OR He a a 17 4 6 Create Swap File ee ae ke ee Ae Ew a 18 4 7 Complete System Imago A ee 18 4 7 1 Program Overview cocos oa A 18 A O tance os So et HA Sok we A OS OS 19 gt Nat Ln i 19 ATA BOO TT n RA E EA AE a A 19 AT Sampa o LL e ta Qe e RE A I n 19 ATO Web apices 2h sce dok e e A ee Re NR 20 ATT AI 21 de DI e Pe e e et e es Sk Re 21 LIA ea a a n we i eS 22 ATi WindowMaker e a BA NN e nh 23 4 7 11 Connecting to X Window is si sacia e ee 23 a AbiWord a RO Se wwe PE Oe eB wee Ee ew 23 5 Network Services and Tools Provided by OpenRISC 24 il WLAN Gen IN cia Re Oe te n 24 5 1 1 Managed Wireless Network Wpa_ supplicant o 24 5 1 2 Ad hoc Wireless Network wireless tools o o 25 5 1 3 WLAN On Off Button Alekto LAN only 25 Das eth puote KA RARE e a ER a 25 April 2010 OpenRISC User Manual 3 Contents o TE i AR I I e e 26 li per la n ee ee a E oo ee O FEN 26 Det KIEL ai oe ee e al a DDU eh ee eB ENG 27 BO ther Possible F
34. R_FRQ get set the modulated signal de lay So that the buzzer will be turned on for the delay specified and the it will be turned off for the same delay and so on till this mode will be turned off reflected in proc vsopenrisc buzzer_frq April 2010 OpenRISC User Manual 35 7 OpenRISC Hardware API 7 3 LEDs The OpenRISC provides three configurable LEDs e red LED power LED e blue LED can be used to signal WLAN link e green LED user LED e WLAN button LED OpenRISC Alekto LAN only Following IOCTL commands are defined in the vsopenrisc h to control the LEDs GPIO_CMD_GET_LEDS GPIO_CMD_SET_LEDS get set LED combination reflected in proc vsopenrisc leds e GPIO_CMD_SET_LED_POWER turn on off the power LED e GPIO_CMD_SET_LED_BLUE turn on off the blue LED e GPIO_CMD_SET_LED_GREEN turn on off the green LED e GPIO_CMD_SET_LED_BTN_WLAN turn on off the WLAN button LED OpenRISC Alekto LAN only 7 4 Serial Interfaces RS232 422 485 mode switching The serial ports can operate in one of the three modes RS232 RS422 or RS485 see Section 3 4 for electrical configuration issues These modes will be controlled through the EPLD circuit Following commands are be used to switch the modes e TIOCGEPLD get EPLD mode e TIOCSEPLD set EPLD mode These commands use the following structure to store the desired parameters struct epld_ struct unsigned long port unsigned long reg_ shift unsigned long v
35. S485 For ease of installations the OpenRISC provides these functions for often used parameters They are activated by placing certain jumpers see Table 2 internal of the OpenRISC There is one block of jumpers see Figure 2 for each serial port JP5 for Port 1 and JP6 for Port 2 Place a connection cap to activate the function Warning All jumpers are unconnected by default This is important for use in RS232 mode Never close any jumper otherwise communication errors or damage of devices is possible Pins Function of Signals 1 2 Place 1200 to terminate Tx Data in RS485 2 wire 3 4 Add BIASing function to Tx 5 6 mostly required for RS485 2 wire modes 7 8 Place 1200 to terminate Rx 9 10 Add BIASing function to Rx 11 12 Add BIASing function to Rx Table 2 RS422 485 Jumper Configuration 3 4 1 Termination Resistors The use of long communication lines in RS422 and RS485 mode require the installation of termination resistors These must match the impedance of the cable Typical cables in Twisted Pair configuration have an impedance around 1200 In RS422 this resistor has to be placed at the far end from the sender in RS485 the typical configuration requires one resistor at each end of the cable 3 4 2 BIAS Function RS485 requires a BIAS option for the communication lines This will guarantee stable electrical levels on the cables even at times when no stat
36. ad Installer Components from CD First you ll see a dialog with the statement that the kernel modules were not found see Figure 24 It is due to the issue that all needed modules were compiled into the kernel So answer with Yes Additional components will be loaded Figure 24 No Modules Found Warning April 2010 OpenRISC User Manual 54 10 Debian Installation 10 5 Network Configuration In the next dialog the network configuration will be executed see Figure 25 Choose the network interface to which the Ethernet cable is connected to In the next two dialogs enter host and domain names Figure 25 Network configuration In the case of network installation you ll be asked to configure package mirror as in Figures 26 and 27 Figure 26 Proxy Configuration Figure 27 Mirror Configuration April 2010 OpenRISC User Manual 55 10 Debian Installation 10 6 Partition Disks After scanning your target storage media you ll be asked to continue with partitioning see Figure 28 Answer with Yes In the second dialog select Guided use entire disk as in Figure 29 Figure 28 Partition Disks Figure 29 Partitioning Method In the next dialog confirm your target disk and then select All files in one partition scheme as in Figure 30 Select msdos for partition table type as in Figure 31 You ll get the following partition table as in Figure 32 It is very important that you leav
37. alue y The field value can have one of the following values e EPLD_RS232 RS232 mode e EPLD_RS422 RS422 mode e EPLD_RS485_ART_4W RS485 mode 4 wire transmit control by ART e EPLD_RS485_ART_2W RS485 mode 2 wire direction control by ART e EPLD_RS485_ART_ECHO RS485 mode 2 wire direction control by ART with echo 43See include asm arch serial h to see what EPLD capabilities each port has April 2010 OpenRISC User Manual 36 ANoowkwner 7 OpenRISC Hardware API e EPLD_RS485_RTS_4W RS485 mode 4 wire transmit control by RTS e EPLD_RS485_RTS_2W RS485 mode 2 wire direction control by RTS e EPLD_RS485_RTS_ECHO RS485 mode 2 wire direction control by RTS with echo e EPLD_CAN CAN mode e EPLD_PORTOFF shutdown the port RS485 transmission control In RS485 the line driver for transmitting must be disabled tri stated when the device does not send data In a 2 wire configuration this is known as data direction change with 4 wire it is called line contention The following modes are provided by OpenRISC e RTS if this mode is set user software is responsible to turn transmitter on off by toggling the RTS signal RTS 1 turns sender on RTS 0 turns sender off e ART Automatic Receive Transmit The sender will be automatically turned on off by hardware The turning off occurs after the stop bit was sent recommended mode RS485 receive control There are two modes to handle own transmitted messages in 2 wire mode
38. below define GPIO_BIT_0 0x01 DIOO or optically isolated input define GPIO_BIT_1 0x02 DIO1 or optically isolated input define GPIO BIT 2 0x04 DIO2 define GPIO_BIT_3 0x08 DIO3 define GPIO_BIT_4 0x10 DIO4 define GPIO BIT_5 0x20 DIO5 define GPIO_BIT 6 0x40 DIO6 or relay define GPIO_BIT_7 0x80 DIO7 or relay struct gpio_struct unsigned long mask bits to modify unsigned long value value to set y Listing 4 GPIO struct The following Listing shows how to change pins DIOO and DIO2 to output and then read the control register back To change the register direction struct gpio_struct is used because you need to specify what bits are going to changed and to what values Lines 5 6 To read the register you only need to give unsigned long variable to the IOCTL command Line 9 struct gpio_struct gpio_ val unsigned long val gpio_val mask GPIO_BIT_0 GPIO_BIT_2 gpio_val value GPIO BIT 0 GPIO_BIT_2 ioctl fd GPIO CMD SET CTRL amp gpio_val ioctl fd GPIO CMD GET CTRL amp val Listing 5 GPIO usage Example 7 2 Buzzer The OpenRISC provides a buzzer for acoustic signaling You can manipulate it via the IOCTL calls or via the Proc Filesystem Following IOCTL commands are defined in the vsopenrisc h to control the buzzer e GPIO_CMD_GET_BUZZER GPIO_CMD_SET_BUZZER turn on off the buzzer reflected in proc vsopenrisc buzzer GPIO_CMD_GET_BUZZER_FRQ GPIO_CMD_SET_BUZZE
39. c tool chain and vim tiny text editor Besides development tasks this image is designed to use the OpenRISC as a server and or desktop system to accomplish such tasks as mail server web server resource sharing and office tasks For the latter WindowMaker is installed to provide graphical desktop on the OpenRISC 4 7 1 Program Overview The complete image provides among others the following utilities e Software Development gcc vim tiny e Network ssh server and client telnet server and client vsftpd server and client netcat socat Samba client and server Apache2 web server Courier mail server NTP client and server sredird RFC2217 server April 2010 OpenRISC User Manual 18 4 Software Configuration e Desktop WindowMaker desktop xdm server AbiWord dillo or netsurf web browser 4 7 2 GCC GCC development is a part of the GNU Project aiming to improve the compiler used in the GNU system including the GNU Linux variant The GCC development effort uses an open development environment and supports many other platforms in order to foster a world class optimizing compiler to attract a larger team of developers to ensure that GCC and the GNU system work on multiple architectures and diverse environments and to more thoroughly test and extend the features of GCC 4 7 3 Netcat Netcat is a featured networking utility which reads and writes data
40. d for the presence of the WLAN card If the WLAN card is found the name of the chip will be printed After that the WLAN environment will be searched for available participants Usage example hwtest cycles 1 mpci executes the MiniPCI test B 3 Serial Test To test the serial port you will need a special null modem cable Following pinout will be used see Table 8 and Figure 35 without USB CAN connector April 2010 OpenRISC User Manual 63 B Hardware Test Utility hwtest TX gt RX RX gt TX RTS gt CTS RI CTS RI lt RTS DTR DSR CD DSR CD gt DTR GND GND Table 8 Serial Test Cable Wiring Figure 35 Serial Test Cable Wiring The test file will be transferred from the first interface to the other and vice versa This test can be also used to simultaneously test the serial and USB interfaces To do this you must connect the USB port with the serial one using a USB to Serial adapter based on the FTDI chip The serial test module has its own parameters seri and sero to configure the interfaces With the sblock parameter the serial write block size can be configured By default it is set to 64 bytes The rtscts option enables hardware handshake The modem option enables the test of the modem status pins Usage examples hwtest cycles 1 size 4096 serial seri dev ttyS1 sero dev ttyS2 executes the serial test for on board serial interfaces hwtest cycles 1 size 4096 serial
41. d must be placed in home ftp To access the files execute ftp ip address The FTP server is configured for normal user accounts created on the OpenRISC so login as user user with a password user For access via graphical FTP client following programs can be used e FileZilla http www filezilla de e Firefox with FireFTP add on http fireftp mozdev org help html For further information see man vsftpd 5 6 Other Possible Services Other services such as Samba see Section 4 7 5 or NFS could also be installed to share resources 5 6 1 Samba To install Samba execute apt get install samba To access your home directory from Windows you must register the user in Samba smbpasswd a user For further information see man samba 39http winscp net eng index php 3lpttp vsftpd beasts org April 2010 OpenRISC User Manual 27 5 Network Services and Tools Provided by OpenRISC 5 6 2 NFS To install the NFS server execute apt get install nfs kernel server For further information see man nfsd April 2010 OpenRISC User Manual 28 6 Software Development 6 Software Development 6 1 Environment 6 1 1 Compile your software directly on the OpenRISC You can start programming directly on the OpenRISC The toolchain is already installed and GCC compiler will be invoked in the same way it is done on a desktop Linux To modify files you can use vi or some other editor 6 1 2
42. e SJA1000 chip CAN bus can be accessed via several APIs e VSCAN API e LinCAN driver It is possible to use CANopen library from CanFestival with both APIs The CAN interface and the fourth serial interface are sharing the same connector When opening the CAN device the EPLD will be automatically switched to CAN mode After closing the device the former mode will be restored VSCAN API For VSCAN API see the VSCAN_Manual pdf LinCAN driver To write application using LinCAN driver you ll need two header files can h and canmsg h The dev can0 device must be opened in order to communicate with the driver In addition to the standard IOCTL commands GET_CAN_STATUS command was added to get drivers state see Listing 6 There are two LEDs to indicate CAN transfer status Data and Error Data LED indicates incoming and outgoing data transfer Error indicates one of the error states described in Listing 6 If bus error occurs Listing 6 Line 8 the Error LED lights permanently if any other error occurs Listing 6 Lines 1 7 Error LED will be flashing Bus error has the highest priority i e if it has occurred no matter in what state CAN was or what error happens as next the Error LED will light permanently Error LED will be turned off only when closing the port or reading the status via GET_CAN_STATUS IOCTL define CAN IOCTL FLAG RX FIFO FULL 1 lt lt 0 define CAN IOCTL FLAG TX FIFO FULL 1 lt lt 1 define CAN IO
43. e swap partition during the installation You can then change your partitions so you have only one partition and swap as a swap file see Section 4 6 Select Finish partitioning and write changes to disk In the next dialog select Yes to format both partitions After doing this select Finish partitioning and write changes to disk In the next dialog select Yes to format both partitions April 2010 OpenRISC User Manual 56 10 Debian Installation Figure 30 Partitioning Scheme Figure 31 Partition Table Type Figure 32 Partition Table April 2010 OpenRISC User Manual 57 10 Debian Installation 10 7 Setting Passwords After partitioning the disks and setting up the clock you ll be asked to set a password for root and create a new user 10 8 Install the Base System As the OpenRISC is not officially supported by Debian there is no kernel shipped with the distri bution Answer with Yes when you ll be asked to install without a kernel 10 9 Configure the Package Manager In the case of a CD ROM installer you ll be asked if you want to download and install updates from a network mirror The network mirror will be configured as described in Subsection 10 5 After configuring the package manager you ll be asked to participate in the package usage survey 10 10 Software Selection In this dialog you can select which component groups will be installed on your system see Figure
44. ed bit value 1 enables interrupt bit value O disables interrupt for the desired channel The physical driver operates with 32mA for both high and low level For digital I O usage four registers are provided e data register reflected in proc vsopenrisc gpio_data e data direction register reflected in proc vsopenrisc gpio_ctrl e interrupt mask register reflected in proc vsopenrisc gpio_irqmask e status register read only reflected in proc vsopenrisc gpio_change In addition the interrupts will be counted for each pin Following IOCTL commands are defined in vsopenrisc h to control digital I O e GPIO_CMD_GET GPIO_CMD_SET set get data register value e GPIO_CMD_GET_CTRL GPIO_CMD_SET_CTRL set get data direction register value e GPIO_CMD_GET_IRQMASK GPIO_CMD_SET_IRQMASK set get interrupt mask register value e GPIO_CMD_GET_CHANGE get status register value e GPIO_CMD_GET_CHANGES get interrupt count reflected in proc vsopenrisc gpio_changes 2CQpenRISC Alekto provides 8 digital I O channels only OpenRISC Alena provides 4 digital I O channels 2 optically isolated inputs and 2 relays April 2010 OpenRISC User Manual 34 BR oeoodo Ioa cm O No 7 OpenRISC Hardware API The digital I O driver also supports select and poll calls To use this functionality the interrupt must be enabled for the desired pins To change the register values special structure and macros will be used see the Listing
45. el Size 2012752 Version 2 1 Date 28 10 2008 D K Flashing image Type Cramdisk Size 1687552 Version 2 1 Date 28 10 2008 O K BIOS updated The system will be restarted Figure 18 BIOS Update via Network 5lon some systems netcat binary is called nc Windows version nc exe is provided on the DVD Software April 2010 OpenRISC User Manual 50 9 BIOS 9 8 View Board Information Shows some board information see Figure 19 Hardware Rev Serialnumber uction Date Flash Size 1 Flash Size 2 Memory Size Figure 19 BIOS View Board Information 9 9 Hardware Test The hwtest program will be invoked for one cycle with the parameters listed in Table 6 For detailed information about hwtest refer to Appendix B size 4096 modem cycles 1 sero dev ttyS1 confirm seri dev ttyS2 serial io net buz gpio led mpci sleep 1 cf testrtc i2c eplddev dev ttyS1 epld eplddev dev ttyS2 usb usbmntdev dev sdal Table 6 BIOS hwtest parameters 9 10 Default Parameter Sets all parameters to factory settings 9 11 Exit Leaves BIOS If any parameters were changed you ll be asked to save the changes April 2010 OpenRISC User Manual 51 10 Debian Installation 10 Debian Installation The installation of the Debian 5 0 3 Lenny will be described in this section The installation instructions for other Debian versions are similar with this one Your system s
46. elipe oos e aoe Ro e oe a ee ee e WW RAF RR 27 cal Sie oa aon ee Be al eh geet BR a eee ni 27 fb UP iis Gok Geb ote FN AF oe e na 28 6 Software Development 29 Bids e A e RA 29 6 1 1 Compile your software directly on the OpenRISC 29 6 1 2 Cross compile your software on the PC a 29 6 1 3 Integrated Development Environment 30 G2 Lime Kerala ed a e e 30 6 3 Programming Examples Repository 32 6 4 Setup Shared Source Directory a 32 Das Deen Lo eh ak 33 7 OpenRISC Hardware API 34 tole E aeree he ees a LR 34 Ta BIZ ine e E eni a Re 35 Tos LEDS o 5254 iopo a aa A Ddy Ub ee ae eek ae ees 36 TA Beral Interfaces o o o so d ga 36 Pao RARE O ae A 39 TO Watchdog Diet o o LA EE id EEE ESR a 40 Tas Perra APE ee E RRA e ee n 40 7 8 Read Hardware Parameters like MAC Address Serial Number etc 40 7 9 WLAN Button Alekto LAN Only pie Hee ens 41 8 proc Extensions for the OpenRISC 42 9 BIOS 43 SL System Console ce sa RI ee HR 44 US Book Priority e es ie E E de ae a E li 44 0 3 Configure Network Shares s noaa sau e E RA 45 9 4 Configure Network Parameter I 46 9 5 Configure Miscellaneous Parameter e 47 GB lr ia fe Ee CE O I E e db A nA 48 DTe BIOS Update o poe e i ea DR EOG EOW En n 49 9 3 View Board Informa
47. els source tree where the main Makefile is placed To configure the kernel via text based graphical user interface Ncurses library must be installed in the development version with all needed headers After that execute make menuconfig you ll see the following menu as shown in Figure 4 Change kernel configuration according to your needs and save the configuration To compile the kernel execute make 35 A good tutorial to start programming with Vim http heather cs ucdavis edu matloff ProgEdit ProgEdit html www cmake org 37http subversion tigris org 38http www gnu org software ncurses ncurses html 39 f your development host has more than one CPU core you can use make j to utilize all of you cores that will accelerate the compilation process 36 April 2010 OpenRISC User Manual 30 6 Software Development The compiled kernel image zImage will be placed under arch arm boot zImage To start the OpenRISC with new kernel do the following steps enter BIOS enter System Console configure IP address according to your network for example 192 168 254 254 execute nc 1 p 5000 gt var zImage this will start Netcat listening on the port 5000 on your development host execute netcat 192 168 254 254 5000 lt arch arm boot zImage after the data transmission mount your CF and copy new kernel mount dev hdai mnt cp var zImage mnt boot umount mnt 10 reboot the OpenRISC
48. fs o username user 192 168 254 253 openrisc home user openrisc_ examples enter password exit cd openrisc_ examples Now you can edit and compile programs on the PC and execute them on the OpenRISC April 2010 OpenRISC User Manual 32 6 Software Development 6 5 Debugging You have the possibility to debug your own applications with the gdbserver on the target To debug your application start the server with the following command gdbserver 9000 home user examples ioctls Make a connection to the server with the Insight debugger arm linux insight ioctls Go to the menu Target Settings see Figure 5 and enter your destination data Than you can get connected to the target with Run Connect to Target The rest of the debugging is up to you Target Selection W Set breakpoint at main Connection Target Remote TCP gt JS Set breakpoint at exit Hostname 192 168 254 254 Set breakpoint at Port 9000 i Display Download Dialog JS Use xterm as inferior s tty w Fewer Options m Run Options Run Method Attach to Target x Run Program 4 Download Program Continue from Last Stop Command to issue after attaching DK Cancel H Figure 5 Insight target selection To get Insight download the source files and compile the code using the instructions given by the Insight developers in their FAQ http sourceware org insight faq php q 2 2
49. hould meet the following requirements e BIOS 2 6 or later e Serial Terminal Emulation at 115200bps 8N1 e Installation source CD DVD ROM on USB or Windows share Samba e Installation target CompactFlash card or USB Mass Storage device Due to the fact that OpenRISC is not officially supported by arm debian port there is no suitable kernel in the distribution So you have to provide boot image files to the OpenRISC to be able to start the Debian installer These files see the description below can be downloaded from our SVN repository Generally two types of Debian installer are provided e CD ROM Installer e Network Installer For Debian 4 0 Etch you ll find only CD ROM Installer etch initrd gz For Debian 5 0 Lenny both installer are supplied lenny initrd gz cdrom and lenny initrd gz net The desired in staller must be renamed to initrd gz when copying to a mass storage device or Windows share You can get the latest install DVDs at http www debian org distrib 10 1 Preparing Boot Image Files Copy the downloaded files to the root directory of your USB mass storage device These files are e initrd gz RAM disk image with Debian Installer e zImage Linux kernel e kparam Kernel parameter like root dev ram describing that kernel should use RAM disk as root filesystem refer to Section 4 1 Alternatively you can use a Windows share Samba see Figure 20 It can be made in four steps 1 create shared folder Fo
50. ility hwtest B 11 All in one Test for Alena It is possible to test all serial ports CAN and GPIO without reattaching the cables Following components will be needed to make such a test e modified USB cable for USB CAN see Figure 36 so that GND and VCC wires will switched through relays and the outer GND is also isolated e modified null modem cable to connect PORT2 PORT4 and USB CAN together see Figure 35 Ports 1 and 3 will be connected with the same cable but without connector for USB CAN e special board for GPIO tests that connects optically isolated inputs to bidirectional channels see Figure 37 e special canprod flag must be activated to use this features The outer GND must be isolated DO7 B 007 DO6 B DO6 C Figure 36 Modified USB cable DIO2 DIO3 DIO4 DIOS 4 7 KOhm 4 7 KOhm VCC DII S 1N4001 1N4001 2N2222A 2N2222A Figure 37 Special Board for GPIO Tests Connect all components as described above With the following command GPIO CAN and serial tests will be executed hwtest cycles 2 size 4096 can canspeed 20000 canprod serial seri dev ttyS2 sero dev ttyS4 gpio io poll CAN test must be executed with low speed like 20000 bit s because the cable has no termination resistors All other tests can be made without further modifications April 2010 OpenRISC User Manual 67 B Hardware Test Utility hwtest B 12 Build Notes hwtest can be bu
51. ilt either with GNU make or CMake Both Makefile and CMakeLists txt are supplied The command line parameter parser was generated using GNU gengetopt To be able to generate the parser for changed options in hwtest ggo one has to install GNU gengetopt tool 56nttp www gnu org software gengetopt April 2010 OpenRISC User Manual 68 C Managing System Images C Managing System Images C 1 VS Image Tool VSImgTool VSImgTool was developed to make copy images from to the flash drives connected to a Windows host This utility can make the whole image or only part of it Refer to Table 11 for parameters Warning please note that you must have administrator privileges to properly execute VSImgTool list list available flash drives with their size in bytes source destination copy image from source to destination source destination custom size copy only part of the image from source to destination Table 11 VSImgTool call parameters C 1 1 Burn System Image to CF microSD Card 1 Insert CF microSD card in your card reader and execute vsimgtool list you should see the similar output gt vsimgtool exe list VSImgTool 1 0 Available devices PhysicalDrive2 Size 1024450560 bytes 2 to copy the complete image to the CF microSD card on the PhysicalDrive2 execute vsimgtool exe 26082008_etch_complete bin PhysicalDrive2 you should see the following output gt vsimgtool exe 26082008_etch_complete bin Physica
52. ion is transmitting data Without BIAS there will be noise on the cable and sometimes receivers can not detect the first characters of a beginning communication 3 5 Internal Flash Write Protection JP1 see Figure 3 on the CPU board is responsible for pro tecting first flash partition where RedBoot is installed When JP1 is closed the RedBoot partition is protected when opened the partition is writable Always keep the JP1 closed unless you want to change this partition Figure 2 Terminal Resistors Figure 3 WP Jumper April 2010 OpenRISC User Manual 14 4 Software Configuration 4 Software Configuration The OpenRISC comes with a preinstalled Debian GNU Linux on ARM operating system The complete system image see Section 4 7 provides necessary tools and services to start with applica tion development various services such as web and mail server Samba server etc For office tasks it provides an X Server with graphical desktop manager and some office software Table 3 shows free and used space for complete image Image Used Free Complete 955MB 797MB Table 3 2GB System Image This image is supplied on the DVD Software and can be copied to the CF microSD card via vsimgtool utility see Appendix C 1 under MS Windows or via dd see Appendix C 2 4 1 Booting from CF microSD There are two files placed under boot directory on the complete image e zImage kernel to boot
53. ireless network interface 3 2 1 WLAN Antenna The connector used for the WLAN Antenna is known as SMA Reverse This is a standard type to allow for simple connection of different equipment Just fit the supplied antenna by carefully screwing it to the connector You are free to connect a cable and a different antenna of your choice as long as it is designed for WLAN 3 2 2 WLAN Configuration WLAN supports 802 11b g standard with 54Mbit s When the interface goes up the blue LED will light when the interface goes down the blue LED goes dark 3 2 3 Ethernet The connectors for Ethernet are the usual RJ45 Simply connect it to your switch or hub When the connect is done the Link LED on RJ45 yellow will light When data traffic occurs on the network this LED will blink It depends on your network whether a 100Mbit or a 10Mbit connect will be established A 100Mbit net causes the Speed LED on RJ45 green to light otherwise it will remain dark OpenRISC Alekto LAN provides quad LAN switch connected to LAN 2 interface instead of single LAN interface 3 3 MicroDrive To use MicroDrive its APM functions must be disabled with hdparm B 255 dev hda April 2010 OpenRISC User Manual 13 3 Hardware Configuration 3 4 RS422 485 Electrical Configuration In typical RS422 and RS485 installations certain electric conditions have to be configured Simply connecting cables is not enough to fulfill the specifications or RS422 and R
54. is possible Working in an extended temperature range from 10 C up to 65 C the OpenRISC can be used under harsh industrial conditions Therefore the OpenRISC is downright designed for industrial automation The embedded computer runs full featured Debian GNU Linux on ARM operating system With Debian s repository database it is easy to install and update the free software on the OpenRISC The OpenRISC is capable to act directly as software development host Web Mail Print and Database server or as desktop computer with X11 window manager and many more See the list of features below e ARM9 32 bit RISC CPU 166MHz e 64MB SDRAM on board e 4MB Flash Disk on board e RS232 RS422 RS485 serial ports e CAN port e Independent digital I O channels e 1 x CF Slot in True IDE mode accepts MicroDrives e lx microSD Slot e 2x USB 2 0 as Host e MiniPCI slot for expansion with WLAN GPS etc e 2 x Ethernet interfaces for redundant networking or routing functions e PC bus with max 330kHz clock e RTC e Ready to Run Debian Linux for ARM operating system e DIN Rail and wall mount installation e Robust fanless design e Wide temperature range 10 to 65 C e Buzzer Watchdog Timer 1OpenRISC Alena only April 2010 OpenRISC User Manual x 010 rady Tenuepy 1951 OSTYuado OpenRISC Model Alekto Alekto LAN Alena CPU ARMI 32 bit RISC CPU ARMI 32 bit RISC CPU ARMI 32 bit RISC CPU 166MHz 166MHz 166MHz RAM
55. istent_net_generator_end etc udev rules d custom rules has rules to create symlinks to I2C and RTC devices KERNEL rtc0 SYMLINK rtc KERNEL i2c 0 SYMLINK i2c 4 5 Time Zone The default time zone configured on the system image is Europe London GMT 0 BIOS operates with UTC time So in summer time Debian s clock has one hour difference compared with the time shown in BIOS It is normal behavior Use dpkg reconfigure tzdata to change the time zone in Debian according to your geographical position 12http en wikipedia org wiki Udev 13 All relevant settings were removed from etc udev rules d z25_persistent net rules for Debain 4 0 Etch and from etc udev rules d 70 persistent net rules for Debian 5 0 Lenny April 2010 OpenRISC User Manual 17 4 Software Configuration 4 6 Create Swap File Swap file can be created instead of creating a swap partition To create it execute following steps 1 create file with count being equal to the desired block size dd if dev zero of var swapfile bs 1024 count 131072 2 mkswap var swapfile 3 add entry to the etc fstab var swapfile none swap sw 0 0 4 reboot and check if var swapfile is used by looking at proc swaps debian cat proc swaps Filename Type Size Used Priority var swapfile file 131064 0 1 4 7 Complete System Image The complete system image contains lots of programs and libraries It contains a development environment consisting of the gc
56. k Send the data prompt appears see Figure 15 b Select the appropriate b64 file and send it via the Send Text File functionality of your terminal software a Kernel b Filesystem Figure 16 BIOS Update Images The b64 file consists of two files e Kernel Linux kernel image zImage e Cramdisk filesystem image After transmission you can choose between installing both kernel see Figure 16 a and filesystem image see Figure 16 b or only one of them Warning do not power off or reset the OpenRISC during the flashing of the images The last step is to reboot the system see Figure 17 Figure 17 BIOS Update Reboot System 50The network option is available since BIOS version 2 1 April 2010 OpenRISC User Manual 49 9 BIOS Update procedure via network connection Push the reset button till the WLAN LED is on Send the appropriate b64 file via netcat or socat socat should be used if netcat closes connection as soon as the update image is transferred as in the examples below netcat w 600 192 168 254 254 23 lt OpenRISC 2 2 bin b64 or socat ignoreeof TCP 192 168 254 254 23 lt OpenRISC 2 2 bin b64 As a result you ll see following output in your shell window see Figure 18 The characters before this output are echo and terminal sequences for BIOS menu Update BIOS Receiving update file Extracting binary images Flashing image Type Kern
57. lDrive2 VSImgTool 1 0 Image source 26082008_etch_complete bin Size 1008451584 bytes Removable destination PhysicalDrive2 Size 1024450560 bytes The data on the destination will be lost Are you sure you want to continue yes no gt 3 answer with yes and the copying process will begin 4 at the end of the copying process you should see the elapsed time and the size of the burned copied image If your CF microSD card has bigger capacity than the system image you can just insert it in the card reader and change the partition with some partition manager like Gparted on your Linux host 57VSImgTool can be found on the DVD Software under tools 58http en wikipedia org wiki Gparted April 2010 OpenRISC User Manual 69 C Managing System Images C 1 2 Make An Image From CF microSD Card vsimgtool drive_name image bin where drive_name is the name showed by vsimgtool list For 256MB and 512MB CF microSD cards there are two custom sizes prepared vsimgtool PhysicalDrive2 image bin 256 will copy exactly 244 1024 1024 255852544 bytes vsimgtool PhysicalDrive2 image bin 512 will copy exactly 488 1024 1024 511705088 bytes vsimgtool PhysicalDrive2 image bin 519192576 will copy exactly 519192576 bytes C 2 dd To copy a system image to a CF microSD card the DVD Software must be mounted for example to mnt If USB card reader is used the CF microSD could be found under dev sdx devices for example
58. ng and Logging Due to the fact that the flash memory has a finite number of erase write cycles it is very important to reduce them Many applications use logging for information recovery and debugging purposes this can lead to frequent flash usage There are several possibilities to avoid this 1 use external HDD attached via USB and redirect swapping and logging to it 2 disable swapping remove swap entry in the etc fstab and logging where it is possible 3 redirect the log stream via network To redirect logged messages that need syslog edit etc syslog conf and change all file destinations to network destinations see the example Change info notice warn auth authpriv none cron daemon none mail news none var log messages to info notice warn auth authpriv none cron daemon none mail news none 192 168 254 84 for further information refer to the syslog conf manpage To receive the log messages under Linux you can use your existing syslog utility for Windows you can use Kiwi Syslog Daemon or any other Syslog daemon 4 3 Activating and Deactivating Services Some services will be started as daemons at system startup and hence reduce the amount of free memory and increase the boot time You can use one of the following options to deactivate the unused services at startup or start them only on demand e rename links under etc rc2 d see Table 4 f as graphical console pr
59. ode lt mode gt uless for userless fint for fully interactive hint for half interactive Default uless failstop stop testing after the first failure verbose verbose output net lt params gt network test module with its parameters mpci lt params gt MiniPCI test module with its parameters serial lt params gt serial test module with its parameters gpio lt params gt GPIO test module with its parameters cf lt params gt CompactFlash test module with its parameters i2c lt params gt I2C and RTC test module with its parameters epld lt params gt EPLD test module with its parameters usb lt params gt USB test module with its parameters can lt params gt CAN test module with its parameters wlanbtn lt params gt WLAN button test with its parameters Table 7 Common parameters and test modules B 1 Network Test Two interfaces must be connected with each other for the network test either with a patch or crossover cable A test file will be sent as raw ethernet packets To see the packet content use the verbose flag The size of the ethernet packet in bytes can be defined with nblock option The delays between two packets will be defined with the ndelay option default 100000 microseconds Usage example hwtest cycles 1 size 4096 net verbose executes the network test with a 4096 byte test file in verbose mode B 2 MiniPCI Test During the test proc bus pci devices will be searche
60. ograms for the first method e use sysvconfig or sysv rc con e start the service over inetd e start manually via etc init d TTo list swapping devices execute cat proc swaps Swww kiwisyslog com 9For detailed information about filenames see etc rc2 d README file 10http sysv rc conf sourceforge net see man inetd April 2010 OpenRISC User Manual 16 4 Software Configuration Disabled name Enabled name K09apache2 S91apache2 K77ntp S23ntp K80courier authdaemon S20courier authdaemon K80courier mta S20courier mta K80courier pop S20courier pop K80samba S20samba K80sqwebmail S20sqwebmail K84openvpn S160penvpn Table 4 Enable disable services 4 4 udev Since kernel 2 6 26 5 Complete Image uses udev to create devices in dev directory The network interfaces are not bound to their MACs in order to be able to use only one system image on various devices To change this behavior in Debian 4 0 Etch uncomment following line in etc udev rules d z45_persistent net generator rules KERNEL eth ath wlan ra sta DRIVERS IMPORT program write_net_rules attr address To change this behavior in Debian 5 0 Lenny change following line in etc udev rules d 75 persistent net generator rules KERNEL eth ath wlan 0 9 msh ra sta ctc lcs hsi GOTO persistent_net_generator_end to KERNEL ath msh ra sta ctc 1lcs hsi GOTO pers
61. p etc apache2 sites available default etc apache2 sites available ssl ln s etc apache2 sites available ssl etc apache2 sites enabled ssl o cu A ssl file must be changed NameVirtualHost 443 lt VirtualHost 443 gt SSLEngine On SSLCertificateFile etc apache2 ssl apache pem SSLCertificateKeyFile etc apache2 apache pem lt VirtualHost gt lShttp httpd apache org April 2010 OpenRISC User Manual 20 4 Software Configuration 7 to activate port 443 for https Queries edit etc apache2 ports conf Add Listen 443 8 activate SSL module a2enmod ssl 9 restart Apache apache2ctl restart 4 7 7 Mail Server courier The Courier mail transfer agent MTA is an integrated mail groupware server based on open commodity protocols such as ESMTP IMAP POP3 LDAP SSL and HTTP Courier provides ESMTP IMAP POP3 webmail and mailing list services within a single consistent framework Individual components can be enabled or disabled at will Courier now implements basic web based calendaring and scheduling services integrated in the webmail module Advanced groupware calendaring services will follow soon The mail server can be conveniently configured via web interface using courierwebadmin tool It can be started with the following URL https mail server address cgi bin courierwebadmin Execute webadmin tool setup server name and local domains under Mail server name and local domains menu Then
62. ption see 7 2 reset reboot the OpenRISC To execute the hardware reset echo 1 gt proc vsopenrisc reset Examples echo 1 gt proc vsopenrisc buzzer turn buzzer on echo 0 gt proc vsopenrisc buzzer turn buzzer off echo 0x000001f4 gt proc vsopenrisc buzzer_frq this will activate the buzzer for 500ms and then deactivate it for 500ms and so on cat proc vsopenrisc leds get the current LED status echo GREEN gt proc vsopenrisc leds turn the green LED on echo green gt proc vsopenrisc leds turn the green LED off echo rs422 gt proc vsopenrisc epld_ttyS2 sets the mode of the second port to rs422 echo 0x05 0x05 gt proc vsopenrisc gpio_ctrl set DIOO and DIO2 to output April 2010 OpenRISC User Manual 42 9 BIOS 9 BIOS BIOS Basic Input Output System lets you configure your OpenRISC e g configure how to boot set up date time and so on To get into the BIOS press ESC during the system start and you ll enter the following menu see Figure 7 Figure 7 BIOS main menu To connect to the BIOS via Telnet press reset push button for a while till WLAN LED turns on and the following output appears see Figure 8 Now you can connect to the BIOS via network by using the IP address specified under Configure Network Parameter see 9 4 Press Esc to enter setup or Tab for a bootlist Figure 8 BIOS Prompt for Bootlist April 2010 OpenRISC User Manual 43 9 BIOS 9 1 Sys
63. r a wide variety of word processing tasks 24http www windowmaker info 25http en wikipedia org wiki X_ display_ manager 26http sourceforge net projects xming 2Thttp www abisource com April 2010 OpenRISC User Manual 23 5 Network Services and Tools Provided by OpenRISC 5 Network Services and Tools Provided by OpenRISC The OpenRISC can be accessed via Ethernet for remote usage and file sharing For this purpose there are several services such as telnet ssh and ftp installed and preconfigured For WLAN configuration wpa_ supplicant and wireless tools are included in the distribution 5 1 WLAN Configuration Wpa_ supplicant 3 is a WPA Supplicant for Linux BSD Mac OS X and Windows with support for WEP WPA and WPA2 IEEE 802 11i RSN Supplicant is the IEEE 802 1X WPA component that is used in the client stations It implements key negotiation with a WPA Authenticator and it controls the roaming and IEEE 802 11 authentication association of the WLAN driver 5 1 1 Managed Wireless Network Wpa_supplicant Wpa_supplicant uses etc wpa_supplicant conf file for its configuration see the Listing be low ap_scan 1 no encryption network ssid TEST key_mgmt NONE WEP encryption network ssi d TESTWEP key_mgmt NONE wep_key0 xxxxxxxxxxxXXXXXXXXXX wep_ tx_ keyidx 0 auth_alg SHARED WPA WPA2 encryption network ssid TESTWPA2 proto WPA RSN key_mgmt WPA PSK pairwise
64. r c Watchdog Timer example e vsopenrisc h OpenRISC hardware API header file e Makefile the makefile to produce examples Following targets can be created all creates ioctls ioctls2 and rawsrv executables doc creates doxygen documentation in doc folder clean deletes executables distclean executes clean and in addition removes doc folder e vsopenrisc doxyfile doxygen configuration file Execute make and you ll get three above mentioned executables see Figure 1 You can start with an ioctls example that reads and changes the LEDs Power LED WLAN LED etc reads the reset push button status and digital IO registers ioctls After that you ll see your LEDs blinking and explaining outputs on your terminal For further information about software development for the OpenRISC refer to Section 6 April 2010 OpenRISC User Manual 11 2 Getting Started user debian gcc gcc gcc gcc 00 00 00 00 g3 g3 g3 g3 examples make ioctls c o ioctls user debian total 350 rW r r TW 1 1 TIWXI XI X rW r r TIWXI XI X TIWXI XI X rW r r YrWXr xr x rWXr xr x tw r t TIWXI XI X rW r r rw r r TrWXr xr x rw r r TIWXI XI X user debian examples 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Wall Wall Wall Wall ioctls2 c o ioctls2 rawsrv c lt 0 rawsrv wdtimer c o wdtimer examples ls
65. r example D shared folders bootdir see Figure 20 a 2 copy the image files to this folder see Figure 20 b 3 enter BIOS and set the Network Parameter see 9 4 4 configure your BIOS to access the network share directory see 9 3 52For detailed information about Debian Installation visit http www debian org releases stable arm 531GB or more recommended April 2010 OpenRISC User Manual 52 10 Debian Installation ie EdE View Favorites Tools Help ay Q O gt 7 Let Dre Ee Address D shared folders bootdir Properties ax File and Folder Tasks 2 TE a E bootdir General Sharing Security Customize Ri this folder shell You can share this folder with other users on your Gy Move this folder network To enable sharing for this folder click Share this Copy this folder folder Publish this Folder to the Do not share this folder Web ne EZ Share this folder E mail this folders files Share name y X Delete this folder Comment User limit Maximum allowed Other Places 2 Allow this number of users Local Disk D 8 To set permissions for users who access this My Documents folder over the network click Permissions emerson 14 My Computer To configure setti li z E ings for offline access click I My Network Places Caching chig New Share Details Windows Firewall is configured to allow this folder to be shared
66. ser interface It is fast feature rich easy to configure and easy to use It is also free software with contributions being made by programmers from around the world Window Maker includes compatibility options which allow it to work with other popular desktop environments namely GNOME and KDE and comes with a powerful GUI configuration editor called WPrefs which removes the need to edit text based config files by hand 4 7 11 Connecting to X Window The xdm manager lets you connect to the X Server Following configuration issues should be considered to enable a remote access to the OpenRISC e any host can get a login window in etc X11 xdm Xaccess should be uncommented e DisplayManager requestPort 0 in etc X11 xdm xdm config must be replaced with DisplayManager reguestPort 0 Xming can be used to connect to the X Server from MS Windows After installation execute XLaunch and configure the proper IP address The configuration can also be saved The saved XML file can look as follows lt xml version 1 0 gt lt XLaunch xmlns http www straightrunning com XmingNotes xmlns xsi http www w3 0rg 2001 XMLSchema instance xsi schemaLocation http www straightrunning com XmingNotes XLaunch xsd WindowMode Windowed ClientMode XDMCP XDMCPHost 192 168 1 66 Display 0 Clipboard true gt 4 7 12 AbiWord AbiWord is a free word processing program similar to Microsoft Word It is suitable fo
67. sole 115200 linux T1 23 respawn sbin getty L ttyS1 9600 vt100 Continue without boot loader No boot loader installed No boot loader has been installed either because you chose not to or because your specific architecture doesn t support a boot loader yet You will need to boot manually with the kernel on partition dev hdal and root dev hdal passed as a kernel argument Figure 34 Continue without Boot Loader April 2010 OpenRISC User Manual 59 A Debian Maintenance Notes A Debian Maintenance Notes A 1 Debian Package Management Debian uses following utilities for the package management e dpkg the main package management program e APT the Advanced Package Tool It provides the apt get program apt get allows a simple way to retrieve and install packages from multiple sources using the command line Unlike dpkg apt get does not understand deb files it works with the packages proper name and can only install deb archives from a source specified in etc apt sources list apt get will call dpkg directly after downloading the deb archives from the configured sources e aptitude a package manager for Debian GNU Linux systems that provides a frontend to the apt package management infrastructure aptitude is a text based interface using the curses library it can be used to perform management tasks in a fast and easy way To find a package execute apt cache search pkg name
68. stalled Debian for ARM Linux tools various Windows tools useful for administrating and maintaining the OpenRISC like vsimgtool netcat etc G Frequently Asked Questions FAQ There is dedicated website http faq visionsystems de to handle the FAQ concerning OpenRISC and other products provided by VScom The customer question will be posted to the support team for approval and if approved appears in the corresponding category April 2010 OpenRISC User Manual Index proc extentions 42 ABI 29 AbiWord 23 Apache 20 apt 60 BIOS 43 Bluetooth 25 buzzer 35 CAN 39 CDT 71 CMake 30 courier 21 cross compiler 29 74 dd 15 70 DNS 10 EABI 29 Eclipse 30 71 Eclox 71 EPLD_CAN 37 EPLD_PORTOFF 37 EPLD_ RS232 36 EPLD_ RS422 36 EPLD RS48 5_ART 2W 36 EPLD RS48 5_ART 4W 36 EPLD_RS485_ ART ECHO 36 EPLD_RS485_RTS_2W 37 EPLD_R5485_RTS_4W 37 EPLD_R5485_RTS_ECHO 37 FTP 27 gateway 10 gcc 19 edbserver 33 72 gengetopt 68 71 Gparted 69 GPIO_CMD_ GET 34 GPIO_CMD_GET_BUZZER 35 GPIO_CMD_GET_BUZZER_FRQ 35 GPIO_CMD_GET_CHANGE 34 GPIO_CMD_GET_CHANGES 34 GPIO_CMD_GET_CTRL 34 GPIO_CMD_GET_IRQMASK 34 GPIO_CMD_GET_LEDS 36 GPIO_CMD SET 34 GPIO_CMD_ SET BUZZER 35 GPIO_CMD_ SET BUZZER FRO 35 GPIO_CMD_ SET CTRL 34 GPIO_CMD_ SET IROMASK 34 GPIO_CMD SET LED BLUE 36 GPIO_CMD SET LED BTN WLAN
69. t x Disable watchdog shutdown on close Xi Watchdog Device Drivers UR Software watchdog lt gt KS8695 watchdog ISA based Watchdog Cards Berkshire Products ISA PC Watchdog Mixcom Watchdog WDT Watchdog timer xxx PCI based Watchdog Cards Berkshire Products PCI PC Watchdog VW WN vv PCI WDT500 501 Watchdog timer USB based Watchdog Cards Berkshire Products USB PC Watchdog AN NA 77 vw Figure 6 Watchdog Timer Support See examples wdtimer c for WDT usage example 77 PC I2C4 Inter Integrated Circuit is a multi master serial computer bus In the OpenRISC integrated PC controller is already supported by the mainline kernel A good starting point on how to use PC is the hwtest utility see Section B 6 test_LCD routine from hwtest module_i2c c shows how to communicate with an I C device Additional information can be found in the Linux kernel documentation Documentation i2c I C platform device initialization is described in arch arm mach ks8695 board vsopenrisc c It shows how RTC is attached to the I2C bus 7 8 Read Hardware Parameters like MAC Address Serial Number etc Such parameters as MAC addresses serial number etc are stored in flash and can be accessed via special structure For further information see drivers watchdog ks8695_wdt c 48http en wikipedia org wiki I2C April 2010 OpenRISC User Manual 40 7 OpenRISC Hardware API 1 struct param hw v1 0 2
70. tem Console Choosing this menu item you ll get to the system console To return to the main menu press Ctrl D or execute exit see Figure 9 You can use the console to mount CompactFlash copy the kernel see 10 11 partition the disk and so on Press Ctrl D or type exit to leave the console Figure 9 BIOS System Console 9 2 Boot Priority In this menu item you can change the boot priority see Figure 10 You can choose between following sources e CompactFlash e USB e Network Windows share Samba CompactFlash USB Ne Figure 10 BIOS Boot Priority April 2010 OpenRISC User Manual 44 9 BIOS 9 3 Configure Network Shares Here you can configure a Windows share SMB to boot from see Figure 11 To use this feature you should set up following parameters Type Server IP address Samba directory name User name Password SEIS Figure 11 BIOS Configure Network Shares April 2010 OpenRISC User Manual 45 9 BIOS 9 4 Configure Network Parameter Here you can configure the network parameters see Figure 12 You can choose between getting IP Address via DHCP or to assigning it statically For the latter you should configure following parameters e IP Address e Netmask e Broadcast e Gateway Warning please note that these network parameters are applicable only to BIOS not the system BIOS is booting Figure 12 BIOS
71. test must be started from the BIOS or USB mass storage device because the CF card must be unmounted A test file will be written to the CF card during the test and then compared with the original one After that the test file will be removed from the CF card Usage example hwtest cycles 1 size 4096 cf executes the CompactFlash test with 4096 bytes big test file B 6 12C and RTC Test A time stamp will be read from the Real Time Clock using I2C bus during the RTC test The second time stamp will be read after the delay in seconds specified by sleep option default value is 1 second and then compared The test can be activated deactivated with testrtc and testlcd options The LCD display EAT123A I2C must be connected to the OpenRISC for the I2C test The program connects to the display and O K string must be visible on the display Usage examples hwtest cycles 1 i2c testrtc testlcd executes the RTC and LCD tests April 2010 OpenRISC User Manual 65 B Hardware Test Utility hwtest hwtest cycles 1 i2c testrtc executes the RTC test only hwtest cycles 1 i2c testlcd executes the LCD test only B 7 EPLD Test Each UART has its own EPLD to switch between RS232 RS422 and RS485 modes Current configuration will be acquired and then switched to RS232 or RS422 depending on what the current configuration was The EPLDs will be chosen using serial port devices configured in eplddev option
72. tion s ss 58 62048 RR Bo Ga RRR a 51 OO Hardware Test co co cocinera hehe ae eR RW RUN ee A 51 9 10 Default Parameter 2 oak ee Pee e he eee eee RO 51 CPG ooo ee ha he GRR a PERERA a a k 51 10 Debian Installation 52 10 1 Preparing Boot Image Files o s s sc s a onyo ae eee poe Edm Kora RE eee 52 10 2 Starting Debian Installer ss sco 4 Bee RR pa a ia 53 10 3 Choosing CD ROM o oa caa A e RA 54 10 4 Load Installer Components from CD aaa lt 54 10 5 Network Configuration lt isa soc sepad dada 55 10 6 Partition Disks ii a mp LG SERIE e A 56 April 2010 OpenRISC User Manual 4 Li st of Figures F G 10 7 Setting Passwords lt o oa osea ai Ae Ae a biom n ia 10 8 Install the Base System lt 10 9 Configure the Package Manager e cuoi ekoe caa ien 10 05 Selection si ee hae Re a ea 10 11Finish the Installation F uu Debian Maintenance Notes A 1 Debian Package Management A 2 Keep a Track on Disk Usage Hardware Test Utility hwtest Bill Network Test so cse sap RR ca e a we Ae x Byer Dit Veet i ias ee eau B 3 Serial Task an e A ARE BA GPIO Test e A RW Bia Compad lasi Test ci Bib land Lek ce a ONN i en N Bf BRL TESE ee pe RE gd RR I AL PoU BTA ooo ue
73. tmp web For detailed information see the manpages for du and durep To estimate free disk space execute df h April 2010 OpenRISC User Manual 61 B Hardware Test Utility hwtest B Hardware Test Utility hwtest The test utility for the OpenRISC hardware is provided in both BIOS and preconfigured Debian CF images and consists of the following test modules Network MiniPCI Serial GPIO CompactFlash I2C and RTC EPLD USB CAN WLAN Button Three modes can be chosen for the test execution iN Di 3 userless executes all tests and shows the statistics at the end fully interactive the user has to acknowledge each test half interactive all of the automatic tests such as Network MiniPCI Serial EPLD USB CAN and CompactFlash will be executed without user acknowledgment but GPIO and I2C would ask for the acknowledgment The parameters can be specified in the command line or stored in the configuration file Without any parameter the program will not execute any test For the list of common parameters see Table Y For detailed information about options execute hwtest help 55To use configuration file execute hwtest cfg hwtest conf April 2010 OpenRISC User Manual 62 B Hardware Test Utility hwtest cfg lt file name gt configuration file cycles lt number gt number of test cycles Default infinite size lt bytes gt test file size in bytes Default 1048576 bytes m
74. to the system a super user root and an ordinary user user For the super user enter Debian login root Password linux For the ordinary user enter Debian login user Password user 2 2 Terminal Type Terminal type is defined in the environment variable TERM and is set to TERM linux by default The terminal type of your terminal application HyperTerminal ZOC minicom etc should be set to the same type to interact correctly with the OpenRISC console If linux terminal type is not available in your software vt100 can be used instead To do this add following line to the bashrc export TERM vt100 2www emtec com April 2010 OpenRISC User Manual 9 2 Getting Started 2 3 Configure Network Now you can configure network interfaces by editing etc network interfaces The IP addresses for eth0 eth1 and wlan0 are statically assigned by default see the Listing below This file describes the network interfaces available on your system and how to activate them For more information see interfaces 5 The loopback network interface auto lo iface lo inet loopback The primary network interface auto eth0 iface eth0 inet static address 192 168 254 254 netmask 255 255 255 0 The secondary network interface auto ethl iface ethl inet static address 192 168 253 254 netmask 255 255 255 0 The wireless interface auto wlan0 iface wlan0 inet static address 192 168 127 254 netmask 255 255 255 0
75. u Du e e A e e ew UN A CAN TRO e e e RA Bi WLAN Button Test scan ewe ee ew RA a B 11 All in one Test for Alena B12 Build Notes gt ass 9 Se RR RR OD EE RR RR wa Managing System Images C l VS Image Tool VolmeTool se aa csaa do y ee C 1 1 Burn System Image to CF microSD Card C 1 2 Make An Image From CF microSD Card rs SHER A bag AA ESSO PR Eclipse Jil Installation Notes coll a I e WN WA O N Di Debugging s oe A NEF RR Cross Compiler Tools DVDs Content Frequently Asked Questions FAQ Index L ist of Figures aS e Compilation example LL Terminal Resistors o c c soso da i ra a a aa A Meh a tata A a o i ra R Kernel Configuration Menu GG uu Insight target selection ag Watchdog Timer Support o ss se s worp i ER ES a ROW Ro 74 74 74 75 12 14 14 31 33 40 April 2010 OpenRISC User Manual List of Tables Te BIOS mala 43 BIOS Prompt ior Boost arse o Lara dei A a e RA 43 i BOS aeu GOl eae ee hee ee ae e RR e BR 44 Mk DIOS Coot Priori uv e pea Re ee e de e A 44 11 BIOS Configure Network Shares ee 45 12 BIOS Configure Network Parameter I ee lt lt 40 13 BIOS Configure Miscellaneous Parameter ee 47 14 BIOS Edit Booteeript Lo bee Se a 48 16 BIOS Updab S so Se Se e Se a da
76. wpa driver wext wpa conf etc wpa_supplicant conf post up echo BLUE gt proc vsopenrisc leds post down echo blue gt proc vsopenrisc leds Listing 1 etc network interfaces post up and post down directives switch blue LED on and off signaling that wireless interface is up or down The wireless interface wlan0 will be configured with the wpa_supplicant utility see Section 5 1 Setup gateway and DNS server Assuming your router has IP address 192 168 254 1 the Open RISC will be configured in the following way 1 change eth0 section of etc network interfaces file auto eth0 iface eth0 inet static address 192 168 254 254 netmask 255 255 255 0 gateway 192 168 254 1 2 insert following line to the etc resolv conf nameserver 192 168 254 1 3to activate wlan0 uncomment the auto wlan0 line in etc networking interfaces see man resolv conf for explanations April 2010 OpenRISC User Manual 10 2 Getting Started 3 execute etc init d networking restart 2 4 Start Programming Connect to the OpenRISC either via serial link or network and login as user For the introduc tion some examples were prepared and placed under home user examples This folder contains following files e ioctls c LEDs buzzer reset push button and digital IO usage examples e ioctls2 c UART and network usage examples e rawsrv c raw server application that transfers data from network to serial interface and vice versa e wdtime
77. www vscom de e 00 e e s a ee eee s lt eee gt lt 8 x w x gt ei K xx Ox O OM OM OM OM OpenRISC User Manual Edition April 2010 Vision Systems GmbH Tel 49 40 528 4010 Fax 49 40 528 401 99 Web www visionsystems de Support fag visionsystems de Y m O O The software described in this manual is furnished under a license agreement and may be used only in accordance with the terms of that agreement Copyright Notice Copyright 2009 Vision Systems All rights reserved Reproduction without permission is prohib ited Trademarks VScom is a trademark of Vision Systems GmbH All other trademarks and brands are property of their rightful owners Disclaimer Vision Systems reserves the right to make changes and improvements to its product without pro viding notice Vision Systems provides this document as is without warranty of any kind either expressed or implied
Download Pdf Manuals
Related Search
Related Contents
4-7.スーパーボール等による窒息事故[PDF:679KB] PVDM4-LC - Atkinson Electronics Inc MANUEL D`UTILISATION Home Decorators Collection 0888200280 Instructions / Assembly サービス内容のご案内 Ferris Industries 5900605 Lawn Mower User Manual G1312B English User Guide - VonUnterwegsGesendet.de N384527 man plate joiner 557 NA.indd HUMEX RHUME, comprimé et gélule Copyright © All rights reserved.
Failed to retrieve file