Home
UEIPAC 600 Product Manual - United Electronic Industries
Contents
1. P 37 Pets R nexampleS P 8 37 Tu PowerDNA SEVEN otiosa aO a aM t MU A UU rud iu 38 8 Application development sisicissccsccerssacescencanccseccascodsaacsssedscensscdenaceasoace 39 MM iC OILS RN D EST 39 8 2 Compiling and running Hello World ue iie etra the epa pvp P Ponte pn bea a kin 39 8 Debugging Hello Worlds eiie te ela nu ER ASK IEERINE ENSE anaa 40 94 PowerDNA Mb cis 41 PowerDNA 2 PI e E A E a R a 43 Building and running the examples win csssecscsecnsdandassstasseuuberscadanussapsasapsnvebacaeacasseancaaton 46 Building your own program acciscdassrssdreratncdercsscaatiab iio wnbncacninah waar SUR EK PR M UE 46 SO Real Time Programming gcssacsccisoessasesecesacasatamveie ctatatelcceansnqtscandppoialeananteanediads 47 8 6 Running a program automatically after boot see 48 8 7 Running a program periodically oe anb Rod P RUN Pn trE IIa pO EUP LES DEN SN M LK MUR 49 9 Firmware installation and upgrade eeeeeeeee 50 9 1 Installing or upgrading the Linux kernel i ser inter Rr rettet ERR Rn 50 UEIPAC with Freescale 5200 CPU 100MB it Ethernet eese 50 UEIPAC with Freescale 8347 CPU 1GBit Ethernet sseeeeeeees 51 9 2 _Initializine dn SD CSI oos iia etnei eiseres PANI eE Ea UR MM 51 On Ep d Pp 51 On the UEIPAC Itself npin RN ER Cep edu p ane ID UR MeSH URDU
2. 2d fi bar Local Files int main int s tx Local Shells PDN PARAL int hdd Files int i ret e Shell Processes uinti6 dat a i All Processes double fds i d init struct tir i amp gatekeeper double dur d pdflush uint32 clk pdflush DOSETCLK c k amp kswapd float actu kthreadd eB ajo omoes nfsiod be e ksoftirqdjo fai Problems Ez Tasks events O No consoles to display at th amp khelper d Kkblockdjo sdcard p d hid compat y amp rpciod O0 g inetd amp sh khubd P amp dropbear amp sh C 15 g E My Processes t Pme Connection UEIPAC Host name 192 168 100 2 UEIPAC SDK User Manual United Electronic Industries The High Performance Alternative Righ click on UEIPAC Ssh Terminals and select Launch Terminal to open a remote shell session on the UEIPAC C C Sample201 Sample201 c Eclipse Platform File Edit Refactor Navigate Search Run Project Window Help m i g 8 id G i amp 9 35 0 Qq mo v m D Planning Qr da CVs Reposito E 6 Samplez01 c 23 L Makefile BE Outlin 23 make Hw Project Explorer 25 ES P include ParseParams h G tS Sample201 Al stdio h 8 i Includes m IM sanalh E Samplez01 c int stop B sched h M amp T gt Mabafila netinet in h i 52 unistd h iB Remote RSS void handler int sig BA sysjtime h A3X w B 3 ox Mb PDNA h
3. Seita ena 23 4 6 Windows shared directory aj caacustieniauerescegsabiotienansieuuhcecetesdeapscaesen ven smencenslarnsttatens 23 5 Connecting USB devices sisisssssssscsssssccescascccccdsccescapascsasnassesadensscosennes 24 5 USB M ss io RENI 24 5 2 Wifi network interface ERN 25 Load kernel ANU MO 25 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative Connection to an open access point spassssescacccssininsapasiansdusdersoddsanniessiadeutsiovesdecsntesaawsens 26 Connection to an access point with WEP security eese 26 Connection to an access point with WPA WPA2 security ceseeeeeeeeee 27 Direct connection to another computer in ad hoc mode esses 28 Dida ILES Eos i Mm deM NO E E REA 28 luis RC 28 Manual Con UBT ARNO eee enar WROA TREE FEAR a NNI MM x EOSDEM RN NDA 29 FI Eee IU Ne 31 34 duo tc 3l Load Kernel MOGUIGS eb T 32 Automatic SEAN BUDD Nm 32 SER MAS ETE 32 lico MET d e 33 Write a program using BBUSD usare ater rt a E RE KERN ERR p uuD Sn Pai i 33 NE duci m 34 Dl UEI Seal Servet ccce M NUR seaman CEU EM UM UNE R 34 6 2 Using the CPU layer s serial port for general purpose esses 36 7 Testing the D O Iayersuiisxsexeexvadkesexsdevivi serian era prier DUO esa dokn nre Ryi nodo 37 ps ME oo e
4. Wait for the next event if no event occur or after 2 seconds the function returns the event DqEmbEventTimeout DqEmbWaitForEvent handle 2000 amp event 45 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative Cancel the timer event DqEmbCancelEvent handle DqEmbEventTimer Refer to Appendix B for detailed documentation of each event API function Unsupported APIs All other APIs than the one mentioned above are not supported on the UEIPAC This includes all the ACB DqACB DMAP DqDmap MSG DqMsg and M3 DqMmm APIs Building and running the examples Change your current directory to lt UEIPAC SDK directory gt sdk DAQLib_Samples and type make to make sure that your setup can build the samples correctly If you get any error while building the examples check that the path to the cross compiler is in your PATH environment variable and that the environment variable UEIPACROOT is set to the SDK directory You can now transfer any of the built examples to the UEIPAC using FTP and run it Each example accepts command line options to specify the following parameters e d device id specify the device e c channel list specify the channel list e f frequency specify the rate e n number of Scans specify the number of samples per channels For example the following command r
5. modprobe ppp PPP generic driver version 2 4 2 Configure provider The system is pre configured to connect to AT amp T network If you are using a different provider edit the file etc ppp peers gsm_chat 29 a United Electronic b d Industries The High Performance Alternative Look for the following line AT CGDCONT 1 IP ISP CINGULAR OK Replace it with the APN Access point name of you provider UEIPAC SDK User Manual For example T mobile s APN is epc tmobile com so the line in letc ppp peers gsm chat becomes AT CGDCONT 1 IP EPC TMOBILE COM OK APNs for a few European countries Country Provider APN Authentication Phone User Password Number Austria Al at cgdcont 1 IP al net PAP CHAP QO ppp GAlnetat ppp Belgium Mobistar att cgdcont 1 IP web pro be Terminal based 99 mobistar mobistar France Orange at cgdcont 1 IP orange fr Terminal based 99 orange orange Germany D2 at cgdcont 1 IP web vodafo PAP CHAP OO IH none none Vodafone ne de Netherlands KPN at cgdcont 1 IP internet Terminal based 99 1 Internet none Netherlands Orange at cgdcont 1 IP internet Terminal based 99 1 none none 0 0 Netherlands Vodafone at cgdcont 1 IP web vodafo Terminal based 99 vodafone vodafone ne nl Start PPP daemon Issue the following comm
6. configur host powerpc 604 linux gnu build i686 pc linux gnu prefix root file system Use the following command on a Window Cygwin PC 54 UEIPAC SDK User Manual y x United Electronic Industries The High Performance Alternative configur host powerpc 604 linux gnu build i686 pc cygwin prefix root file system The configure script will then verify that the UEIPAC cross compiler is operational and create the Makefiles required to build the software package To build type make To install the built binaries type make install 10 2 Other software Read the README and INSTALL files that often come with open source packages for instructions about cross compiling If there are no configure script and no instructions you might still be able to build a software package to run on the UEIPAC with the command CC powerpc 604 linux gnu gcc LD powerpc 604 linux gnu ld RANLIB powerpc 604 linux gnu ranlib make 55 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative Appendix A RTMAP API a DqRtDmapIinit Syntax int DgRtDmapInit int handle int dmapid double refreshRate Input int handle Handle to the IOM int dmapid The identifier of the newly created DMAP double refreshRate Rate at which the IOM will refresh its version of the DMAP Return DQ ILLEGAL HANDLE invalid IOM handle DQ NO MEMORY memory allocation
7. ttyUEI1 ipAddress 127 0 0 1 device 2 port 1 mode 0 baudRate 57600 parity 1 stopBits 1 dataBits 7 This example configuration file configures the serial server to return an error if it cannot communicate with the IOM after timeoutms milliseconds The server can retry communication for retrycount times before giving up The server will periodically poll serial ports for new incoming data using the 34 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative pollperiodms value to specify the period in milliseconds This file creates two virtual serial ports dev ttyUEIO and dev ttyUEII to control physical ports 0 and 1 on device 2 located on the UEIPAC dev ttyUEIO is configured to run at 9600 bits per sec no parity no stop bits and 8 data bits dev ttyUEII is configured to run at 57600 bits per sec parity odd 1 stop bits and 7 data bits Note that the communication settings are only default values The serial port will be re configured to use whatever communication settings you specify when opening the port from your application Run the serial server with the following command ueiserialserver config file name Once the server is started you can use the dev tty UEI nodes like any other serial port with the termios API or any other program designed to access serial ports The UEIPAC comes with microcom installed on its SD card You can run microcom
8. Compiler invocation arguments RE P v dD S plugin_state_location specs cpp V Show output in a dedicated console in the Console view global preference Restore Defaults Apply 6 Click on Apply and the indexer will automatically find all header files next time you build the project d Download program to target Add a Remote Systems view to your current perspective C 6 UEIPAC SDK User Manual y x United Electronic Industries The High Performance Alternative S Show View type filter text gt E Debug gt amp Git gt E Help gt E Make gt amp Mylyn 4 amp Remote Systems 4B Remote Monitor 5 Remote Scratchpad Remote Search E Remote Shell 4 Remote System Details af Remote Systems Gs Team 4E Terminals gt Team Select Remote Systems and Click on OK In the Remote Systems view click the Define a connection to a remote system button C 7 United Electronic Industries The High Performance Alternative Remote System Explorer HelloDNA src HelloDNA c Eclipse SD File Edit Refactor Navigate Search Project Run Window Help iP mi O Q i4 9I 3l 9 Jf Remote Systems 23 5 Team Ci 8 HellDNA c 3 iR E B bd tx Local Shells New Connection Select Remote System Type Any distribution of Linux System type a Jacal Defi ti
9. y x United Electronic b d Industries The High Performance Alternative Appendix G Updating RAM disk image The UEIPAC software CDROM contains a RAM disk image uRamdisk x y z that you can upload to flash and boot from on 1G and R UEIPAC models see section 3 2 This appendix explains how to modify this image to add your own files typically your program and associated configuration files This operation can only be done on a Linux workstation You also need to install the uboot mkimage utility For example with Ubuntu type bash sudo apt get install uboot mkimage 1 Extract compressed RAM disk image from ulmage file The following command converts the file uRamdisk x y z to ramdisk gz bash dd if uRamdisk x y z bs 64 skip 1 of ramdisk gz 21876 1 records in 21876 1 records out 2 Un compress RAM disk image bash gunzip v ramdisk gz ramdisk gz 66 6 replaced with ramdisk 3 Mount RAM disk image bash mount o loop ramdisk mnt tmp Now you can add remove or modify files in the mnt tmp directory Once you are done you can re pack the RAM disk into a U Boot image 1 Un mount RAM disk image bash umount mnt tmp 2 Compress RAM disk image bash gzip v9 ramdisk ramdisk 66 6 replaced with ramdisk gz 3 Create new U Boot image G 30 UEIPAC SDK User Manual United Electronic Industries The High Performance Alternative bash mkimage T ramdisk C gzip n UEIPAC RAM disk d ramdi
10. y x United Electronic b d Industries The High Performance Alternative b Configure and build the kernel for UEIPAC 300 and UEIPAC 600 E 26 c Configure and build the kernel for UEIPAC 300 1G UEIPAC 600 1G and RACK WETS TOUS NETT NOD E 26 Appendix F Converting root file system to read only F 28 Modify RFS n SD Waid e F 28 b Configure UDOOt qr F 29 Appendix G Updating RAM disk image eere G 30 Appendix H Bonding Teaming Ethernet ports H 32 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative 1 Introduction The UEIPAC extends the capability of the PowerDNA and PowerDNR distributed data acquisition systems With the UEIPAC you can create programs that will execute directly on the PowerDNA or PowerDNR hardware You can create standalone applications that don t require any host PC to control and monitor your hardware A Linux kernel replaces the standard DAQBIOS firmware in flash memory and uses a SD Card as its local file system This file system contains the other components of the operating system such as libraries utilities init script and daemons After power up you have a ready to go Linux operating system with FTP and web servers as well as a command line shell accessible from either the serial port or telne
11. Enter root as User ID and Password C 13 a vY The High Performance Alternative United Electronic Industries C C Sample201 Sample201 c File Edit Refactor Navigate Search Run Project W ita 4 1 z 23 05 Eclipse PI im Gr 8 lijd G ee Sample201 E i Includes Project Explorer x Ne HJ Sample201 O emnes 7B incrua fe amp Sample201 c int sto Makefile Sample201 m ff ata lt void ha sto EF gt E Local By Local Files KU zzz tx Local Shells d amp 4YN verpac int mai awh PDN HF My Home int gt Root int e uin H O bin lt 2 ia f Problems E 9 home FIP log 192 16 H O lib NOOP H O lost found 200 NOOP c 4 9 proc 4 4 sbin NOOP aoe sys 200 NOOP c tmp H O usr NOOP O var 200 NOOP c LD www nm BF en on UEIPAC SDK User Manual Select UEIPAC Shell Process All Processes to view the processes running on the UEIPAC C 14 UEIPAC SDK User Manual y x United Electronic Industries The High Performance Alternative E C C Sample201 Sample201 c Eclipse Platform File Edit Refactor Navigate Search Run Project Window Hi m uJ a d G 14 gt Sample201 c 33 NL 2 include Pars A Sample201 c ame SEOD L6 Makefile B Sample201 Handler for Sample201 0 TT nanitenja stop 1 QU
12. Ju JUnit Plug in Test Z Jython run Remote Absolute File Path for C C Application Z5 Jython unittest tmp Sample207 4 OSGi Framework Z Python Coverage y Python Run M n r Filter matched 15 of 15 items E Skip download to target path 9 Enter a name for this new launch configuration Set the Connection to UEIPAC previously defined Verify that the project is set properly or press Browse to select the right project Verify that the C C Application is set to the binary built from your project Set the Remote Absolute File Path to the path of the executable on the remote target Press Run to download the binary to the UEIPAC and execute it You will see the result in the Console C 17 UEIPAC SDK User Manual United Electronic Industries The High Performance Alternative r EE C C Sample207 Sample207 c Eclipse SDK ESI File Edit Refactor Navigate Search Run Project Window Help n us g d S E G 4 9 0 Q EE Bgg Iei Hrga v y R gt Project Explorer 23 A Sample207 c 8 NL El 8 amp Outli 2 _ 8 Mak 8 BSle a elZ awe S Sample201 be BM stdioh 7 P NAME Sample207 c a A E E5 Sample207 s BM signal h e ED Includes ini FA sched h E ESURIPIION A Sample207 c B netinet in h L Makefile Test A1 207 specific comm M unistd h Sample207 H fA sys time h
13. dev unsigned short rawBuffer int bufferSize Input int handle Handle to the IOM int dmapid Identifier of the DMAP int dev ID of the device where the channels are located int bufferSize Number of elements in rawBuffer Output unsigned short rawBuffer The buffer containing the raw data Return DQ ILLEGAL HANDLE invalid IOM handle DQ BAD DEVN there is no device with the specified number DQ SUCCESS command processed successfully Description Read raw data from the specified device as 16 bits integers Note The data read is the data transferred by the last call to DgRtDmapRefresh B 4 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative This function should only be used with devices that acquire 1 6bits wide digital data such as the AI 201 i DgRtDmapReadRawData32 Syntax int DqRtDmapReadRawData32 int handle int dmapid int dev unsigned int rawBuffer int bufferSize Input int handle Handle to the IOM int dmapid Identifier of the DMAP int dev ID of the device where the channels are located int bufferSize Number of elements in rawBuffer Output unsigned int rawBuffer The buffer containing the raw data Return DQ ILLEGAL HANDLE invalid IOM handle DQ BAD DEVN there is no device with the specified number DQ SUCCESS command processed successfully Description Read raw data from the specified device as 32 bits integers Note The da
14. gt gt tmp crontest 49 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative 9 Firmware installation and upgrade 9 1 Installing or upgrading the Linux kernel Your UEIPAC comes with the Linux kernel already installed into flash memory It is possible to update that Linux kernel if needed You first need to install a TFTP server on your host PC and copy the new kernel image you got from UEI technical support in the TFTP server s directory Kernel image files are are named e culmage ueipac5200 for the UEIPAC 300 and UEIPAC 600 e culmage ueipac834x for the UEIPAC 300 1G UEIPAC 600 1G UEIPAC 600R and UEIPAC 1200R You can find the image of the Kernel that shipped with your UBIPAC in the folder lt UEIPAC SDK directory gt kernel That same folders also contains scripts to download the kernel sources and build the kernel yourself see Appendix E Connect to the UEIPAC through the serial port and power up the cube Press a key before the 2 seconds countdown ends to enter U Boot s command line interface UEIPAC with Freescale 5200 CPU 100MBit Ethernet 1 Erase unprotected part of flash memory erase ffd50000 ffefffff 2 Configure the UEIPAC s IP address setenv ipaddr IP address of the UEIPAC 3 Configure U Boot to use your host PC as TFTP server setenv serverip IP address of your host PC 4 Download the new kernel from the TFTP server tftp 200000
15. inet addr 166 203 211 199 P t P 10 64 64 64 Mask 255 255 255 255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU 1500 Metric 1 RX packets 14 errors 0 dropped 0 overruns 0 frame 0 TX packets 15 errors 0 dropped 0 overruns 0 carrier 0 collisions 0 txqueuelen 3 RX bytes 182 182 0 B TX bytes 257 257 0 B Make sure that pppO was assigned an IP address You can now connect to the internet from your UBIPAC Automatic startup To automatically load the kernel modules edit the file etc modules and add the following lines at the end of the file sierra PPP To automatically start the ppp daemon add a symbolic link to etc init d pppd in the directory etc rc d with the following command 1n s etc init d pppd etc rc d S30pppd 5 4 Serial Port The UEIPAC comes with driver for USB serial devices based on the Prolific PL 2303 chipset 31 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative Load kernel modules At the command line prompt type the following modprobe p12303 You will see the following messages printed on the serial console type dmesg to see those messages when logged in via telnet or ssh usbcore registered new interface driver usbserial USB Serial support registered for generic usbcore registered new interface driver usbserial generic usbserial USB Serial Driver core USB Serial support registered for pl12303 p12303 1 5 1 1 0 p12303 converter d
16. j dev sdbl 7 CD to a temporary directory and untar the root file system cd tmp sudo tar xvfz UEIPAC SDK directory rfs tgz 8 Mount the new partition on some Linux distributions it might already be mounted check with the command df then copy the root file system to the SD card sudo mount dev sdbl mnt sudo cp rd tmp rfs mnt 9 Unmount the SD card and insert it in the UEIPAC It is now ready to boot sudo umount dev sdbl 52 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative On the UEIPAC itself Boot the UEIPAC from the RAM disk instead of the SD card follow instructions detailed in chapter 3 2 1 Set the IP address setip IP address of the UEIPAC 2 Format the SD card mke2fs j dev sdcardl 3 Mount the SD card mount dev sdcardl mnt 4 Transfer the root file system image to the UEIPAC from a Linux or Windows PC scp rfs x y z tgz root lt IP address of UEIPAC gt mnt 5 Un compress the image gunzip mnt rfs x y z tgz tar xvf mnt rfs x y z tar mv mnt rfs mnt Sync 9 3 Running the standard DAQBios firmware Starting with the 2 0 release UEIPACs come with both a Linux kernel and DAQBios firmware loaded in flash You can select which one you want to run by setting a configuration variable in the u boot boot loader Connect to the UEIPAC through the serial port and power up the cube Press a key before the 2 seconds co
17. 1 phys 0030279 0 02 0c 05 7 2 Runexamples All the examples were compiled during the install process and are ready to be transferred and executed Compiled versions of each example are also available on the UEIPAC file system in the usr local examples directory There is one example for each supported I O layer named SampleX XX where XXX is the model ID of each layer Go to the directory lt UEIPAC SDK directory gt sdk DAQLib_Samples and copy the chosen example to your UEIPAC using one of the methods described in section 4 For example using FTP ftp lt UEIPAC IP address gt bin cd tmp put SampleXXX The example by default uses the first I O layer device 0 You can change the device using command line options Here are a few of the options available h display help d n selects the device to use default 0 f n nn set the rate of the DAQ operation default 1000 Hz cC X y Z select the channels to use default channel 0 For example the following command run the AI 207 test program using device 2 and channels 3 5 and 7 tmp 4 Sample207 d 2 c 3 5 7 37 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative There are 3 channels specified 3 5 7 0 ch3 bdata 310dfff6 fdata 15 781501V 0 ch5 bdata 310dfff7 fdata 15 781501V 0 ch7 bdata 310dfff6 fdata 15 781501V 1 ch3 bdata 310dfff6 fdata 15 781501V 1 ch5 bdata 310dfff6
18. EP Local Stop E BA ParseParams h E s Local Files stop int 1 Handler for SIGINT LI a a L Li v P Local Shells 3 handler int void S L uerrac i E ee th Files E Problems Z Tasks EJ Console E Properties S Terminals amp E Ee My Home SSS J HE Mud Puerpac 5 LT E gj Shell Processes T Ssh Shells amp ul Ssh Terminals E UEIPAC BusyBox v1 13 3 2009 04 29 09 50 58 EDT built in shell ash Enter help for a list of built in commands cd tmp tmp Sample201 e Execute program Select the Run Show Run Dialog menu option to open the Run dialog box Select the C C Remote Application option and press the New button to create a new remote launch configuration C 16 UEIPAC SDK User Manual United Electronic Industries The High Performance Alternative r S Run Configurations o Create manage and run configurations Q Ee i x El Sr Name Sample207 LE Ma ain t Arguments s Debugger Ey Source EI Common E C C Local App nS ns P EGET e E C C Remote A Connection UEIPAC New Properties J c Sample201 Sample207 Project Eclipse Applicatio Sample207 Browse E Java Applet C C Application type filter text G Java Application Ju JUnit CACygwin home frederic uei ueipac 2 0 0 sdk DAQLit Search Project Browse
19. Get pointer to the beginning of the input data map allocated for the specified device d DqRtDmapGetinputMapSize Syntax int DgRtDmapGetInputMapSize int handle int dmapid int dev int mapSize Input int handle Handle to the IOM int dmapid Identifier of the DMAP int dev ID of the device where the channels are located Output mappedSize size in bytes of the device s input data map Return DQ ILLEGAL HANDLE invalid IOM handle DQ BAD DEVN there is no device with the specified number DQ SUCCESS command processed successfully Description Get the size in bytes of the input map allocated for the specified device B 2 UEIPAC SDK User Manual y x United Electronic Industries The High Performance Alternative e DgRtDmapGetOutputMap Syntax int DgRtDmapGetOutputMap int handle int dmapid int dev unsigned char mappedData Input int handle Handle to the IOM int dmapid Identifier of the DMAP int dev ID of the device where the channels are located Output mappedData pointer to the beginning of the device s output DMAP buffer Return DQ ILLEGAL HANDLE invalid IOM handle DQ BAD DEVN there is no device with the specified number DQ SUCCESS command processed successfully Description Get pointer to the beginning of the output data map allocated for the specified device f DqRtDmapGetOutputMapSize Syntax int DgRtDmapGetOutputMapSize int handle int dmapid int dev int map
20. Next UEIPAC SDK User Manual United Electronic Industries The High Performance Alternative New Connection Processes Define subsystem information Properties Property Available Services Shell Process Service Lie 3i Description This configuration allows you to work with processes on remote linux systems using any contributed Shell subsystem We will use a remote shell to control the processes running on the UEIPAC Select processes shell linux and click on Next C 11 UEIPAC SDK User Manual y x United Electronic Industries vY The High Performance Alternative New Connection Shells Define subsystem information Configuration Properties C dstore shells Property ssh shells Available Services 22 SSH Shell Service ESI 55H Connector Service Description SSH Connector Service Description We will use SSH as remote shell to control the UEIPAC Select ssh shells and click on Finish The UEIPAC will now appear in the Remote Systems pane on the left Let s test the connection by navigating files on the UEIPAC file system Click on UEIPAC Files Root C 12 UEIPAC SDK User Manual y x United Electronic Industries The High Performance Alternative Enter Password System type Linux Host name 192 168 100 2 User ID root Password dette Save user ID
21. and patch kernel source At a command prompt change the current directory to lt UEIPAC SDK directory gt kernel The UEIPAC kernel includes Xenomai real time extension The first step is to download and build Xenomai Run the build_xenomail sh script build xenomai sh Then run the get kernel sh script with the option cpu set to the CPU of your UEIPAC For UEIPAC 300 UEIPAC 600 get kernel sh cpu 5200 For all other UEIPACs get kernel sh cpu 834x This script might take a long time to execute depending on the speed of your internet connection Once the script is finished you will find a new directory linux DENX v2 6 28 5 containing the kernel source with Xenomai and UEIPAC patches applied E 25 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative b Configure and build the kernel for UEIPAC 300 and UEIPAC 600 Change the current directory to the linux source directory 1 Configure kernel with default settings make ARCH powerpc CROSS COMPILE powerpc 604 linux gnu 52xx ueipac5200 defconfig 2 Customize kernel configuration make ARCH powerpc CROSS COMPILE powerpc 604 linux gnu menuconfig 3 Compile the kernel make ARCH powerpc CROSS COMPILE powerpc 604 linux gnu cuImage ueipac5200 You can find the build kernel in arch powerpc boot culmage ueipac5200 c Configure and build the kernel for UEIPAC 300 1G UEIPAC 600 1G and RACK versions Change
22. consists of information about all the USB devices that are connected to the computer LibUSB makes use of this filesystem to interact with the USB devices Mount USBFS manually Type the following command to mount USBFS mount t usbdevfs none proc bus usb Mount USBFS automatically Add the following line to etc fstab to automatically mount USBFS at boot time none proc bus usb usbfs defaults 0 0 Write a program using libusb The UEIPAC ships with a simple example showing how to enumerate USB devices and query information SampleLibUSB LibUSB API documentation is available at http www libusb org 33 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative 6 Serial Port 6 1 UEI Serial Server UEFI Serial Server makes PowerDN x serial devices such as SL 501 and SL 508 accessible as standard Linux serial ports that can be programmed using the POSIX termios API The mapping configuration file is a text file with a settings section for global paremeters and a ttyUEI section for each mapped serial port For example settings timeoutms 1000 retrycount 4 pollperiodms 10 ttyUEI0 ipAddress 127 0 0 1 device 2 port 0 mode 0 RS 232 1 RS 485HD 2 RS 485 FD mode 0 baudRate 9600 parity O none l odd 2 even parity 0 Fstop Bi stopBits tdata bi dataBits O no stop bit 1 1 stop bit 2 1 5 stop bit 5 6 7 or 8 data bits ct Ww ct S 0 S 8
23. error or exceeded maximum table size DQ SUCCESS command processed successfully Description Initialize the specified IOM to operate in DMAP mode at the specified refresh rate b DqRtDmapAddChannel Syntax int DqRtDmapAddChannel int handle int dmapid int dev int subsystem uint32 cl int clSize Input int handle Handle to the IOM int dmapid Identifier of the DMAP int dev ID of the device where the channels are located int subsystem The subsystem to use on the device ex DQ SSOIN uint32 cl Array containing the channels to add to the DMAP int clSize Size of the channel array Return DQ ILLEGAL HANDLE invalid IOM handle DQ BAD DEVN there is no device with the specified number DQ BAD PARAMETER the subsystem is invalid for this device DQ SUCCESS command processed successfully Description Add one or more channels to the DMAP B 1 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative c DqRtDmapGetInputMap Syntax int DgRtDmapGetInputMap int handle int dmapid int dev unsigned char mappedData Input int handle Handle to the IOM int dmapid Identifier of the DMAP int dev ID of the device where the channels are located Output mappedData pointer to the beginning of the device s input DMAP buffer Return DQ ILLEGAL HANDLE invalid IOM handle DQ BAD DEVN there is no device with the specified number DQ SUCCESS command processed successfully Description
24. fdata 15 781501V 1 ch7 bdata 310dfff6 fdata 15 781501V All examples are configured to stop when they receive the SIGINT signal You can send this signal by typing CTRL C or with the following command if the program runs in the background of if you are logged on a different console than the one running the program killall SIGINT Sample207 7 3 PowerDNA server PowerDNA server emulates the behavior of a PowerDNA IO module running the standard DAQBIOS firmware It emulates a subset of the DAQBIOS protocol so that the UEIPAC can be accessed from PowerDNA explorer or the PowerDNA C API It only works in immediate RTDMAP and RTVMAP modes ACB Messaging and Asynchronous modes are not supported To run the PowerDNA server type the command pdnaserver amp 38 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative 8 Application development 8 1 Prerequisites Make sure that the directory lt UEIPAC SDK directory gt powerpc 604 linux gnu bin is added to your PATH environment variable This will allow you to invoke the GCC cross compiler without having to specify its full path It is required to run the different Makefiles that build the PowerDNA library and the examples this should have been done automatically by the install script 8 2 Compiling and running Hello World The UEIPAC SDK comes with the GNU toolchain compiled to run on your host PC and build binaries t
25. initialize an SD card This is required because the SD card must be formatted with the ext2 file system Make sure automatic mounting is disabled for removable medias 1 Insert the SD card in a USB adapter connected to your host PC 51 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative 2 Find out the name of the device node associated with the card Type the command dmesg and look for a message at the end of the log similar to SCSI device sdb 1984000 512 byte hdwr sectors 1016 MB This message tells us that the device node we are looking for is dev sdb 3 Un mount the SD card if necessary sudo umount dev sdbl 4 Erase all partitions from the SD card and create one primary partition using all the space available on the card the example below uses a 1GB card with 1016 cylinders use whatever default value is suggested for the last cylinder fdisk dev sdb Command m for help d Selected partition 1 Command m for help n Command action e extended p primary partition 1 4 P Partition number 1 4 1 First Cylinder 1 1016 default 1 1 Last Cylinder 1 1016 default 1016 1016 Command m for help w 5 Un mount the SD card if necessary sudo umount dev sdbl 6 The device node associated with the partition we just created is dev sdbl Let s format this new partition with mke2fs j option sets file system type to ext3 sudo mke2fs
26. non related part of the file system Files which never get written and which may even be marked in the file system as read only such as files in sbin or lib can still become corrupted The file system will issue writes in a minimum size typically 4KB and a single 4KB block may have data in it that is part of two different files Those two files might even be in different directories or have different access permissions Thus a simple write to a log file can result in a read and rewrite of part of any file on the partition When power goes down in the middle of that rewrite the result is silent data corruption File systems also have to modify a lot of metadata in various places in order to just create a one byte file A power failure during that operation could for example destroy the names of several other files There are three ways to set up the UEIPAC to ensure that it survives an un controlled power failure e Set up the root file system on a read only partition and store temporary files in a RAM disk This method ensures that the UEIPAC will always boot unless the SD card itself becomes un operational because of wear out or random failure It consumes a little bit of memory to store temporary files log files lock files etc e Load the root file system as a RAM disk This method is more robust but consumes more memory around 10 MBytes and only works on UEIPAC 1G Gigabit Ethernet and R Racks models The UEIPAC wi
27. r NEUE e ERR aa 16 Bootes from au NES Share oscar pope t eS RU e E NM NK A a ERR exci K Rd 17 33 Configuring thie NetWork petite tont RUEDAS IU EI aE E E BER AM NUR 17 Configuring a static IP address isi i peo possent ben bel e NAR up HN AREE P A NU UE LERM M 17 Changing the default packet size ML LU uses tae Eh xa berE FEX eA pna kta eR Rb AMIFEHE E SEE n rE pra MAL 18 Configuring dynamic IP address using a DHCP server esee 18 Name TSS AMOI Me T 18 Connecting thro gh TS Sl pcm 18 Connecting thro gh SSH Lois Gp De ieceanesah HH DIN IRE M mp EM BE MU EIE 18 3 4 Configuring Date and Time Loose ee RUPRADU EN ctia quim con Vbi MEE MER UE 19 Chiang die Ule uuu sme aie qe pH TUE n MA MUNDI M M EE Man E M M RUE 19 Changing the tim Zone 2 eesac qeu pa PE Gun e bete x ad nuage VE RM n er aui 19 Connecting to a NTP Server utpote ne HMM IE d E p EN BE M ME 20 Soc Changing the ASS WOLD a ceased tei dd aioe accede cca 20 30 Configuring TNE WED SV usps e tetur ass RR E NDA SIN URN Ee Rab E PER Saaai 20 LNMNEE A OA CL E 20 Ay Transferring DIIS istessse verse Cox p iv eav bru F v eu E ERR R EE VEA E EERVP DTE OD EUER sesso RISE UUE 22 S EE IU p 22 42 RVPAC LI cC 22 4 3 FIP SGU VET P 22 BA S iden 22 AS TETP Mt aoe wise edad sted
28. ESSE E NI CREDAM Ei 53 9 3 Running the standard DAQBios firmware eee 53 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative Configure UEIPAC with Freescale 5200 CPU to run DAQBios firmware 53 Configure UEIPAC with Freescale 5200 CPU to run Linux esses 53 Configure UEIPAC with Freescale 8347 CPU to run DAQBios firmware 54 Configure UEIPAC with Freescale 8347 CPU to run Linux esses 54 10 Install open source software eeee eere eere eee eerte nenne enun 54 10 1 Software coming with an autoconf configure script eese 54 10 2 Other eic t cc 55 Appendix A REMAP APT sisciscsssenassscicssisseuisnssnsseraveasesienstesseusnistessesdeviews B 1 a DGD icr T NONO pM an B 1 b Dalstbmapaddehadinel dme riesco Dok pii ere td iu ee sdta arb lag edad Do iD ei B 1 SA pp Gre CI jc T B 2 DRED are GE UN AS NP B 2 e DqRtDmapGetOutputMap c B 3 IDghtDmapOetOutputlVADpOT7B asdieidepresiend doi ed padap HR dental anb ug epos AS PRI DP ERA B 3 p DgstmaibeadscalsdDatdussoeeipesiditcd da MP eH IHuNRD ae Mrupik ert Eb 2d odd ou ME B 3 h DgstbmapkeasdBawDAtal Os siesieg odd PI ugH TRUE eo Xr en iaa ded Fas atibus nd ida B 4 i DgRtDmapReadRawData32 E B 5 j DER Boni Writes Caled Data C B 5 k DgqRtDmapWriteRawDatal6 P B 6 1 Dg CD nies Write IR a d PST re
29. ESSID of the access point iwconfig wlanO essid name of your access point Bring up wifi interface ifconfig wlanO up If there is a DHCP server on your network get an IP address for your wifi interface udhcpc i wlanO s etc udhcp default script Otherwise assign a static IP address to your wifi interface ifconfig wlanO 192 168 100 3 netmask 255 255 255 0 route add default gateway 192 168 100 1 5 3 UMTS GSM modem The UEIPAC comes with drivers for Sierra Wireless modems The UEIPAC supports USB modems connected to the UEIPAC USB port and embedded mini pci express modems connected to a CAR 550 carrier card This manual focuses on using a Sierra wireless MC8790 card that offers UMTS HSPA and quad band GSM GPRS EDGE network access for roaming on high speed networks worldwide Prerequisite You need to purchase a data plan with a cell phone provider that supports UMTS and or GSM GPRS ATT and T Mobile provide such a service in the USA 28 UEIPAC SDK User Manual United Electronic Industries The High Performance Alternative Once you purchased a data plan you will receive a SIM card that you need to insert in the CAR 550 before being able to establish a connection Don t forget to activate your account as soon as you receive your SIM card usually done over the phone or on line Manual configuration From the UEIPAC point of view the wireless modem is seen as a serial port to which it can
30. High Performance Alternative DqRtVmapInit handle vmapid 1000 0 Add channels from the first input subsystem of device 0 int channels 0 1 2 3 DqRtVmapAddChannel handle vmapid 0 DQ SSOIN channels flags 1 Start all devices that have channels configured in the VMAP DqRtVmapStart handle vmapid Specify how much input data to transfer during the next refresh DgRtVmapRqInputDataSz handle vmapid 0 numScans sizeof uintl6 amp act size NULL Synchronize the VMAP with all devices DqRtVmapRefresh handle vmapid Retrieve the data acquired by device 0 DqRtVmapGetInputData handle vmapid 0 numScans sizeof uint160 amp data size amp avl size uint8 bdata Stop the devices and free all resources DqRtVmapStop handle vmapid DqRtVmapClose handle vmapid Event API The event API only works when running your program on a UEIPAC You can t call any event function when communicating with PowerDNA over Ethernet The event API allows you to get notified in your application when a hardware event occurs The hardware events are e SyncIn event a digital edge was sensed on the syncin pin of the Sync connector e Timer event occurs at each tick of a hardware timer located on the CPU layer Here is a quick tutorial on using the event API handling of error codes is omitted Configure hardware timer to generate an event every millisecond DqEmbConfigureEvent handle DqEmbEventTimer 1000
31. I handling of error codes is omitted Initialize the DMAP to refresh at 1000 Hz DqRtDmapInit handle amp dmapid 1000 0 Add channel 0 from the first input subsystem of device 1 chentry 0 DqRtDmapAddChannel handle dmapid 1 DQ SSOIN amp chentry 1 Add channel 1 from the first output subsystem of device 3 chentry 1 DqRtDmapAddChannel handle dmapid 3 DQ_SSOOUT amp chentry 1 Start all devices that have channels configured in the DMAP DqRtDmapStart handle dmapid Update the value s to output to device 3 outdata 0 5 0 DqRtDmapWriteScaledData handle dmapid 3 outdata 1 Synchronize the DMAP with all devices DqRtDmapRefresh handle dmapid Retrieve the data acquired by device 1 DqRtDmapReadScaledData handle dmapid 1 indata 1 Stop the devices and free all resources DqRtDmapStop handle dmapid DqRtDmapClose handle dmapid Gi t Refer to Appendix A for detailed documentation of each RTDMAP function VMAP API In VMAP mode the UEIPAC continuously acquires updates data in buffers Each layer is programmed to acquire update data to from its internal FIFO at a rate paced by its hardware clock The content of all the layer s FIFOs is accessed in one operation Supported APIs to use VMAP mode are DqRtDmap and DqRtV map Initialize the VMAP to acquire generate data at 1kHz 44 UEIPAC SDK User Manual United Electronic Industries The
32. OU BER B Main 9 Arguments 35 Debugger gt Source E Common C C Local Applica Debugger remote gdb mi fe C C Postmortem E C C Remote Appl V Stop on startup at main E Sample201 c Sample207 Debugger Options Eclipse Application Main Shared Libraries Gdbserver Settings E Java Applet 3 Java Application GDB debugger powerpc 604 linux gnu pdb Ju JUnit Ji JUnit Plug in Test GDB command file gdbinit Z Jython run Warning Some commands in this file may interfere with the startup operation of 25 Jython unittest the debugger for example run OSGi Framework Protocol Default v p Python Run 2 Python unittest m Remote Java Applica i 7 r Filter matched 17 of 17 items Click on Debug to download the program to the UEIPAC and start debugging it Eclipse will suggest that you switch to the Debug perspective click on Yes C 19 UEIPAC SDK User Manual y x United Electronic Industries The High Performance Alternative r Confirm Perspective Switch o This kind of launch is configured to open the Debug perspective when it suspends i This Debug perspective is designed to support application debugging It incorporates views for displaying the debug stack variables and breakpoint management Do you want to open this perspective now Remember my decision The debugg
33. PowerDNA Driver version 2 1 0 Address Irq Model Option Phy Virt S N Pri LogicVer 0xc9080000 7 201 100 phys 0027153 0 02 09 03 0xc9090000 7 308 1 phys 0028647 0 02 0e 00 0xc90a0000 E 207 1 phys 0030353 0 02 0c 05 0xc9050000 7 205 1 phys 0023120 O 02 09 03 0xc90c0000 7 403 1 phys 0034744 0 02 0e 00 0xc90d0000 7 503 1 phys 0025808 0 02 09 03 OK BusyBox v1 13 3 2009 04 29 09 50 58 EDT built in shell ash Enter help for a list of built in commands e You can now navigate the file system and enter standard Linux commands such as ls ps cd 3 2 Root file system Booting from the SD card The UEIPAC ships with the root file system entirely located on the SD card It uses the EXT2 format It is recommended to type the command halt before powering down the UEIPAC and the command reboot to restart the UEIPAC 14 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative If you power down abruptly the UEIPAC the following message will appear at boot time EXT2 fs warning mounting unchecked fs running e2fsck is recommended You must check the file system for errors with the following commands mount o remount ro e2fsck dev sdcardl e2fsck 1 38 30 Jun 2005 dev sdcard clean 702 124160 files 6632 247872 blocks reboot File system corruption Powering down the UEIPAC while it is writing data to a file can cause file system corruption even in a
34. Size Input int handle Handle to the IOM int dmapid Identifier of the DMAP int dev ID of the device where the channels are located Output mappedSize size in bytes of the device s output data map Return DQ ILLEGAL HANDLE invalid IOM handle DQ BAD DEVN there is no device with the specified number DQ SUCCESS command processed successfully Description Get the size in bytes of the output map allocated for the specified device g DqRtDmapReadScaledData B 3 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative int DqRtDmapReadScaledData int handle int dmapid int dev double scaledBuffer int bufferSize Input int handle Handle to the IOM int dmapid Identifier of the DMAP int dev ID of the device where the channels are located int bufferSize Number of elements in scaledBuffer Output double scaledBuffer The buffer containing the scaled data Return DQ ILLEGAL HANDLE invalid IOM handle DQ BAD DEVN there is no device with the specified number DQ SUCCESS command processed successfully Description Read and scale data stored in the input map for the specified device Note The data read is the data transferred by the last call to DqRtDmapRefresh This function should only be used with devices that acquire analog data such as the AI 2xx serie h DqRtDmapReadRawData16 Syntax int DqRtDmapReadRawDatal 6 int handle int dmapid int
35. UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative UEIPAC Software Development Kit User Manual 2 6 0 September 2014 Edition Copyright 2014 United Electronic Industries Inc All rights reserved No part of this publication may be reproduced stored in a retrieval system or transmitted in any form by any means electronic mechanical by photocopying recording or otherwise without prior written permission UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative Table of contents 1 J teoducliODh sess ccasedensnstscusicnsacsedisasesietnad seuss daavansapssabatnsapnateaiavaveionctsnants 6 2 Setting up a development SysteMm ccssccssssscssssscscsscsssssssssscsseess 8 NMEE usc dar M rH tease eames 8 PAM Frist RR NU 10 2 3 SDK directory layout M 10 3 Configuring the UEIPAC sssecccoscoesesseesssesosscsococoseeeseesessssesssseseoo 11 3 1 Connecting through the serial DOU miccsscccsscessasininsyeesaqccecacetsssainanavrsiecetasneesnenasnn 11 BAe Robe system Luise rip o So bet ER daanin a a ES 14 Booting from tlie SD Card socccc cascasva savsveswcdecensiandawsaniaseuupedacicsnnistixstansvstnesatensssakenaais 14 File System COrTUPtION PER 15 Setting up root file system Tead Onl ys scisccccsccsscessnsanaseuvesedecsccesnsoiasaanevyobecseassosesncaannn 16 Booting Irom a RAM ISI aei ie rbi cdeacincaccadwnnvrs bere pasaian
36. X or Sample207 0 m 4 m J gt RL Problems 4 Tasks b Ed Properties BET terminated Sample207 C C Remote Applica Wi 9g 3 amp Ex eS r Bly Far IEEE 0 chi bdata 310c7e3f fdata 7 534247V x af Remote Systems 35 Z 0 ch2 bdata 310f825d fdata 7 546225V 3 AE amp E E S ch3 bdata 310c7e31 fdata 7 535315V co p grr E ch4 bdata 310f8255 fdata 7 545614V 4 E Local kN Local Files ch5 bdata 310c7e2f fdata 7 535467V ch6 bdata 310f8255 fdata 7 545614V tx Local Shells ch7 bdata 310c7e36 fdata 7 534933V 4 Y UEIPAC th Files chO bdata 310f824c fdata 7 544928V F Shell Processes Chi bdata 310c7e3e fdata 7 534323V z Ssh Shells ch2 bdata 310f825d fdata 7 546225V 3 Ssh Terminals Ch3 bdata 310c7e2f fdata 7 535467V ch4 bdata 310f825a fdata 7 545996V m f Debugging your program on the UEIPAC The UEIPAC examples are already compiled with debug information Make sure that your program does too add the option g to the compiler flags Select the Run Show Debug Dialog menu option to open the Debug dialog box Select the C C Remote Application Sample201 previously created In the Debugger tab set GDB debugger to powerpc 604 linux gnu gdb C 18 UEIPAC SDK User Manual United Electronic Industries The High Performance Alternative 3 X T NENNEN z Create manage and run configurations 1 B E 3 a x iE a Name Sample207 type filter text E
37. ad RAM disk tftp 4000000 uRamdisk x y z 6 On 8347 based CPUs copy the RAM disk to flash erase fe200000 fe7fffff cp b 4000000 fe200000 S filesize 7 Update bootargs variable to tell the kernel that its root file system is a RAM disk For 5200 based UEIPAC setenv bootargs console ttyPSC0 57600 root dev ram0 rw 16 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative For 8347 based UEIPAC setenv bootargs console ttyS0 57600 root dev ramO0 rw 8 Change boot command to unpack the RAM disk in memory before starting the kernel For 5200 based UEIPAC RAM disk must be loaded from RAM setenv bootcmd bootm ffd50000 4000000 For 8347 based UEIPAC RAM disk can be loaded from flash setenv bootcmd bootm fe000000 fe200000 9 Save environment to make those changes permanent and reset saveenv Booting from an NFS share It is also possible to use an NFS network share to hold the root file system instead of the SD card Refer to appendix D for instructions 3 3 Configuring the Network Configuring a static IP address Your UEIPAC is configured at the factory with the static IP address 192 168 100 2 to be part of a private network You can change the IP address using the following command setip IP address The IP address change takes effect immediately and is stored in the configuration file etc network conf Configuring the auxiliary Ethernet port Note that setip only c
38. and to start the PPP daemon and configure the network connection etc init d pppd start After a few seconds the script will return printing the message OK if it successfully configured the network connection or Failed if it did not etc init d pppd start Starting pppd PPP BSD Compression module registered PPP Deflate Compression module registered In case of failure type the command dmesg to print the log and send that information to UEI technical support Type the command ifconfig to print the network connections currently configured on your UEIPAC There should be three connections local ethO and pppO 30 UEIPAC SDK User Manual United Electronic Industries The High Performance Alternative eth0 Link encap Ethernet HWaddr 00 0C 94 00 C5 CB inet addr 192 168 100 2 Bcast 192 168 100 255 Mask 255 255 255 0 UP BROADCAST RUNNING MULTICAST MTU 1500 Metric 1 RX packets 0 errors 0 dropped 0 overruns 0 frame 0 TX packets 0 errors 0 dropped 0 overruns 0 carrier 0 collisions 0 txqueuelen 1000 RX bytes 0 0 0 B TX bytes 0 0 0 B Base address 0x4000 lo Link encap Local Loopback inet addr 127 0 0 1 Mask 255 0 0 0 UP LOOPBACK RUNNING MTU 16436 Metric 1 RX packets 0 errors 0 dropped 0 overruns 0 frame 0 TX packets 0 errors 0 dropped 0 overruns 0 carrier 0 collisions 0 txqueuelen 0 RX bytes 0 0 0 B TX bytes 0 0 0 B pppo Link encap Point to Point Protocol
39. argeting the PowerPC processor that runs on your UEIPAC The SDK comes with all the familiar GNU tools ar as gcc ld objdump To avoid confusion with a different version of those tools for example a version compiled to run and produce binaries for your host PC their names are prefixed with powerpc 604 linux gnu For example the GNU C compiler is named powerpc 604 linux gnu The following steps will guide you in writing your first program and running it on your UEIPAC 1 Create a file called hello c 2 Edit the file and enter the following text include lt stdio h gt int main int argc char argv printf Hello World from UEIPAC n return 0 3 Compile the file with the command powerpc 604 linux gnu gcc hello c o hello 4 Download the compiled program hello to the cube ftp UEIPAC IP address bin cd tmp put hello 39 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative 5 Login on your UEIPAC using either Telnet or the serial console and type the following commands cd tmp chmod x hello hello You should see the text Hello World from UEIPAC printed on the console 8 3 Debugging Hello World The UEIPAC SDK contains a version of the GNU debugger compiled to run on your host PC and debug binaries targeting the PowerPC processor Its name is powerpc 604 linux gnu gdb It allows you to debug a program remote
40. arted Xenomai real time nucleus v2 4 7 Andalusia loaded Xenomai starting native API services Xenomai starting POSIX services Xenomai starting RTDM services VFS Disk quotas dquot 6 5 1 Dquot cache hash table entries 1024 order 0 4096 bytes msgmni has been set to 247 io scheduler noop registered io scheduler anticipatory registered default io scheduler deadline registered io scheduler cfq registered Generic RTC Driver v1 07 Serial MPC52xx PSC UART driver 0002000 serial ttyPSCO at MMIO 0Oxf0002000 irq 129 is a MPC52xx PSC brd module loaded loop module loaded net eth0 Fixed speed MII link 100FD MPC52xx SPI interface probed at Oxf0000f00 irq0 141 irqi 142 mpc52xx spi init mmc SDCard is now ready mpc52xx mmcO pl mice PS 2 mouse device common for all mice TCP cubic registered 13 UEIPAC SDK User Manual United Electronic Industries The High Performance Alternative NET Registered protocol family 17 EXT2 fs warning mounting unchecked fs running e2fsck is recommended VFS Mounted root ext2 filesystem Freeing unused kernel memory 152k init init started BusyBox v1 13 3 2009 04 13 15 41 06 EDT loading modules pdnabus pdnadev Starting Network Checking Network Configuration OK Loading Static Network Interface OK Checking Network Connection OK Starting inetd OK Starting local script
41. box type hello exe LH Concepts Click Debug 4 Tasks You will now see the debug perspective with the hello exe 7 per rum application window open The C C editor repositions in tha narenantiun i d qu 5 ees w sees http 127 0 0 1 51395 help topic org eclipse cdt doc user getting started cdt w debug hl Building a proje C 22 a UEIPAC SDK User Manual United Electronic b d Industries The High Performance Alternative Appendix D Booting from NFS a cui iie shared RFS on host PC 3 Install an NFS server on your Linux machine Un tar the rfs tgz file that comes on the UEIPAC CD ROM Share the rfs directory usually done by adding an entry in the etc exports file etc exports file should look like this home frederic UEIPAC rfs 192 168 100 0 255 255 255 0 rw sync no subtree check no root squa sh Remove the file rfs etc rc d S 10network kernel does the network configuration while booting and overwriting it will kill the NFS session Create the directory rfs etc mnt used to mount the sd card later Edit the file rfs etc fstab and change the mount point for dev sdcardl to mnt rfs etc fstab should look like this dev sdcardl mnt ext2 defaults noatime 1 1 none proc proc defaults 0 0 none sys sysfs defaults 0 0 none dev pts devpts defaults 0 0 This will make the sd card accessible under mnt when the UEIPAC boots over NFS b Cond
42. culImage ueipac5200 5 Write kernel into flash make sure you literally type filesize cp b 200000 ffd50000 S filesize 6 Set U Boot s boot command to automatically boot Linux setenv bootcmd bootm ffd50000 7 Save environment variables to flash saveenv 50 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative 8 Reset and boot the new kernel reset UEIPAC with Freescale 8347 CPU 1GBit Ethernet 10 Erase unprotected part of flash memory erase fe000000 felfffff Il Configure the UEIPAC s IP address setenv ipaddr lt IP address of the UEIPAC gt Iz Configure U Boot to use your host PC as TFTP server setenv serverip IP address of your host PC I3 Download the new kernel from the TFTP server tftp 200000 culmage ueipac834x 14 Write kernel into flash make sure you literally type S filesize cp b 200000 fe000000 S filesize LSe Set U Boot s boot command to automatically boot Linux setenv bootcmd bootm fe000000 16 Save environment variables to flash saveenv 17 Reset and boot the new kernel reset 9 2 Initializing an SD card Your UEIPAC came pre installed with an SD card containing the root file system necessary to run Linux You might want to initialize a new SD card if the factory installed card becomes unusable or if you decide to upgrade to a faster or bigger one On a Linux PC Note You need to run Linux on your host PC to
43. dustries The High Performance Alternative S Import Bisting Code O OOOO Import Existing Code Create a new Makefile project from existing code in that same directory Project Name SampleDMAP Existing Code Location C cygwin home frederic uei ueipac 2 4 3 sdk DAQLib_Samples SampleDh Languages G C Toolchain for Indexer Settings lt none gt Cygwin GCC GNU Autotools Toolchain Click Finish to create the project Select the menu Project Build Project to build the example C 3 United Electronic Industries The High Performance Alternative UEIPAC SDK User Manual The indexer will report errors about header files it can t find Here is how to configure discovery options to allow the indexer to do its job 1 Select the menu option Windows Preferences 2 Select C C then Property Pages Settings 3 Enable Display Discovery Options page CA feo UM er Sample566 scheduler c Ecl EET File Edit Source Refactor Navigate Search Project Run Window Help EY gt law amp 9 3 0 QqQ AE a a 8 T Ej Ae C C Debug Bs Project Explorer P3 0 B Sample566_scheduler c P EST J e 29 7 SS ae 5 ka int main int argc char argv E SampleDiagnostics ES PDNA PARAMS params 0 1 0 10 0 ES SampleDMAP int ret E i Binan s zl int i j msgCount 8 am Id lli struct timeval tv1 tv2 ia Inc
44. dustries The High Performance Alternative You need to make sure that the time critical part of your application runs in the primary domain One way to do this is to partition an application in two or more tasks one high priority tasks runs the time critical code and communicate with other lower priority tasks using Xenomai s IPC objects such as message queues and FIFOs The library libpowerdna_rt so implements a version of the PowerDNA API that is safe to call from time critical code running in primary domain All real time examples have the suffix _rt For example Sample207 is a standard Linux sample program while Sample207_rt is a real time sample program 8 6 Running a program automatically after boot Edit the file etc rc local and add an entry for any number of programs that you want to run after the UEIPAC complete its power up sequence In the example below the etc rc local file is modified to run the Sample201 example at boot time bin sh rc local This script is executed at the end of the boot sequence Make sure that the script will exit 0 on success or any other value on error 1 1 1 1 1 1 1 1 listlayers etc layers xml sync devtbl start Sample201 usr local examples Sample201 amp exit 0 Note that Sample201 is executed in the background amp prefix To stop sample201 you must send the SIGINT signal with the following command It is equivalent to typing CTRL C on the consol
45. e Uboot Power up the UEIPAC and press a key to enter U Boot Type the following commands setenv gateway lt your gateway ip address gt setenv netmask lt your netmask gt setenv consoledev ttyPSCO setenv baudrate 57600 setenv netdev eth0 setenv rootpath The remote path where rfs is located on your host PC run nfsargs run addip setenv bootargs bootargs console consoledev baudrate saveenv printenv Verify that your bootargs variable looks like this bootargs root dev nfs rw nfsroot 192 168 100 1 home frederic UEIPAC rfs console ttyPSC0 57600 D 23 UEIPAC SDK User Manual y x United Electronic Industries The High Performance Alternative 1p 192 168 100 2 192 168 100 1 255 255 255 0 ethO off panic 1 4 Reset the UEIPAC which will now find its root file system on the NFS share reset D 24 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative Appendix E Building the Linux kernel Note that you can only build the UEIPAC Linux kernel on a PC running Linux connected to the internet Make sure that you have the following tools installed e git e make e patch e UBoot mkimage Use the package manager of your linux distribution to install those tools For example use the following commands on Ubuntu sudo apt get install git sudo apt get install make sudo apt get install patch sudo apt get install uboot mkimage a Download
46. e folders at tmp mnt and home kdir kdir kdir kdir kdir kdir kdir kdir kdir kdir kdir SB 283 8 3 8 3 38 3 mount mount mount var tmp var log var lib var lib misc var spool var spool cron var spool cron crontabs var run var lock var mnt var home bind var tmp tmp bind var mnt mnt bind var home home 3 Edit etc inittab as follow to execute varsetup sh Mount all filesystem listed in etc fstab sysinit bin mount a Create and mount non persistent folders sysinit etc varsetup sh Configure local network interface sysinit sbin ifconfig lo 127 0 0 1 up sysinit sbin route add net 127 0 0 0 netmask 255 0 0 0 lo run rc scripts isysinit etc rcs Start a shell on the console ttyso respawn bin sh F 28 UEIPAC SDK User Manual y x United Electronic Industries The High Performance Alternative unmount root file system when shutting down shutdown bin umount a r 4 Create symbolic links to files stored in etc that need to be kept writeable ln s var resolv conf etc resolv conf In s var layers xml etc layers xml b Configure Uboot 1 Connect the console serial port power up the UEIPAC and press a key to enter U Boot 2 Type the following commands to load the root file system read only setenv bootargs console ttyS0 57600 root 62 1 ro saveenv F 29 UEIPAC SDK User Manual
47. e if Sample201 was running in the foreground killall SIGINT Sample201 48 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative 8 7 Running a program periodically The UEIPAC comes with crond installed to periodically run scripts and programs Enable the init script to start crond at boot time mv etc rc d K30crond etc rc d S30crond Add a new schedule entry to the cron configuration file crontab e Press i to switch to insert mode and type the new schedule entry using the following format minute hour day month lt dayofweek gt command Minute Minutes after the hour 0 59 Hour 24 hour format 0 23 Day Day of the month 1 31 Month Month of the year 1 12 lt Dayofweek gt Day of the week 0 6 where 0 indicates Sunday An asterisk in a schedule entry indicates every It means that the task will occur on every instance of the given field So a on the Month field indicates the the task will run every month of the year A in the Minutes field would indicate that the task would run every minute A comma is used to input multiple values for a field For example if you wanted a task to run at hours 12 15 and 18 you would enter that as 12 15 18 For example the following entry will append the string Hello UEIPAC to the file tmp crontest every day at 2 30 and 15 30 30 2 15 echo Hello UEIPAC
48. e subset of PowerDNA APIs available when running your program on a UEIPAC Refer to the PowerDNA API Reference Manual document to get detailed information about each API Initialization miscellaneous API Those APIs are used to initialize the library obtain a handle on the kernel driver and perform miscellaneous tasks such as translating error code to readable messages DaqInitDAQLib DqCleanUpDAQLib DqOpenIOM DqCloselOM DqTranslateError All DqCmd APIs Immediate mode API Those APIs are used to read write I O layers in a software timed fashion They are designed to provide an easy way to access I O layers at a non deterministic pace Each I O layer comes with its own set of 1mmediate mode APIs For example you will use the DqAdv201 APIs to control an AI 201 All DqAdvXYZ APIs where XYZ is the model number of a supported I O layer are supported on the UEIPAC DMAP API In DMAP mode the UEIPAC continuously refreshes a set of channels that can span multiple layers at a specified rate paced by a hardware clock Values read from or written to each configured channel are stored in an area of memory called the DMAP At each clock tick the firmware synchronizes the DMAP values with their associated physical channels 43 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative Supported APIs to use RTDMAP mode are DqRtDmap Here is a quick tutorial on using the RTDMAP AP
49. ed by a Windows computer or a Network Attached Storage NAS Load the cifs kernel module modprobe cifs Mount the network share mount t cifs hostip share mnt o username lt user gt password lt pass gt 23 UEIPAC SDK User Manual United Electronic Industries The High Performance Alternative 5 Connecting USB devices You can only connect USB devices to PowerDNA cubes or PowerDNR racks equipped with a USB type A connector 432 1 Type A The Linux kernel supports most USB devices but the UEIPAC only comes with drivers for USB mass storage devices to save space on the SD card Please contact UEI if you plan to use any other USB device 5 1 USB Mass Storage USB mass storage devices use multiple form factors It goes from the smallest USB flash drive to enclosures used to connect ATA or SATA hard drives The UEIPAC supports all of those devices as long as they comply with the USB mass storage device class and are formatted with one of the following formats FAT EXT2 After connecting a mass storage device to the UEIPAC the following kernel messages will appear on the serial console if you are connected using telnet or SSH use the command dmesg to view kernel messages usb 1 1 new high speed USB device using fsl ehci and address 2 usb 1 1 configuration 1 chosen from 1 choice Scsi0 SCSI emulation for USB Mass Storage devices usb 1 1 New USB device found idVendor 08ec idProduct 0011 u
50. eferences then click on C C Build Environment Add a variable named PATH with value set to the cygwin bin directory and the powerpc 604 linux gnu bin directory For example c cygwin bin c cygwin home fred uei ueipac 2 6 0 powerpc 604 linux gnu bin Add a variable named UEIPACROOT with value set to the UEIPAC SDK install directory For example c cygwin home fred uei ueipac 2 6 0 C 1 y x United Electronic b d Industries The High Performance Alternative UEIPAC SDK User Manual r X Preferences Environment type filter text Environment Qi vY Y General a C C Environment variables to set rene 3 Variable Value Autotools E Build i ng Build Variables c cygwin bin C cygwin home frederic uei ueipac 2 4 3 powerpc 604 Console FT UEIPACROOT CAcygwin home frederic uei ueipac 2 4 3 Logging Make Targets 9 Append variables to native environment Makefile Editor Replace native environment with specified one Settings Code Analysis Cade Chie m 9 in c Open and Build examples Select the menu option File New Makefile Project with Existing Code Select the project type Makefile Project Empty Project Type a project name Browse to the location of the example you wish to build examples are located lt Cygwin directory gt home lt your user name gt uei ueipac 2 6 0 sdk DAQLib_Samples C 2 UEIPAC SDK User Manual y x United Electronic In
51. er The UEIPAC comes with a simple web server enabled Copy your html pages in the folder www to make them accessible from a remote web browser 3 7 System logger UEIPAC comes by default with the system logger disabled to avoid un necessary access to the file system You can enable the system logger after adding the syslogd command to etc rc local Log messages will be written to the file var log messages You can also enable the kernel logger to log all kernel messages which are by default printed on the serial console after adding the klogd command to etc rc local 20 UEIPAC SDK User Manual a United Electronic Industries The High Performance Alternative Finally to write your own messages to the system logger include lt syslog h gt in your program and call the POSIX APIs openlog syslog and closelog 21 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative 4 Transferring files You can use either NFS FTP SSH or TFTP to transfer files between your host PC and the UEIPAC 4 1 NFS If you have a NFS server running on your development machine you can mount a shared directory on the UEIPAC This will make the shared directory available on the UEIPAC local file system To mount a shared directory for example shared located on host at 192 168 100 1 mounted on mnt mount o nolock t nfs 192 168 100 1 shared mnt nfs_share After typing this com
52. er will pause the program execution at the beginning of main Set a breakpoint on a line in main Right click on the line and select Toggle breakpoint then press F8 to resume execution The debugger will pause the program again at the line where the breakpoint was set C 20 United Electronic Industries The High Performance Alternative UEIPAC SDK User Manual r En SS Debug Sample207 Sample207 c Eclipse SDK 5 A Ejs ile Edit Refactor Navigate Search Run Project Window Help iy i O B5os 3 E Ss Debug E C C ir Glr ee or Dy amp j Java Debug 23 N a E Variables 5S 9e Breakpoints ata Registers Modules e X d nmi RA esR PRY tss 3x amp 9 gdbserver debugger 5 12 09 4 49 PM Suspended Name Value uf Thread 1 Suspended 3 e argc 1 3j 1 main home frederic uei ueipac 2 0 0 sdk DAC E ae nen pol Remote Shell Lg mem ua a powerpc 604 linux qnu qdb 5 12 09 4 49 PM e lt q B D D Makefile BE Outline 33 _ B eli awe DqinitDAQLib BM stdio h ParseParameters argc argv amp params a c I sched h signal SIGINT handler EA nemet mh g unistd h open communication with IOM GA sys time h if ret en 127 0 0 1 D i POE DE I PDNA h printf Error d In Initializing Communication with IOM n l ParseParams h return ret lt TIMEOUT DELAY 3 m m My t st
53. erformance Alternative Type run flash_nfs to mount root filesystem over NFS Hit any key to stop autoboot 5 This message is coming from the cube s boot loader U Boot It waits 2 seconds to give the user a chance to alter its configuration if necessary After the count down ends U Boot loads the Linux kernel from flash un compresses it and starts it U Boot 1 1 4 PowerDNA 3 2 1 Dec 18 2006 10 41 01 CPU MPC5200 v1 2 at 396 MHz Bus 132 MHz IPB 66 MHz PCI 33 MHz Board UEI PowerDNA MPC5200 Layer T20 85 kHz ready DRAME csc ad 3 a S 128 MB FLASH 4 MB vr serial Out serial Err serial Net FEC ETHERNET Type run flash_nfs to mount root filesystem over NFS Hit any key to stop autoboot 0 Booting image at ffd80000 Image Name Linux 2 6 28 5 ueipac5200 Created 2009 05 01 14 31 47 UTC Image Type PowerPC Linux Kernel Image gzip compressed Data Size 1442840 Bytes 1 4 MB Load Address 00400000 Entry Point 004005e0 Verifying Checksum OK Uncompressing Kernel Image OK Using ueipac5200 machine description Linux version 2 6 28 5 ueipac5200 frederic8frederic ubuntu64 gcc version 4 0 2 41 PREEMPT Fri May 1 10 31 32 EDT 2009 Zone PFN ranges DMA 0x00000000 0x00008000 Normal 0x00008000 0x00008000 HighMem 0x00008000 gt 0x00008000 Movable zone start PFN for each node early node map 1 active PFN ranges 0 0x00000000 0x00008000 Built 1 zoneli
54. etected usb 1 5 1 p12303 converter now attached to ttyUSBO usbcore registered new interface driver p12303 p12303 Prolific PL2303 USB to serial adaptor driver Make note of the device node attached to the serial port In the example above it is dev ttyUSBO You will use this device node to address the serial port See example SampleLinuxSerialPort for an example showing how to program standard Linux serial port Automatic startup To automatically load the kernel modules edit the file etc modules and add the following lines at the end of the file p12303 5 5 LibUSB The UEIPAC comes with the LibUSB library to facilitate programming of USB devices for which there is no driver It allows the enumeration of USB devices as well as access to USB communication pipes e control transfers which are typically used for command or status operations e interrupt transfers which are initiated by a device to request some action from the host e isochronous transfers which are used to carry data the delivery of which is time critical such as for video and speech 32 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative e bulk transfers which can use all available bandwidth but are not time critical Prerequisite LibUSB uses usbfs whichis a filesystem specifically designed for USB devices Once this filesystem is mounted it can be found at proc bus usb It
55. event to occur If no event happens before the timeout expiration the function returns the event DqEmbEventTimeout c DqEmbCancelEvent B 1 UEIPAC SDK User Manual y x United Electronic Industries The High Performance Alternative Syntax int DqEmbCancelEvent int handle DQ EMBEDDED EVENT event Input int handle Handle to the IOM DQ EMBEDDED EVENT event Event to cancel Return DQ ILLEGAL HANDLE invalid IOM handle DQ SUCCESS command processed successfully Description Cancel specified event B 2 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative Appendix C Using Eclipse IDE to program the UEIPAC a Download and Install Eclipse There are several ways to install Eclipse with support for C C programming If you are already using Eclipse for java programming for example you can keep your existing Eclipse and just install the additional plug ins CDT C C developer tools and TM Target management Otherwise download the Eclipse IDE for C C developers package available at http www eclipse org downloads Unzip the package in a folder of your choice for example c eclipse under Windows or opt eclipse under Linux and run the program eclipse exe to start Eclipse b Set up preferences Edit Eclipse preferences to add the path to the cygwin tools such as make and the UEIPAC cross compiler Select the menu option Window Pr
56. his change permanent upon reboot save the date to the RTC chip with the following command hwclock w u Changing the time zone To set the time zone you need to set the environment variable TZ For example if you type the command export TZ EST5EDT M3 2 0 M11 1 0 It will set the time zone to eastern time with daylight saving time starting on the Sunday 0 of the second week 2 of March 3 and ending on Sunday 0 of the first week 1 of November 11 To make this change permanent upon reboot add the command to the file etc profile 19 UEIPAC SDK User Manual y N United Electronic b d Industries The High Performance Alternative You can find a detailed explanation on the syntax of TZ at http www gnu org software libtool manual libc TZ V ariable html Connecting to a NTP server The rdate utility can be used to retrieve the time from a NTP server The following command just prints the time returned by the NTP server rdate p lt NTP server IP address gt The following command changes the current date and time to match the ones returned by the NTP server rdate s NTP server IP address To make this change permanent upon reboot save the date to the RTC chip with the following command hwclock w u 3 5 Changing the password Type the following command and enter your new password two times passwd You can now logout and login with your new password 3 6 Configuring the web serv
57. ide digital data such as the DIO 4xx series m DqRtDmapStart Syntax int DqRtDmapStart int handle int dmapig Input int handle Handle to the IOM int dmapid Identifier of the DMAP Return DQ ILLEGAL HANDLE invalid IOM handle DQ SUCCESS command processed successfully Description Start operations the cube will update its internal representation of the map at the rate specified in DqRtDmaplnit n DqRtDmapStop Syntax int DgRtDmapStop int handle int dmapid Input int handle Handle to the IOM int dmapid Identifier of the DMAP Return DQ ILLEGAL HANDLE invalid IOM handle DQ SUCCESS command processed successfully Description B 7 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative Stop operations the cube will stop updating its internal representation of the data map o DqRtDmapRefresh Syntax int DqRtDmapRefresh int handle int dmapid Input int handle Handle to the IOM int dmapid Identifier of the DMAP Return DQ ILLEGAL HANDLE invalid IOM handle DQ SUCCESS command processed successfully Description Refresh the host s version of the map by downloading the IOM s map Note The IOM automatically refresh its version of the data map at the rate specified in DqRtDmaplnit This function needs to be called periodically a real time OS might be necessary to synchronize the host and IOM data maps p DqRtDmapClose Syntax i
58. in lt UEIPAC SDK directory gt sdk DAQLib_Samples The UEIPAC SDK uses a subset of the PowerDNA Software Suite API It even allows you to control other IO modules that run the standard DAQBios firmware from the UEIPAC the same way you would from a host PC running Windows or Linux 41 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative The PowerDNA API uses the IP address specified in the function DqOpenIOM to determine whether you wish to access the layers local to the UEIPAC or remote layers installed in a remote PowerDNA IO module Set the IP address to the loopback address 127 0 0 1 and the API will know that you want to access the local layers The PowerDNA API implements various modes to communicate with the I O layers e Immediate It is the easiest mode for point by point input output on all layers It also is the least efficient because it requires one call for each incoming and or outgoing request You can not achieve maximum performances with that mode Immediate mode examples are named SampleX XX e Data Mapping DMAP This is the most efficient mode for point by point input output on AI AO DIO and CT layers Incoming and outgoing data from to multiple layers are all packed in a single call DMAP mode examples are named SampleDMapXXX e Buffered ACB Allows access to AI AO DIO and CT layers at full speed It is designed to correct comm
59. ivered to the Linux kernel when the real time kernel is done e Upon receiving an interrupt the real time kernel can schedules its real time tasks e Only when the real time kernel is not running anything will the interrupt be passed on to the Linux kernel e Upon receiving the interrupt Linux can schedule its own processes and threads e Xenomai s real time kernel highest priority allows it to preempt the Linux kernel whenever a new interrupt arrives with no delay and repeat the cycle Xenomai allows to run real time tasks either strictly in kernel space or within the address space of a Linux process A real time task in user space still has the benefit of memory protection but is scheduled by Xenomai directly instead of the Linux kernel The worst case scheduling latency of such kind of task is always near the hardware limits and predictable Using Xenomai parlance real time tasks are running in the primary domain while the Linux kernel and its processes are running in secondary domain A real time task always start in primary domain however it will jump to secondary domain and be schedules by the Linux kernel instead of Xenomai s RT kernel upon invoking a non rt system call Non RT system calls are all system calls that are not implemented by Xenomai This includes memory allocation malloc file access network access sockets process and thread management etc 47 UEIPAC SDK User Manual y x United Electronic b d In
60. kernel modules At the command line prompt type one of the following commands depending on your wifi chipset modprobe rt18187 modprobe rt200xusb modprobe rt2500usb modprobe rt73usb Wifi network interface are names wlan0 wlanl etc The iwconfig utility is used to configure wifi communication parameters You can verify that your interface was properlt detected by typing the command iwconfig A new entry wlan0 should appear lo no wireless extensions ethO0 no wireless extensions 25 UEIPAC SDK User Manual United Electronic Industries The High Performance Alternative eth1 no wireless extensions wmaster0 no wireless extensions T wlanO IEEE 802 11bg ESSID Mode Managed Frequency 2 412 GHz Access Point Not Associated Tx Power 0 dBm Retry min limit 7 RTS thr off Fragment thr 2352 B Encryption key off Power Management off Link Quality 0 Signal level 0 Noise level 0 Rx invalid nwid 0 Rx invalid crypt 0 Rx invalid frag 0 Tx excessive retries 0 Invalid misc 0 Missed beacon 0 Connection to an open access point Specify that you want to connect as a client to a network with an access point iwconfig wlanO0 mode managed Set the ESSID of the access point iwconfig wlanO essid name of your access point Bring up wifi interface ifconfig wlanO up You can now scan the access points accessible by your wifi interface iwlist wlanO
61. ll even be able to boot without SD card 15 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative e Load the root file system from an NFS share This method requires a network server to be always on to provide the files Good for development but not very useful for deployment Setting up root file system read only See Appendix F for instructions to convert a read write UEIPAC root file system to a read only one Booting from a RAM disk Booting from a RAM disk is faster than any other method However the RAM disk size is limited to 16Mbytes and any data written to the RAM disk is lost when the system shuts down or reboot The RAM disk is very useful if for example you want to re initialize the SD card or want to use an NFS share for persistent storage The RAM disk can only fit in the flash memory of the UEIPAC models based on the 8347 CPU UEIPAC 1G or UEIPAC R The UEIPAC models based on the 5200 CPU need to upload the RAM disk image via TFTP each time they boot Follow the steps below to upload the RAM disk to memory and boot from it 1 Copy the lt UEIPAC SDK gt rfs uRamdisk x y z file to the root directory of your TFTP server 2 Power up your UEIPAC and press any key to enter U Boot 3 Configure the UEIPAC s IP address setenv ipaddr IP address of the UEIPAC 4 Configure U Boot to use your host PC as TFTP server setenv serverip IP address of your host PC 5 Uplo
62. lnet Once the IP address is configured you shouldn t need the serial port anymore You can use telnet to access the exact same command line interface Type the following command on your host PC then login as root The password is root telnet lt UEIPAC IP address gt Type the command exit to logout Connecting through SSH Type the following command on your host PC The password is root ssh root lt UEIPAC IP address gt 18 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative Type the command exit to logout You can avoid typing the password each time you login using SSH keys 1 Create private and public SSH keys on your host PC ssh keygen t dsa 2 Copy the public key to ssh on the UEIPAC scp ssh id_dsa pub root lt IP address ssh authorized keys 3 You can now log on the UBIPAC without password 3 4 Configuring Date and Time Changing the date The UEIPAC is equipped with a real time clock chip that preserves the date and time settings when the UEIPAC is not powered By default the date is set to the current data and time in the UTC GMT time zone To print the current date and time use the following command date To change the current date and time use one of the following commands date s MMDDhhmm date s YYYYMMDDhhmm ss For example date s 06021405 will set the new date to June second 2 05 PM To make t
63. ludes double duration A SampleDMAP c int hd6 s SampleDMAP ppc be uint32 datarx 100 li SampleDMAP o ppc be z uint32 sched cmd 256 8 ore m uint32 sched data 256 0 4B Remote Systems 22 ate pre a la 4 amp 61 vL i Local E Problems Tasks E Consol EO E Properties Debug A Search EI 4 utiPAC CDT Global Build Console 2 4 Sg LB B Ex e tri s make all 3 My Home powerpc 604 linux gnu gcc g Wall D GNU SOURCE I Root C cygwin home frederic uei ueipac 2 4 3 include c SampleDMAP c o SampleDMAP o fi Shell Processes powerpc 604 linux gnu gcc lpowerdna lpthread L E Ssh Shells C cygwin home frederic uei ueipac 2 4 3 lib SampleDMAP o o SampleDMAP Ssh Terminals Build Finished Wi O UEIPAC SDK User Manual y x United Electronic Industries The High Performance Alternative type filter text Property Pages Settings 4 C C Appearance These settings will affect behavior of C C property pages Autotools Build Code Analysis V Show Manage Configurations button gt Code Style 7 Display Include Files tab on Paths and Symbols page b Debug F T Display Data Hierarchy tab on Paths and Symbols page b Editor V Display Tool Chain Editor page File Types Display Export Settings page Indexer v Language Mapping vl New C C Project Profiling E Display tool option tips of Tool Se
64. ly from your host PC The following steps will guide you in debugging the hello world program 1 Rebuild the hello program using the g option This will include debug symbols in the binary file powerpc 604 linux gnu gcc g hello c o hello 2 Upload the new binary to the UEIPAC using FTP 3 On the UEIPAC console start the GDB server to debug the program remotely It will communicate with the host on port 1234 gdbserver 1234 hello 4 Onthe host start GDB and connect to the target powerpc 604 linux gnu gdb hello target remote UEIPAC IP address gt 1234 5 Set the shared library search path so that GDB will find the proper library used by your program set solib absolute prefix UEIPAC Install Dir set solib search path lt UEIPAC Install Dir powerpc 604 linux gnu powerpc 604 linux gnu lib Note that this step is only necessary if you wish to step inside the code of the shared libraries If you don t set this variable GDB will print a few error messages about library mismatch but you can still go ahead and debug your program 6 The program is now in running state and GDB paused its execution Let s put a breakpoint at the beginning of the main function break main 40 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative 7 We can now resume execution with the cont command and GDB will pause the execution again when entering the mai
65. mand all files present in the host PC directory shared will also be accessible on the UEIPAC s mnt nfs_share directory 4 2 FTP Client To connect to an external FTP server from the UEIPAC use the commands ftpput and ftpget To retrieve a file from an FTP server ftpget u username p password FTP server IP address local file name remote file name To send a file to an FTP server ftpput u username p password FTP server IP address remote file name local file name 4 3 FTP Server The UEIPAC comes with the vsftpd FTP server The server is active by default You can login as root with password root You get read and write access to the entire file system 4 4 SSH The UEIPAC also comes with the SSH server dropbear preinstalled Use the command scp to transfer a file between your PC and the UEIPAC To send a file to the UEIPAC scp lt source file path on PC gt root 192 168 100 2 lt destination path on UEIPAC gt 22 UEIPAC SDK User Manual y x United Electronic Industries The High Performance Alternative To receive a file from the UEIPAC scp root 192 168 100 2 lt source file path on UEIPAC gt lt destination path on PC gt 4 5 TFTP Client To retrieve a file from a TFTP server use the following command tftp g r remote file name TFTP server IP address 4 6 Windows shared directory You can mount a directory shar
66. n function 6699 8 You can step in your program using the n command to step over each line of execution and s to step inside any called functions To avoid typing the same commands over and over when starting a debugging session you can create a file named gdbinit in your home directory This file will contain commands that you want GDB to execute at the beginning of a session For example the following gdbinit file automatically connects to the target and pauses the execution in the main function each time you start gdb set solib absolute prefix UEIPAC Install Dir set solib search path UEIPAC Install Dir powerpc 604 linux gnu powerpc 604 linux gnu lib target remote 192 168 100 2 1234 break main cont Read the GDB documentation at http sourceware org gdb documentation to learn how to fully use the GDB debugger 8 4 PowerDNA Library The PowerDNA library implements the API used to program the PowerDNA IO layers The following layers are supported by the UEIPAC SDK e Analog Input AI 201 AI 205 AI 207 AI 208 AI 211 AI 225 AI 254 AI 255 e Analog Output AO 302 AO 308 AO 332 e Digital Input Output DIO 401 DIO 402 DIO 403 DIO 404 DIO 405 DIO 406 DIO 416 DIO 432 DIO 433 DIO 448 e Counter Timer CT 601 QUAD 604 e Messaging SL 501 SL 508 CAN 503 429 566 429 512 The source code is installed in lt UEIPAC SDK directory gt sdk DAQLib Examples are located
67. n flash memory e AnSD card containing the root file system is inserted Contact UEI to convert your PowerDNA PowerDNR hardware to a UBIPAC if it is configured with the standard DAQBIOS firmware 3 1 Connecting through the serial port Note that the serial port on the CPU layer is used as a console by default However you can free that serial port and use it as a general purpose serial port see section Connect the serial cable to the serial port on the UEIPAC and the serial port on your PC You will need a serial communication program e Windows ucon MTTTY PuTTY or HyperTerminal e Linux minicom kermit or cu part of the uucp package The UEIPAC uses the serial port settings 57600 bits s 8 data bits 1 stop bit and no parity Run your serial terminal program and configure the serial communication settings accordingly Connect the DC output of the power supply 24VDC to the Power In connector on the UEIPAC and connect the AC input on the power supply to an AC power source You should see the following message on your screen U Boot 1 1 4 Jan 10 2006 19 20 03 CPU MPC5200 v1 2 at 396 MHz Bus 132 MHz IPB 66 MHz PCI 33 MHz Board UEI PowerDNA MPC5200 Layer LAC 85 kHz ready DRAM 128 MB Reserving 349k for U Boot at 07f a8000 FLASH 4 MB in serial Out serial Err serial Net FEC ETHERNET 11 UEIPAC SDK User Manual United Electronic Industries The High P
68. nt DqRtDmapClose int handle int dmapig Input int handle Handle to the IOM int dmapid Identifier of the DMAP Return DQ ILLEGAL HANDLE invalid IOM handle DQ SUCCESS command processed successfully Description Free all resources allocated by the DMAP operation on the specified IOM B 8 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative Appendix B Event API a DqEmbConfigureEvent Syntax int DqEmbConfigureEvent int handle DQ EMBEDDED EVENT event unsigned int param Input int handle Handle to the IOM DQ EMBEDDED EVENT event Event to configure unsigned int param Event specific parameter Return DQ ILLEGAL HANDLE invalid IOM handle DQ SUCCESS command processed successfully Description Configure hardware to notify the specified event Possible events are DqEmbEventS yncIn Digital edge at the syncin connector set param to 0 for rising edge or 1 for falling edge DqEmbEventTimer Timer event set param to desired frequency b DqEmbWaitForEvent Syntax int DqEmbWaitForEvent int handle int timeout DQ EMBEDDED EVENT event Input int handle Handle to the IOM int timeout Timeout in milliseconds DQ EMBEDDED EVENT event Received event Return DQ ILLEGAL HANDLE invalid IOM handle DQ SUCCESS command processed successfully Description Wait for any configured
69. o B 6 m DaRtDmaApStart PT B 7 TD RS HOD C B 7 DIR RD IRS 1 ERROR B 8 P DRED nC Baca P ES B 8 Appendix B Event API wssissscassscasssdeacatscnatecaanisaaceavensanassiucnstnsssassssesieiasess B 1 a broderie Gierrik Sates VOU SP aa e r a Aaa TESA Ei B 1 b DdEmbWaitForEyent rrapi aan ra aa a EEE EEE RAE B 1 DqdEmbCancelEyent nsin innana E a A ER B 1 Appendix C Using Eclipse IDE to program the UEIPAC C 1 a Download and Install EGIDE a eerte eee ope hastae RM ERR RI ION Edu POLH D RRREI EI DR MUR C 1 SS UT SSIES ausa dq am cutin tit beet Dant nia peT No lam ape UM NE NUM LO E C 1 Open amd Build Sx ales dou it pesisire IM trs pU EP e PM NE PME C 2 d Download pre Grunt Od BEBE eoo soon SEE pr tute RUN RIe doc R Ee RU UA E INA EQ EEUU C 6 e Execute DEDISTI isere lor ceno e peb et bte mU nei EI brat MANN aM n PIE DNE C 16 f Debugging your program on the UEIPAC uiscera MEL tL rab AR REUS k b rts ceuE ERA C 18 Appendix D Booting from NES eere rece creer eee eene eee neenon to D 23 a Configure shared RFS on host PC cc ccssscoavccustnossaendomnnsonsaaceaenssannomnagnssannenssaatwnnieds D 23 an VMS UDO koisa iedeen pose ir aaa a EE nebo a i D 23 Appendix E Building the Linux kernel eeseoocessesssesssssososcoscessessssso E 25 a Download and patch kernel SOURCE ise pe dedu paio Rada E 25 UEIPAC SDK User Manual
70. on ifconfig bond0 up e Assign eth0 and eth1 as slaves to bond0 ifenslave bondO eth0 ethl e Configure an IP address for bond0 ifconfig bondO 192 168 103 2 netmask 255 255 255 0 H 33
71. on ti t t N E efine a connection to remote system Nam 5 amp 9 Local Define connection to remote system ame Author Version Copyright Descriptic include lt lt include lt s include F type Filter text amp General f FTP Only E Local Ek SSH Only Telnet Only Experimental Unix Unix A Windows Select Linux then click on Next UEIPAC SDK User Manual UEIPAC SDK User Manual United Electronic Industries The High Performance Alternative New Connection Remote Linux System Connection Define connection information Parent profile MEEKESI v Host name 192 168 100 2 Connection name LIEIPAC Description Verify host name Enter the IP address of your UEIPAC as Host Name and pick a Connection name Click on Next UEIPAC SDK User Manual United Electronic Industries The High Performance Alternative New Connection Files Define subsystem information Configuration Properties idstore li Property i C ssh files Available Services 22 FTP File Service 1 amp 4 FTP Connector Service gt ue z Description This configuration allows you to work with Files on local or remote systems using the FTP protocol We will use FTP to transfer files to from the UEIPAC Select ftp files Select FTP Connector Service and set the FTP passive setting to true Click on
72. onfigures ethO on UEIPACs equipped with dual Ethernet controller UEIPAC 600R UEIPAC 1200R UEIPAC 300 1G and UEIPAC 600 1G Use ifconfig to configure eth1 ifconfig ethl lt IP address gt Insert the ifconfig command in etc rc local to make the change permanent upon reboot 17 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative Changing the default packet size MTU You can change the MTU parameter for an ethernet port default MTU is 1500 bytes with the ifconfig command For example to change MTU for ethO to 9000 bytes ifconfig ethO mtu 9000 The command will complain with the message Invalid Argument if you set the value too high The highest value tolerated on current hardware is 9500 bytes Insert the command in etc rc local to make the change permanent upon reboot Configuring dynamic IP address using a DHCP server If you have DHCP server available you can configure the UEIPAC to automatically fetch an IP address when it boots up Edit the file etc network conf and change the line DHCP no To DHCP yes You must restart the network to activate the change etc init d network restart Name resolution If your UEIPAC uses a static address you need to edit the file etc resolv conf to add the IP address of your DNS server If your UEIPAC uses DHCP the etc resolv conf file is automatically populated and name resolution will work right away Connecting through Te
73. op int El Console 32 A Tasks 21 Problems Q Executables 6 Memory B X Ek KIGE ER 5 a fll 2 ah ee Sample207 C C Remote Application powerpc 604 linux gnu gdb 5 12 09 4 49 PM lib ld so i No such file or directory Stopped due to shared library event No symbol Communication in current context Writable Smart Insert 60 1 You can now execute the program step by step pressing the keys F5 and F6 More information about debugging programs is available in Eclipse s online help Select the menu option Help Help content C 21 UEIPAC SDK User Manual a United Electronic Industries The High Performance Alternative Help Eclipse SDK nm A hE Search EJ Search scope All topics 6 Sa 2 fl eed_ Go C C Development User Guide gt Gettin ed Debugging a project JDT Plug in Develop e Plug in Developmen The debugger lets you control the execution of your program by l C C Development B Before you begin E LI Getting Started setting breakpoints suspending executed programs stepping through your code and examining the contents of variables To debug a project Click Run gt Debug The Debug window opens Double click C Local Application In the Name field type Hello World You can now select this debug launch configuration by Am name the next time that you debug this project Importing C C Inthe Project
74. pa_passphrase here gt priority 2 Specify that you want to connect as a client to a network with an access point in managed mode iwconfig wlanO essid name of your access point mode managed Run wpa_supplicant in daemon mode to authenticate with the access point wpa_supplicant iwlan0 c etc wpa supplicant conf Dwext B Run iwconfig to verify that the authentication worked wlanO IEEE 802 11bg ESSID fred Mode Managed Frequency 2 447 GHz Access Point 00 13 10 AA FA 10 Bit Rate 1 Mb s Tx Power 27 dBm Retry min limit 7 RTS thr off Fragment thr 2352 B Encryption key B507 40C4 9A48 806D D664 910F B354 6CF4 DEBF EA54 CE6F B291 BD0OE 593F BFA9 405D 2 Security mode open Power Management off Link Quality 80 100 Signal level 31 dBm T 27 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative Rx invalid nwid 0 Rx invalid crypt 0 Rx invalid frag 0 Tx excessive retries 0 Invalid misc 0 Missed beacon 0 If there is a DHCP server on your network get an IP address for your wifi interface udhcpc i wlanO s etc udhcp default script Otherwise assign a static IP address to your wifi interface ifconfig wlanO 192 168 100 3 netmask 255 255 255 0 route add default gateway 192 168 100 1 Direct connection to another computer in ad hoc mode Specify that you want to connect in ad hoc mode iwconfig wlanO mode ad hoc Set the
75. sb 1 1 New USB device strings Mfr 1 Product 2 SerialNumber 3 usb 1 1 Product USB Drive u sb 1 1 Manufacturer Fujifilm usb 1 1 SerialNumber 0713B317290025CC scsi 0 0 0 0 Direct Access Fujifilm USB Drive 4 20 PQ 0 ANSI 0 CCS sd 0 0 0 0 sda 499712 512 byte hardware sectors 255 MB 244 MiB sd 0 0 0 0 sda Write Protect is off sd 0 0 0 0 sda Assuming drive cache write through sd 0 0 0 0 sda 499712 512 byte hardware sectors 255 MB 244 MiB sd 0 0 0 0 sda Write Protect is off sd 0 0 0 0 sda Assuming drive cache write through sda sdal sd 0 0 0 0 sda Attached SCSI removable disk 24 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative Note the device node name assigned to this USB device it uses the format sdxn e xisa for the first drive b for the second and so on e nis the partition number In the kernel message above we see that the USB mass storage device s first partition is using the device node sdal You can mount the file system located on this device with the command mount dev sdal mnt The files are now accessible under the directory mnt You must un mount the file system before un plugging the device to avoid file corruption umount mnt 5 2 Wifi network interface The UEIPAC comes with drivers for Wifi network usb interfaces that use the following chipsets e Realtek RTL8187 e Ralink RT2570 RT2571 Load
76. scan If there is a DHCP server on your network get an IP address for your wifi interface udhcpc i wlanO s etc udhcp default script Otherwise assign a static IP address to your wifi interface ifconfig wlanO 192 168 100 3 netmask 255 255 255 0 route add default gateway 192 168 100 1 Connection to an access point with WEP security The procedure is almost identical to connecting to an open access point In addition you need to specify your WEP key iwconfig wlan0 key lt WEP key in hexadecimal gt 128 bit WEP use 26 hex characters 64 bit WEP uses 10 26 UEIPAC SDK User Manual United Electronic Industries The High Performance Alternative Connection to an access point with WPA WPA2 security Generate the pre shared key using the access point s password wpa_passphrase lt name of your access point gt lt access point password gt Edit the file etc wpa_supplicant conf and update the following fields ssid the ID of your access point psk the pre shared key generated with wpa_passphrase proto WPA for WPA security and RSN for WPA2 security key_mgmt WPA PSK pairwise TKIP for WPA and TKIP CCMP for WPA2 group TKIP for WPA and TKIP CCMP for WPA2 For example ctrl_interface var run wpa_supplicant ctrl_interface_group 0 ap_scan 1 network ssid lt put your access point ESSID here gt proto WPA key_mgmt WPA PSK pairwise TKIP group TKIP psk lt put your pre shared key generated with w
77. send Hayes AT commands as if it were an old fashion RTC modem UEIPAC uses the PPP software to control the modem and configure a network connection with your phone provider Load kernel modules At the command line prompt type the following commands modprobe sierra modprobe ppp You should see the following messages printed on the console modprobe sierra usbcore registered new interface driver usbserial usbserial USB Serial Driver core USB Serial support registered for Sierra USB modem sierra 1 1 1 0 Sierra USB modem converter detected usb 1 1 Sierra USB modem converter now attached to ttyUSBO sierra 1 1 1 1 Sierra USB modem converter detected usb 1 1 Sierra USB modem converter now attached to ttyUSBl sierra 1 1 1 2 Sierra USB modem converter detected usb 1 1 Sierra USB modem converter now attached to ttyUSB2 sierra 1 1 1 3 Sierra USB modem converter detected usb 1 1 Sierra USB modem converter now attached to ttyUSB3 sierra 1 1 1 4 Sierra USB modem converter detected usb 1 1 Sierra USB modem converter now attached to ttyUSB4 sierra 1 1 1 5 Sierra USB modem converter detected usb 1 1 Sierra USB modem converter now attached to ttyUSB5 sierra 1 1 1 6 Sierra USB modem converter detected usb 1 1 Sierra USB modem converter now attached to ttyUSB6 usbcore registered new interface driver sierra sierra v 1 3 2 USB Driver for Sierra Wireless USB modems
78. sk gz new uRamdisk x y z Image Name UEIPAC RAM disk Created Wed Apr 11 17 32 41 2012 Image Type PowerPC Linux RAMDisk Image gzip compressed Data Size 2425561 Bytes 2368 71 kB 2 31 MB Load Address 0x00000000 Entry Point 0x00000000 G 31 UEIPAC SDK User Manual y x United Electronic Industries The High Performance Alternative Appendix H Bonding Teaming Ethernet ports Teaming Bonding describes various methods to combine multiple network links in parallel to provide redundancy and or increase data throughput This chapter describes the configuration of a fault tolerant link between a UEIPAC and a host PC Bonding is only possible on UEIPACs equipped with two independent network ports In this mode only one network adapter the primary is active The secondary adapter takes over as soon as it detects that the primary adapter can t connect to its peer UEIPAC e Power up your UEIPAC and open a serial terminal program e Tear down existing network connections ifconfig ethO down ifconfig ethl down Load bonding kernel module with parameters set to o monitor the link to the host PC every 500ms H 32 UEIPAC SDK User Manual United Electronic Industries The High Performance Alternative o fault tolerance mode o use eth0 as primary connection modprobe bonding arp ip target 192 168 103 1 arp interval 500 mode active backup primary eth0 e Bring up bond0 connecti
79. sts in Zone order mobility grouping on Total pages 32512 Kernel command line console ttyPSC0 57600 root 62 1 rw 12 UEIPAC SDK User Manual United Electronic Industries The High Performance Alternative MPC52xx PIC is up and running PID hash table entries 512 order 9 2048 bytes clocksource timebase mult 79364d9 shift 22 registered I pipe 2 4 04 pipeline enabled Console colour dummy device 80x25 console ttyPSCO enabled Dentry cache hash table entries 16384 order 4 65536 bytes Inode cache hash table entries 8192 order 3 32768 bytes Memory 126376k 131072k available 2808k kernel code 4548k reserved 116k data 436k bss 152k init Calibrating delay loop 65 53 BogoMIPS 1p j 32768 Mount cache hash table entries 512 net namespace 292 bytes NET Registered protocol family 16 DMA MPC52xx BestComm driver DMA MPC52xx BestComm engine 0001200 ok NET Registered protocol family 2 IP route cache hash table entries 1024 order 0 4096 bytes TCP established hash table entries 4096 order 3 32768 bytes TCP bind hash table entries 4096 order 2 16384 bytes TCP Hash tables configured established 4096 bind 4096 TCP reno registered NET Registered protocol family 1 audit initializing netlink socket disabled type 2000 audit 0 208 1 initialized I pipe Domain Xenomai registered Xenomai hal powerpc st
80. t and SSH over the network You can also configure the UEIPAC to execute your application after booting up Your application runs as a regular Linux process giving you access to the standard POSIX API provided by the GNU C runtime library glibc as well as any other library that can be compiled for Linux for example libxml libaudiofile The UEIPAC SDK comes with a library dedicated to communicate with the UEIPAC I O layers It provides a subset of the hosted PowerDNA API allowing you to reuse existing programs that were designed to run on a host PC and communicate with PowerDNA over the network see section 7 4 for more informations You can port those programs to run directly on the UEIPAC with few modifications y x United Electronic b d Industries The High Performance Alternative Other library UEIPAC SDK User Manual Networking PowerDNA Drivers DIO layer Other layer UEIPAC SDK User Manual y N United Electronic b d Industries The High Performance Alternative 2 Setting up a development system A development system is composed of the software tools necessary to create an embedded application targeting Linux on a PowerPC processor The development tools can run on a Linux PC or on a Windows PC using the Cygwin environment It contains the following e GCC cross compiler targeting the UEIPAC PPC processor e GNU toolchain tools such as make e Standard Linux libraries s
81. ta read is the data transferred by the last call to DgRtDmapRefresh This function should only be used with devices that acquire 32 bits wide digital data such as the DIO 4xx serie j DqRtDmapWriteScaledData Syntax int DgRtDmapWriteScaledData int handle int dmapid int dev double scaledBuffer int bufferSize Input int handle Handle to the IOM int dmapid Identifier of the DMAP int dev ID of the device where the channels are located int bufferSize Number of elements in scaledBuffer double scaledBuffer The buffer containing the scaled data to send to the device Return DQ ILLEGAL HANDLE invalid IOM handle DQ BAD DEVN there is no device with the specified number B 5 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative DQ_SUCCESS command processed successfully Description Write scaled data to the output map of the specified device Note The data written will be actually transferred to the device on the next call to DqRtDmapRfresh This function should only be used with devices that generate analog data such as the AO 3xx series k DqRtDmapWriteRawData16 Syntax int DqRtDmapWriteRawDatal6 int dev unsigned short rawBuffer int handle int dmapid int bufferSize Input int handle Handle to the IOM int dmapid Identifier of the DMAP int dev ID of the device where the channels are located int bufferSize Number of elemen
82. the current directory to the linux source directory 1 Configure kernel with default settings make ARCH powerpc CROSS COMPILE powerpc 604 linux gnu 83xx ueipac834x defconfig 2 Customize kernel configuration make ARCH powerpc CROSS COMPILE powerpc 604 linux gnu menuconfig 3 Compile the kernel make ARCH powerpc CROSS COMPILE powerpc 604 linux gnu culmage ueipac834x 4 Compile modules make ARCH powerpc CROSS COMPILE powerpc 604 linux gnu modules 5 Install modules make ARCH powerpc CROSS COMPILE powerpc 604 linux gnu INSTALL MOD PATH Your module install path modules install E 26 UEIPAC SDK User Manual y x United Electronic Industries The High Performance Alternative You can find the built kernel in arch powerpc boot cuImage ueipac834x and the modules in whatever directory you assigned to the INSTALL_MOD_PATH variable E 27 United UEIPAC SDK User Manual A Electronic b d Industries The High Performance Alternative Appendix F Converting root file system to read only a mon RFS on SD card Edit etc fstab as follow to mount a ram disk at var ram disk maximum size is set to 2MBytes dev sdcardl ext3 defaults noatime 1 1 none proc proc defaults 0 0 none sys sysfs defaults 0 0 none dev pts devpts defaults 0 0 tmpfs var tmpfs defaults size 2M 0 0 2 Create a new script etc varsetup sh with the content below It setups the folders needed in var and maps a few writabl
83. to test the serial ports Start the serial server with at least two configured ports dev ttyUEIO and dev ttyUEI1 We will assume that the two serial ports are connected with a NULL modem cable Open two separate command line shells and start the minicom program for each of the Serial ports you wish to test microcom s 19200 dev ttyUEIO microcom s 19200 dev ttyUEI1 If both serial ports are tied with a NULL modem cable anything you type in one of the session will appear on the other session 35 UEIPAC SDK User Manual y x United Electronic Industries The High Performance Alternative 6 2 Using the CPU layer s serial port for general purpose Edit the file etc inittab and add the character in front of the line ttySO respawn bin sh Then reboot This will disable the serial console and let you control the serial port from your program using the POSIX termios API 36 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative T Testing the I O layers 7 1 devitbl Run the command devtbl it will print a list of the I O layers that were detected on this module PowerDNA Driver version 2 1 0 Address Irq Model Option Phy Virt S N Pri LogicVer 0xc9080000 7 207 1 phys 0027887 0 02 0c 05 0xc9090000 7 403 1 phys 0030384 0 02 0c 05 0xc90a0000 7 403 1 phys 0030385 0 02 0c 05 Oxc90b0000 7 501 1 phys 0029693 0 02 0c 05 0xc90c0000 7 601
84. ts in rawBuffer unsigned short rawBuffer The buffer containing the raw data to write to the device Return DQ ILLEGAL HANDLE invalid IOM handle DQ BAD DEVN there is no device with the specified number DQ SUCCESS command processed successfully Description Write 16 bits wide raw data to the specified device Note The data written will be actually transferred to the device on the next call to DqRtDmapRfresh This function should only be used with devices that generate 16bits wide digital data such as the AO 3xx series I DqRtDmapWriteRawData32 Syntax int DqRtDmapWriteRawData32 int handle int dmapid int dev unsigned int rawBuffer int bufferSize Input int handle Handle to the IOM int dmapid Identifier of the DMAP B 6 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative int dev ID of the device where the channels are located int bufferSize Number of elements in rawBuffer unsigned int rawBuffer The buffer containing the raw data to write to the device Return DQ ILLEGAL HANDLE invalid IOM handle DQ BAD DEVN there is no device with the specified number DQ SUCCESS command processed successfully Description Write raw data to the specified device as 32 bits integers Note The data written will be actually transferred to the device on the next call to DqRtDmapRfresh This function should only be used with devices that acquire 32 bits w
85. ttings tab at fixed location gt Property Pages Setti e PR Dialog Bounds Task Tags 9 Save size only Template Default Va Save size and position ChangeLog Do not save at all ith an 4 Select the menu option Project Properties and find the C C Build Discovery Options page 5 Change the compiler invocation commands to powerpc 604 linux gnu g and powerpc 604 linux gnu gcc C 5 United Electronic Industries The High Performance Alternative UEIPAC SDK User Manual Manage Configurations Automated discovery of paths and symbols Pi EIPAC examples Discovery Options Resource Builders C C Build Configuration Default Active Build Variables Discovery Options Eroronment Discovery profiles scope Logging Settings Per Language Tool Chain Editor C C General Tools Project References Cross G Compiler Refactoring History Cross GCC Compiler Run Debug Settings Task Repository WikiText V Automate discovery of paths and symbols v Report path detection problems Discovery profile Clear discovered entries now Discovery profile options V Enable build output scanner info discovery Load build output from file Managed Build System per project V Enable generate scanner info command Compiler invocation command powerpc 604 linux gnu g
86. uch as glibc PowerDNA library to access the various PowerDNA data acquisition devices 2 1 Windows Host The UEIPAC cross compiler depends on libraries provided by the Cygwin project Cygwin is a collection of tools which provide a Linux look and feel environment for Windows and a DLL which acts as a Linux API layer providing substantial Linux API functionality Cygwin is available for free as an open source project but you can also purchase a commercial license with technical support from Red Hat http www redhat com services custom cygwin If you don t have Cygwin already installed download and run the installer setup exe from http www cygwin com Running setup exe will install or update Cygwin We need the packages from the following categories e Archive tools to create and read archives files such as zip bx2 and tar e Devel Development tools such as make e Net Network utilities such as ftp tftp and telnet Click on the Default word next to each category you want to install The displayed string will change to Install UEIPAC SDK User Manual y x United Electronic Industries The High Performance Alternative Cygwin Setup Select Packages Select Packages Select packages to install Okeep OPrev Oui O Esp Category Category Current B S Size Pack EJ All amp Default Accessibility amp Default Admin 4 Default Audio 4 Default Base amp Default Database amp Defa
87. ult Doc amp Default Editors amp Default Games amp Default Gnome amp Default Graphics 4 Default Interpreters 4 Default KDE amp Default Libs 4 Default Mail 4 Default Math amp Default Mingw amp Default Perl amp Default TH Dibhiabinn 9 Del SS od lt Hide obsolete packages Insert the UEIPAC SDK CDROM in your CD drive Then open a cygwin command line shell Go to the CD s root directory the example below assumes that the CD ROM is the D drive cd cygdrive d UEIPAC SDK User Manual y x United Electronic Industries The High Performance Alternative install sh 2 2 Linux Host Insert the UEIPAC SDK CDROM in your CD drive You might need to mount it if your Linux distribution doesn t detect the CDROM automatically To mount it type mount dev cdrom mnt cdrom cd mnt cdrom bash install sh 2 3 SDK directory layout powerpc 604 linux gnu the GCC cross compiler doc the manuals in PDF and HTML format kernel the kernel source code and binary image rfs tgz archive containing the root file system installed on the SD card ulmage the kernel image stored in your UBIPAC flash memory sdk the UBIPAC software development kit 10 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative 3 Configuring the UEIPAC Your PowerDNA PowerDNR hardware must be pre configured to run Linux e A Linux kernel is loaded i
88. unication errors that might happen on the network link The error correction mechanisn will cause issues with real time deadlines ACB mode examples are named SampleACBXXX e Messaging Allows access to messaging layers serial CAN ARINC 429 at full speed It is designed to correct communication errors that might happen on the network link The error correction mechanisn will cause issues with real time deadlines Messaging mode examples are named SampleMsgXXX e Variable Size Data Mapping VMAP Allows access to all layers at full speed transferring incoming and outgoing data in buffers in one call VMAP mode examples are named SampleVMapXXX The UEIPAC SDK only supports the immediate also known as point by point DMAP and VMAP modes to control the local layers The three other modes ACB MSG and M3 are designed to work over ethernet and have built in error correction which is not needed on the UEIPAC You can however use those modes to control remote layers installed in I O modules that runs the DAQBios firmware over the network Firmware running on the IO module I O mode DAQBios UEIPAC local layers UEIPAC remote layers Immediate Yes Yes Yes ACB Yes No Yes 42 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative DMAP Yes Yes Yes MSG Yes No Yes VMAP Yes Yes Yes PowerDNA API The following section details th
89. uns the Sample201example to acquire channels 0 2 and 4 from device 1 Sample201 d 1 c 0 2 4 Building your own program The first step is to compile your program use the I option to tell the compiler where the PowerDNA API headers are powerpc 604 linux gnu gcc I UEIPACROOT includes c myprogram c Then link your program use the L option to tell the linker where the PowerDNA API library is and the l option to tell the linker to link against the PowerDNA library powerpc 604 linux gnu gcc L UEIPACROOT includes lpowerdna myprogram o o myprogram 46 UEIPAC SDK User Manual y N United Electronic b d Industries The High Performance Alternative The PowerDNA API is implemented in two libraries e libpowerdna so implements the PowerDNA API for regular Linux processes libpowerdna rt so implements the PowerDNA API for real time tasks 8 5 Real Time Programming The UEIPAC comes with support for the Xenomai Real time framework see http www xenomai org Xenomai is a real time development framework cooperating with the Linux kernel in order to provide hard real time support to user space applications seamlessly integrated into the Linux environment Xenomai uses the flow of interrupts to give real time tasks a higher priority than the Linux kernel e When an interrupt is asserted it is first delivered to the real time kernel instead of the Linux kernel The interrupt will be later also del
90. untdown ends to enter U Boot s command line interface Configure UEIPAC with Freescale 5200 CPU to run DAQBios firmware 1 Set U Boot s boot command to start the DAQBios firmware automatically setenv bootcmd fwjmp saveenv 2 Reset and boot the DAQBios firmware reset Configure UEIPAC with Freescale 5200 CPU to run Linux 53 UEIPAC SDK User Manual y x United Electronic b d Industries The High Performance Alternative 3 Set U Boot s boot command to start Linux automatically setenv bootcmd bootm ffd50000 saveenv 4 Reset and boot the Linux kernel reset Configure UEIPAC with Freescale 8347 CPU to run DAQBios firmware 1 Set U Boot s boot command to start the DAQBios firmware automatically setenv bootcmd go ff800100 saveenv 2 Reset and boot the DAQBios firmware reset Configure UEIPAC with Freescale 8347 CPU to run Linux 3 Set U Boot s boot command to start Linux automatically setenv bootcmd bootm fe000000 saveenv 4 Reset and boot the Linux kernel reset 10 Install open source software You can install pretty much any open source software package designed for Linux on your UEIPAC provided that those software packages can be cross compiled The following sections describe a few standard way of cross compiling software packages 10 1 Software coming with an autoconf configure script Most software packages that use autoconf can be configured with the following command on a Linux PC
Download Pdf Manuals
Related Search
Related Contents
Bedienungsanleitung V1.02.indd Pinnacle Avid Liquid 7.0 取扱説明書 - 測定器レンタル 株式会社メジャー Télécharger le rapport du président du jury (format pdf) User Manual - Sensortronic Scales Focal Chorus 716 V Net Prowler User Manual FR ES NL GB DE - Sport USER MANUAL Multitech MULTIFRAD 3100 User's Manual Copyright © All rights reserved.
Failed to retrieve file