www.vscom.de OnRISC OnRISC User Manual Manual User Edition: Edition: May May 2014 2014 Vision Systems GmbH Tel: +49 40 528 401 0 Fax: +49 40 528 401 99 Web: www.visionsystems.de Support: faq.visionsystems.
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-2014 Vision Systems. All rights reserved. Reproduction without permission is prohibited. Trademarks VScom is a registered trademark of Vision Systems GmbH. All other trademarks and brands are property of their rightful owners.
Contents Contents 1. Introduction 1.1. OnRISC Family . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2. How to Read the Manual? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 9 9 2. Getting Started 2.1. Connect to OnRISC via Serial Link . 2.2. Terminal Type . . . . . . . . . . . . 2.3. Configure Network . . . . . . . . . . 2.4. Start Programming . . . . . . . . . . 2.4.1. KS8695 based Devices . . . . 2.4.2. OMAP3 based Devices . . . . . . . . . . . .
Contents 4.9.1. Samba . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 4.9.2. NFS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 5. Software Development 5.1. Environment . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.1. Compile your software directly on the OnRISC . . . 5.1.2. Cross-compile your software on the PC . . . . . . . 5.1.3. Integrated Development Environment . . . . . . . . 5.2. Linux Kernel . . . . . . . . . . . . .
Contents 8.8. View Board Information 8.9. Hardware Test . . . . . 8.10. Default Parameter . . . 8.11. Exit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 59 59 59 9. Debian Installation 9.1. Preparing Boot Image Files . . . .
Contents C.10.WLAN Button Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 C.11.All-in-one Test for Alena . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 C.12.Build Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 D. hwtest-qt D.1. Controller Area D.2. UART Test . . D.3. Network Test . D.4. RTC Test . . . D.5. WLAN Test . . D.6. Bluetooth Test D.7. Disk Test . . . D.8. Touch Test . . D.9. SIM-card Test . D.10.
List of Figures List of Figures 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. Compilation example . . . . . . . . . . . . Kernel Configuration Menu . . . . . . . . Insight: target selection . . . . . . . . . . Watchdog Timer Support . . . . . . . . . BIOS: main menu . . . . . . . . . . . . . BIOS Prompt for Bootlist . . . . . . . . . BIOS: System Console . . . . . . . . . . . BIOS: Boot Priority . . .
List of Tables List of Tables 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. OnRISC Products Based on ARM9 KS8695 SoC . . . . OnRISC Products Based on OMAP3 SoC . . . . . . . . Enable/disable services . . . . . . . . . . . . . . . . . . . Digital I/O Groups . . . . . . . . . . . . . . . . . . . . . Serial Modes (hardware switching) . . . . . . . . . . . . Watchdog Timer IOCTLs . . . . . . . . . . . . . . . . . BIOS: hwtest parameters . . . . . . . . . . . . . . . . . Serial Modes (Software switching) . .
1 Introduction 1. Introduction 1.1. OnRISC Family The OnRISC is an ARM-based RISC industrial embedded computer family. The great variety of interfaces like LAN, CF, microSD, USB, CAN1 , I2C, serial interface and digital I/O makes it easy to connect various industrial devices to the OnRISC. New OnRISC device provide graphical display (VS-860 has built-in 8” LCD display and Alekto2 provides HDMI interface to attach an external monitor).
Alekto LAN Alena CPU RAM Flash Memory on Board Serial Interfaces ARM9 32-bit RISC CPU, 166MHz 64MB SDRAM 4MB 2 x RS232/RS422/RS485 ARM9 32-bit RISC CPU, 166MHz 64MB SDRAM 4MB 1 x RS232/RS422/RS485 CAN Interface on board Digital I/O channels 8 x I/O channels - CF-Slot (True IDE mode) 1 x (also accepts MicroDrives) 1 x (also accepts MicroDrives) ARM9 32-bit RISC CPU, 166MHz 64MB SDRAM 4MB 2 x RS232/RS422/RS485 2 x RS232 only 1x 4 x I/O channels 2 x Relays 2 x optically isolated inputs 1 x (also acc
Alekto 2 CPU RAM Flash Memory on Board Serial Interfaces CAN Interface on board Digital I/O channels CFast slot AM3517 (ARM Cortex-A8) 256MB DDR2 AM335x (ARM Cortex-A8) 256MB DDR2 N.A. N.A. 2 x RS232/RS422/RS485 1x N.A. 1x 2 1 8 1 Introduction OnRISC User Manual VS-860 1 May 2014 OnRISC Model microSD-Slot 1 x internal slot 1 x internal slot USB Expansion Slot Ethernet I2C bus RTC 2 x USB 2.0 as Host, 1 x as OTG Mini PCI Express 2x N.A.
2 Getting Started 2. Getting Started 2.1. Connect to OnRISC via Serial Link Connect the OnRISC to the serial port of your PC and start a terminal software (HyperTerminal, ZOC2 , 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 3). Power your OnRISC according to the Hardware Manual. You’ll see Linux booting.
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 wlan03 are statically assigned by default(see the Listing below). # This f i l e d e s c r i b e s t h e network i n t e r f a c e s a v a i l a b l e on your system # and how t o a c t i v a t e them . For more i n f o r m a t i o n , s e e i n t e r f a c e s ( 5 ) .
2 Getting Started 3. execute /etc/init.d/networking restart 2.4. Start Programming 2.4.1. KS8695 based Devices Connect to the OnRISC either via serial link or network and login as user. For the introduction some examples were prepared and placed under /home/user/examples. This folder contains following files: • ioctls.c - LEDs, buzzer, reset push button and digital IO usage examples • ioctls2.c - UART and network usage examples • rawsrv.
2 Getting Started user@debian:~/examples$ make gcc -O0 -g3 -Wall ioctls.c -o ioctls gcc -O0 -g3 -Wall ioctls2.c -o ioctls2 gcc -O0 -g3 -Wall rawsrv.c -o rawsrv gcc -O0 -g3 -Wall wdtimer.c -o wdtimer user@debian:~/examples$ ls -l total 350 -rw-r--r-- 1 user user 349 Aug 27 14:32 CMakeLists.txt -rw-r--r-- 1 user user 392 Aug 27 14:57 Makefile -rwxr-xr-x 1 user user 68577 Aug 27 17:12 ioctls -rw-r--r-- 1 user user 8865 Aug 27 14:54 ioctls.c -rwxr-xr-x 1 user user 8568 Aug 27 17:12 ioctls.
3 Software Configuration 3. Software Configuration The OnRISC comes with a preinstalled Debian GNU/Linux on ARM5 operating system. The complete system image (see Section 3.7) provides necessary tools and services to start with application 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.
3 Software Configuration 3.1.2. OMAP3 based Devices The system images for OMAP3 based devices have two partitions: 1. FAT partition having files need to initialize and boot the system (MLO, u-boot.img, uEnv.txt and uImage) 2. ext4 partition having Debian root file system The OMAP CPU automatically loads x-loader (MLO) from the FAT partition and then the code in x-loader takes over and loads U-Boot7 (u-boot.img), that takes care of Linux kernel (uImage).
3 Software Configuration 3.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: • rename links under /etc/rc2.d10 (see Table 3). • use sysv-rc-conf11 as graphical console program for the first method • start the service over inetd12 • start manually via /etc/init.
3 Software Configuration KERNEL=="rtc0", SYMLINK+="rtc" KERNEL=="i2c-0", SYMLINK+="i2c" 3.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. 3.6.
3 Software Configuration – netcat – socat – Samba client and server – Apache2 web server – Courier mail server – NTP client and server – sredird RFC2217 server • Desktop: – WindowMaker (KS8695 based devices) or XFCE (OMAP3 based devices) desktop – xdm server – AbiWord – dillo or netsurf web browser 3.7.2. GCC GCC15 development is a part of the GNU Project, aiming to improve the compiler used in the GNU system including the GNU/Linux variant.
3 Software Configuration 3.7.5. Samba Samba18 is an Open Source/Free Software suite that has, since 1992, provided file and print services 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.
3 Software Configuration 4. cp /etc/apache2/sites-available/default /etc/apache2/sites-available/ssl 5. ln -s /etc/apache2/sites-available/ssl /etc/apache2/sites-enabled/ssl 6. ssl file must be changed: NameVirtualHost *:443 SSLEngine On SSLCertificateFile /etc/apache2/ssl/apache.pem SSLCertificateKeyFile /etc/apache2/apache.pem ... 7. to activate port 443 for https-Queries edit /etc/apache2/ports.conf. Add Listen 443 8. activate SSL module: a2enmod ssl 9.
3 Software Configuration 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 restrict default notrust nomodify nopeer ############################################### Then restart ntpd.
3 Software Configuration 3.7.10. Connecting to X-Window The xdm manager23 lets you connect to the X-Server. Following configuration issues should be considered to enable a remote access to the OnRISC: • #* #any host can get a login window in /etc/X11/xdm/Xaccess should be uncommented • DisplayManager.requestPort: 0 in /etc/X11/xdm/xdm-config must be replaced with ! DisplayManager.requestPort: 0 Xming24 can be used to connect to the X-Server from MS Windows.
4 Network Services and Tools Provided by OnRISC 4. Network Services and Tools Provided by OnRISC The OnRISC 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. 4.1. WLAN Configuration Wpa_supplicant26 is a WPA Supplicant for Linux, BSD, Mac OS X, and Windows with support for WEP, WPA and WPA2 (IEEE 802.
4 Network Services and Tools Provided by OnRISC 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) . 4.1.2.
4 Network Services and Tools Provided by OnRISC To activate a GSM connection configure proper PIN and APN. After that uncomment auto ppp0 and restart networking service: service networking restart You can find the supported AT command reference27 on the CD . 4.3. Bluetooth Support The Bluetooth support is already integrated in the kernel.
4 Network Services and Tools Provided by OnRISC 1. select “Join a Personal Area Network” 2. search for the OnRISC 3. select it and try to connect. Enter “1234” as passkey 4. configure the network interface 4.4. 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 4.5.
4 Network Services and Tools Provided by OnRISC For further information see: man vsftpd 4.7. RFC2217 Internal serial interfaces of the OnRISC can be made accessible over network via RFC2217 protocol. ser2net31 is a daemon, that provides such functionality. On the client side (PC) you need either a virtual COM port driver or an application/library communicating RFC2217 directly. For MS Windows OS you can use the VScom driver of NetCom Mini32 .
4 Network Services and Tools Provided by OnRISC 4.8. Socketcand socketcand is a daemon that provides access to CAN interfaces on a machine via a network interface. The communication protocol uses a TCP/IP connection and a specific protocol to transfer CAN frames and control commands. The protocol specification can be found in ./doc/protocol.md.33 The project provides Java API to develop your own client applications for socketcand.
5 Software Development 5. Software Development 5.1. Environment 5.1.1. Compile your software directly on the OnRISC You can start programming directly on the OnRISC. 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. This method is preferred, if your software has many dependencies. 5.1.2.
5 Software Development OMAP3 based Devices Debian 7.0 will be supplied with OMAP3 based devices. It is based on an arm-linux-gnueabihf 4.7 toolchain. To install this toolchain on your development PC, you’ll need to add emdebian repository. Add deb http://www.emdebian.org/debian/ unstable main to your /etc/apt/sources.list. Then execute as root: apt-get apt-get apt-get apt-get update install emdebian-archive-keyring install gcc-4.7-arm-linux-gnueabihf g++-4.
5 Software Development 5.2. Linux Kernel 5.2.1. From Subversion Repository or Archive (old kernels) The OnRISC uses 2.6 series Linux kernel. The source code for one of these kernels can be obtained both from CD and from Subversion41 repository at http://svn.visionsystems.de/. For the kernel archive on the CD execute: su mount /dev/cdrom /mnt exit cd /home/user/projects tar -xvjf /mnt/development/linux-2.6.33-OnRISC.tar.bz2 To check out the repository to your development host execute: svn co svn://svn.
5 Software Development Figure 2: Kernel Configuration Menu 5.2.2. From Buildroot Repository Since kernel version 3.0 there are no more Subversion repositories for Linux kernels on our server. Instead the patches will be maintained by our Buildroot repository . In order to compile the kernel you can either checkout our Buildroot repository and compile all components from toochain till kernel or you can use vskernel.sh script from our OnRISC_Software repository and the toolchain from our FTP server.
5 Software Development 4. execute nc -l -p 5000 > /var/zImage this will start Netcat listening on the port 5000 5. on your development host execute netcat 192.168.254.254 5000 < arch/arm/boot/zImage 6. after the data transmission mount your CF and copy new kernel 7. mount /dev/hda1 /mnt 8. cp /var/zImage /mnt/boot 9. umount /mnt 10. reboot the OnRISC OMAP3 based Devices 1. extract the microSD card and insert into a card reader connected to your host PC 2. mount the first partition 3.
5 Software Development 5.3. Programming Examples Repository Some programming examples were prepared to show/test the abilities of OnRISC hardware. The latest version of this software can be obtained from our repository by executing the following command: svn co svn://svn.visionsystems.de/OnRISC_Software/trunk OnRISC_Software/trunk This repository contains following folders: • examples - some basic programming examples as described in Section 2.
5 Software Development – mount -t cifs -o username=user //192.168.254.253/onrisc /home/user/onrisc_examples – enter password – exit – cd onrisc_examples Now you can edit and compile programs on the PC and execute them on the OnRISC. 5.5. Debugging You have the possibility to debug your own applications with the gdbserver44 on the target.
5 Software Development host> host> host> host> mkdir insight-arm; cd insight-arm ../src/configure --target=arm-linux --program-prefix=arm-linuxmake make install You can also use Eclipse to debug your application (see Appendix F.2) . 5.6. Recommended Books A list of books about Linux programming/usage and related topics: • “The Debian Administrator’s Handbook” by Raphaël Hertzog, Roland Mas (http://debianhandbook.
6 OnRISC Hardware API 6. OnRISC Hardware API KS8695 based Devices Such hardware as digital I/O, buzzer, serial interfaces will be controlled via IOCTL commands. These commands are defined in the onrisc.h header file. Almost all IOCTL commands are reflected in the /proc-filesystem (see Section 7).
6 OnRISC Hardware API • GPIO_CMD_GET_CTRL/GPIO_CMD_SET_CTRL - set/get data direction register value • GPIO_CMD_GET_IRQMASK/GPIO_CMD_SET_IRQMASK - set/get interrupt mask register value • GPIO_CMD_GET_CHANGE - get status register value • GPIO_CMD_GET_CHANGES - get interrupt count (reflected in /proc/vscom/gpio_changes) The digital I/O driver also supports select() and poll() calls. To use this functionality the interrupt must be enabled for the desired pins.
6 OnRISC Hardware API Group nr. 0 1 2 Pins 0-3 4-5 6-7 Table 4: Digital I/O Groups 6.2. Buzzer for KS8695 based Devices The OnRISC 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 onrisc.h to control the buzzer: • GPIO_CMD_GET_BUZZER/GPIO_CMD_SET_BUZZER - turn on/off the buzzer (reflected in /proc/vscom/buzzer) • GPIO_CMD_GET_BUZZER_FRQ/GPIO_CMD_SET_BUZZER_FRQ - get/set the modulated signal delay.
6 OnRISC Hardware API 6.4. Serial Interfaces 6.4.1. KS8695 based Devices RS232/422/485 mode switching The serial ports can operate in one of the three modes RS232, RS422 or RS48547 (see Hardware Manual for electrical configuration issues). These modes will be controlled through the EPLD circuit. Following IOCTLS are to be used to switch the modes (alternative /proc/vscom/epld_ttySx entries can be used to switch RS modes.
6 OnRISC Hardware API RS485 receive control mode: There are two modes to handle own transmitted messages in 2-wire • with echo (EPLD_RS485_RTS_ECHO, EPLD_RS485_ART_ECHO): both outgoing and incoming messages will be received by application • without echo (EPLD_RS485_ART_2W, EPLD_RS485_RTS_2W): application receives only incoming messages Baud rate generation interface The OnRISC provides full support for the 16C950 UART baud rate generation.
6 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 OnRISC Hardware API i f ( r e t < 0) { perror ( " ispeed " ) ; return −1; } r e t = c f s e t o s p e e d (& s e r _ t e r m i o s , B38400 ) ; i f ( r e t < 0) { p e r r o r ( " ospeed " ) ; return −1; } r e t = t c s e t a t t r ( fd , TCSANOW, &s e r _ t e r m i o s ) ; i f ( r e t < 0) { perror ( " getattr " ) ; return −1; } ...
6 OnRISC Hardware API 6.4.2. OMAP3 based Devices Serial interfaces on OMAP3 devices use FTDI USB-to-serial converter chips (FT2232D). Both ports appear in the system as /dev/ttyUSB0 and /dev/ttyUSB1. Two methods are provided to switch between RS232/RS422/RS485 modes (termination inclusive): via software48 and via DIP-switch. Each port has its own DIP-switch named SW1 and SW2. Table 5 shows possible DIP-switch settings.
6 OnRISC Hardware API 6.5. CAN SocketCAN provides access to CAN controller on all CAN capable OnRISC devices49 (refer to Table 1). SocketCAN50 is a set of open source CAN drivers and a networking stack contributed by Volkswagen Research to the Linux kernel. Formerly known as Low Level CAN Framework (LLCF). 6.5.1. CAN Interface Configuration Special script /etc/init.d/can_if51 is provided to setup can0 interface. It is preconfigured to use can0 at 1000000b/s.
6 OnRISC Hardware API 6.6. I2C I2C54 (Inter-Integrated Circuit) is a multi-master serial computer bus. In the OnRISC integrated I2C controller is already supported by the mainline kernel. A good starting point on how to use I2C is the hwtest utility (see Section C.6). test_LCD() routine from hwtest/module_i2c.c shows how to communicate with an I2C device. Additional information can be found in the Linux kernel documentation Documentation/i2c.
6 OnRISC Hardware API Figure 4: Watchdog Timer Support 6.9. Read Hardware Parameters like MAC Address, Serial Number etc. 6.9.1. KS8695 based Devices Such parameters as MAC addresses, serial number etc.
6 OnRISC Hardware API 6.10. Change Screen Resolution (Alekto 2 Only) Alekto 2 supports tree resolutions: • 640x480 • 800x600 • 1024x768 (default) The resolution will be configured via kernel command line parameter video. Following values are accepted: • 640x480@60 • 800x600@60 • 1024x768@60 This parameter will be configured in uEnv.txt located on the first partition. Example: bootargs=video=da8xx_lcdc:1024x768@60 6.11.
7 /proc-Extensions for the KS8695 based Devices 7. /proc-Extensions for the KS8695 based Devices In the /proc/vscom directory reside several files to manipulate the OnRISC hardware: • epld_ttyS* - configure serial driver e.g. rs232, rs422, rs485. For exact values execute echo /proc/vscom/epld_ttySn (n=1..4) For detailed description see 6.4 • gpio_* - set and read digital IO channels. For detailed description see 6.1 • leds - set and read LEDs values. For detailed description see 6.
8 BIOS for KS8695 based Devices 8. BIOS for KS8695 based Devices BIOS (Basic Input Output System) lets you configure your OnRISC 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 5). Figure 5: 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 6).
8 BIOS for KS8695 based Devices 8.1. System 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 7). You can use the console to mount CompactFlash, copy the kernel (see 9.11), partition the disk and so on. Figure 7: BIOS: System Console 8.2. Boot Priority In this menu item you can change the boot priority (see Figure 8).
8 BIOS for KS8695 based Devices 8.3. Configure Network Shares Here you can configure a Windows share (SMB) to boot from (see Figure 9).
8 BIOS for KS8695 based Devices 8.4. Configure Network Parameter Here you can configure the network parameters (see Figure 10). You can choose between getting IP Address via DHCP or to assigning it statically. For the latter you should configure following parameters: • IP Address • Netmask • Broadcast • Gateway Warning: please note that these network parameters are applicable only to BIOS not the system BIOS is booting.
8 BIOS for KS8695 based Devices 8.5. Configure Miscellaneous Parameter Following parameters can be set up here (see Figure 11): • Date • Time • Start-Timeout57 - the time in seconds during that the BIOS or bootlist could be accessed. • Terminal Type (Console/Telnet) - emulation type to choose by terminal software such as Hyperterminal, ZOC etc while connecting via serial link or telnet.
8 BIOS for KS8695 based Devices 8.6.
8 BIOS for KS8695 based Devices 8.7. BIOS Update BIOS update can be done either via serial connection or via network connection58 . (a) Update prompt (b) Waiting for data Figure 13: BIOS: Update Update procedure via serial connection In the dialog shown in Figure 13a choose “Ok”. “Send the data...” prompt appears (see Figure 13b). Select the appropriate *.b64 file and send it via the “Send Text File” functionality of your terminal software.
8 BIOS for KS8695 based Devices Update procedure via network connection Push the reset button till the WLAN LED is on. Send the appropriate *.b64 file via netcat59 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 < OnRISC-BIOS-2.2.bin.b64 or socat -,ignoreeof TCP:192.168.254.254:23 < OnRISC-BIOS-2.2.bin.b64 As a result you’ll see following output in your shell window (see Figure 16).
8 BIOS for KS8695 based Devices 8.8. View Board Information Shows some board information (see Figure 17) Figure 17: BIOS: View Board Information 8.9. Hardware Test The hwtest program will be invoked for one cycle with the parameters listed in Table 7. For detailed information about hwtest refer to Appendix C.
9 Debian Installation 9. Debian Installation The installation of the Debian 5.0.3 Lenny60 will be described in this section. The installation instructions for other Debian versions are similar with this one. Your system should meet the following requirements: • BIOS 2.
9 Debian Installation (a) Shared Folder Properties (b) Boot Image Files Figure 18: Windows Share 9.2. Starting Debian Installer Exit BIOS and save changes if required. Press ’Tab’ to access bootlist and choose USB Mass Storage Device (see Figure 19a) or Network (see Figure 19b). The Installer will be put into low memory mode (see Figure 20). Press ’Enter’ and choose your country in the next dialog.
9 Debian Installation Figure 20: Low Memory Mode 9.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 21). 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.
9 Debian Installation names. Figure 23: Network configuration In the case of network installation you’ll be asked to configure package mirror as in Figures 24 and 25.
9 Debian Installation 9.6. Partition Disks After scanning your target storage media, you’ll be asked to continue with partitioning (see Figure 26). Answer with ’Yes’. In the second dialog select ’Guided - use entire disk’ as in Figure 27. Figure 26: Partition Disks Figure 27: Partitioning Method In the next dialog confirm your target disk and then select ’All files in one partition’ scheme as in Figure 28.
9 Debian Installation Figure 28: Partitioning Scheme Figure 29: Partition Table Type Figure 30: Partition Table May 2014 OnRISC User Manual 65
9 Debian Installation 9.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. 9.8. Install the Base System As the OnRISC is not officially supported by Debian, there is no kernel shipped with the distribution. Answer with ’Yes’, when you’ll be asked to install without a kernel. 9.9.
9 Debian Installation 9.11. Finish the Installation Due to the lack of the official support by Debian there is no boot loader (see Figure 32). After reboot, enter BIOS and go to the console. Mount the first partition: mount /dev/hda1 /mnt Copy zImage either from your host or USB mass storage device into the /boot directory and execute: echo “mem=59M root=/dev/hda1” > /boot/kparam Exit BIOS and enter the bootlist by pressing ’Tab’. You can now boot from /dev/hda1.
10 Buildroot 10. Buildroot Buildroot62 is a set of Makefiles and patches that allows you to easily generate a cross-compilation toolchain, a root filesystem and a Linux kernel image for your target. Buildroot can be used for one, two or all of these options, independently.
10 Buildroot 10.3. Copying the Created Image to the System OpenNetCom You can copy the newly created image via RedBoot and console. This will require a special Service Board to interact with RedBoot. It is very important that write-protection jumper is set in order to protect RedBoot from getting corrupted. Please refer to OpenNetCom’s user manual. OnRISC You’ll need to create a ext2 partition on your media (CF or microSD-card).
10 Buildroot 10.5. Compiling Your Own Software There are following ways on how to get your software to be build and installed on the system using Buildroot: • adding your software to the packages folder • using generated toolchain to compile your software and then manually copying it either to fs/skeleton or output/target The first way is described here Add packages. The second way is described here Using toolchain. See this article on how to override source directory Source directory override.
A Debian Maintenance Notes A. Debian Maintenance Notes A.1. Debian Package Management Debian uses following utilities for the package management66 : • dpkg - the main package management program. • 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 .
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-query -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 /tmp/web/ For detailed information see the manpages for du and durep.
B onrisctool.py B. onrisctool.py OnRISC configuration utility provides following features to configure OMAP3 based devices: • configure serial interfaces (RS232, RS422 etc.) • configure OTG/CFast switching • configure RTC • configure digital I/O • get EEPROM info • set MACs from EEPROM B.1. Configure Serial Interfaces Both VS-860 and Alekto2 provide two UARTs working in RS232/RS422/RS485 modes. Invoking onrisctool.
B onrisctool.py B.2. Configure OTG/CFast Both VS-860 and Alekto2 use USB OTG port in two modes: OTG and CFast. The mode can be switched both via jumper and GPIO pin (software). The software settings “overwrite” the jumper. Executing onrisctool.py will show the status of hardware/software settings. Following output says, that the USB port is in OTG mode set over jumper: OTG automatic mode: OTG You can switch to CFast via executing: onrisctool.py -o cfast If you then execute onrisctool.
B onrisctool.py B.5. Get EEPROM Info onrisctool.py shows hardware related data like MACs, serial number etc. stored in EEPROM if called without parameters: magic: 0xDEADBEEF hw rev: 1.0 SerNum: 860102014 Prod date: 31.05.2013 SysId: 100 MAC1: 00:04:D9:8E:00:04 MAC2: 00:04:D9:8E:00:05 MAC3: 00:04:D9:8E:00:06 B.6. Setting LAN MACs from EEPROM You can use in EEPROM stored MACs for internal LAN interfaces: onrisctool.py --setlanmacs Executing this command will set MAC1 and MAC2 to eth0 and eth1/usb0.
C hwtest C. hwtest The test utility for the OnRISC hardware is provided in both BIOS and preconfigured Debian system 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 : 1. userless - executes all tests and shows the statistics at the end 2. fully interactive - the user has to acknowledge each test 3.
C hwtest --cfg --cycles --size --mode --failstop --verbose --net --mpci --serial --gpio --cf --i2c --epld --usb --can --wlanbtn configuration file number of test cycles. Default: infinite test file size in bytes. Default: 1048576 bytes uless for userless, fint for fully interactive, hint for half interactive.
C hwtest TX RX RTS CTS, RI DTR DSR, CD GND ↔ ↔ ↔ ↔ ↔ ↔ ↔ RX TX CTS, RI RTS DSR, CD DTR GND Table 10: Serial Test Cable Wiring 5 GND 9 RI 4 DTR 8 CTS 3 RXD 7 RTS 2 TXD 6 DSR 1 CD 5 GND 9 RI 4 DTR 8 CTS 3 RXD 7 RTS 2 TXD 6 DSR 1 CD PORT 2 3 GND 7 CANH 2 CANL PORT 4 USB-CAN Figure 33: 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.
C hwtest The I/O pins must be connected with each other for the IO test (using 4,7k resistors for example) (see Table 11). The optical isolated input channels will be connected to relays by Alena without any resistors(see Table 12).
C hwtest hwtest --cycles=1 --i2c --testrtc executes the RTC test only hwtest --cycles=1 --i2c --testlcd executes the LCD test only C.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.
C hwtest C.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: • modified USB cable for USB-CAN (see Figure 34) so that GND and VCC wires will switched through relays and the outer GND is also isolated • modified null-modem cable to connect PORT2, PORT4 and USB-CAN together (see Figure 33).
C hwtest C.12. Build Notes hwtest can be built either with GNU make or CMake. Both Makefile and CMakeLists.txt are supplied. The command line parameter parser was generated using GNU gengetopt68 . To be able to generate the parser for changed options in hwtest.ggo one has to install GNU gengetopt tool. 68 http://www.gnu.
D hwtest-qt D. hwtest-qt Hwtest-qt provides various hardware tests in both console and graphical environment. To get GUI start ghwtest-qt instead of hwtest-qt. Hwtest-qt can be run using special configuration file. See /etc/hwtest.conf for example. hwtest-qt -qws -c /etc/hwtest.conf If you want to execute the tests in parallel: hwtest-qt -qws -c /etc/hwtest.conf --parallel-exec Please see hwtest-qt --help for further options. D.1.
D hwtest-qt D.6. Bluetooth Test Bluetooth test needs an active Bluetooth device like headset, Bluetooth dongle etc. to find during the scan. hwtest-qt -qws --test-bt D.7. Disk Test Insert CFast card and execute: hwtest-qt -qws --test-disk --drive=/dev/sda D.8. Touch Test If you start ghwtest-qt and you can precisely touch the buttons, then touch controller is functioning properly. You can calibrate it by executing ts_calibrate D.9.
E Managing System Images E. Managing System Images System images provide 1:1 copy of the Debian OS installed on a CF/microSD card. The image has the size of a medium being used to produce the system image. For KS8695 based devices it is ca. 2GB and for OMAP3 based devices ca. 4GB. In the case of OMAP3 based devices a special utility raspi-config70 is provided to automatically enlarge partition/file system to the real physical size of a medium, i.e.
E Managing System Images Figure 37: Win32 Disk Imager E.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: >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: >vsimgtool.
E Managing System Images E.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 E.2. dd E.2.1.
F Eclipse F. Eclipse F.1. Installation Notes Eclipse is an open source community whose projects are focused on building an extensible development 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 Microsystems74 .
F Eclipse F.2. Debugging Assuming your OnRISC has IP address 192.168.1.66. Start your ioctls executable on the OnRISC with following command: gdbserver :9000 ioctls On the PC side: • open examples project (the .project and .cdtproject file are already created) • Select Run->Debug • Double click Embedded debug (Native).
F Eclipse Figure 39: Eclipse debug: Debugger tab Figure 40: Eclipse debug: Commands tab May 2014 OnRISC User Manual 90
H Frequently Asked Questions (FAQ) G. Cross-Compiler Tools Name ar as g++ cpp gcc ld nm objcopy objdump ranlib readelf Description Creates and updates static library files Assembler C++ compiler C preprocessor C compiler Linker Lists symbols from object files Copies and translates object files Displays information about object files Generates indexes to archives (static libraries) Displays information about ELF files Table 14: Toolchain items H.
Index /proc-extentions, 50 ABI, 31 AbiWord, 24 Apache, 21 APN, 26 apt, 71 BIOS, 51 Bluetooth, 27 buzzer, 41 CAN, 46 can0, 46 CDT, 88 CMake, 32 courier, 22 cross-compiler, 31, 91 dd, 16, 87 DNS, 13 EABI, 31 Eclipse, 32, 88 EPLD_CAN, 42 EPLD_PORTOFF, 42 EPLD_RS232, 42 EPLD_RS422, 42 EPLD_RS485_ART_2W, 42 EPLD_RS485_ART_4W, 42 EPLD_RS485_ART_ECHO, 42 EPLD_RS485_RTS_2W, 42 EPLD_RS485_RTS_4W, 42 EPLD_RS485_RTS_ECHO, 42 FTP, 28 gateway, 13 gcc, 20 gdbserver, 37, 89 gengetopt, 82, 88 Gparted, 86 GPIO_CMD_GET, 39 G
Index socat, 20 SocketCAN, 46 SSH, 28 SSL, 21 Subclipse, 88 Subversion, 33 swap, 17, 19 syslog, 17 telnet, 28 TERM, 12 TIOCGEPLD, 42 TIOCSEPLD, 42 udev, 18 Universal Time Coordinated (UTC), 19 Vim, 32 vsimgtool, 16, 85 vt100, 12 Watchdog Timer (WDT), 47 WEP, 25 WindowMaker, 23 WLAN, 25 wland, 26, 47 WPA, 25 WPA2, 25 wpa_supplicant, 25 X-Server, 24 X-Window, 24 X11, 23 Xming, 24 May 2014 OnRISC User Manual 93