UEIPAC Software Development Kit User Manual 3.3.0
Total Page:16
File Type:pdf, Size:1020Kb
UEIPAC Software Development Kit User Manual 3.3.0 March 2017 Edition © Copyright 2017 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 Table of contents 1 Introduction............................................................................................1 2 Setting up a development system..........................................................3 2.1 Windows host.......................................................................................................3 2.2 Linux host............................................................................................................5 2.2.1 Preparing your 64-bit Linux host.....................................................................5 2.2.2 Installing UEIPAC software on your Linux host.............................................5 2.3 SDK directory layout...........................................................................................6 3 Configuring the UEIPAC.......................................................................7 3.1 Connecting through the serial port......................................................................7 3.2 Root file system.................................................................................................11 3.2.1 Booting from the SD card..............................................................................11 3.2.2 File-system corruption...................................................................................11 3.2.3 Setting-up a root file system as read-only.....................................................12 3.2.4 Booting from a RAM disk.............................................................................12 3.2.5 Booting from an NFS share...........................................................................15 3.2.6 Revert to booting from an SD card................................................................16 3.3 Configuring the Network...................................................................................16 3.3.1 Configuring a static IP address......................................................................16 3.3.2 Changing the default packet size (MTU).......................................................17 3.3.3 Configuring dynamic IP address (using a DHCP server)..............................18 3.3.4 Name resolution.............................................................................................18 3.3.5 Connecting through Telnet.............................................................................18 3.3.6 Connecting through SSH...............................................................................19 3.3.7 Configuring DHCP server.............................................................................19 3.4 Configuring Date and Time...............................................................................19 3.4.1 Changing the date..........................................................................................19 3.4.2 Changing the time zone.................................................................................20 3.4.3 Connecting to an NTP server.........................................................................20 3.5 Changing the password......................................................................................21 3.6 Configuring the web server...............................................................................21 3.7 System logger....................................................................................................21 4 Transferring files..................................................................................22 4.1 NFS....................................................................................................................22 4.2 FTP Client..........................................................................................................22 4.3 FTP Server.........................................................................................................22 4.4 SSH....................................................................................................................22 4.5 TFTP Client.......................................................................................................23 © Copyright 2017 www.ueidaq.com United Electronic Industries, Inc. i 508.921.4600 UEIPAC SDK User Manual 4.6 Windows shared directory.................................................................................23 5 Connecting USB devices......................................................................24 5.1 USB mass storage..............................................................................................24 5.2 Wifi network interface.......................................................................................25 5.2.1 Load kernel modules......................................................................................26 5.2.2 Connection to an open access point...............................................................26 5.2.3 Connection to an access point with WEP security.........................................27 5.2.4 Connection to an access point with WPA/WPA2 security.............................27 5.2.5 Direct connection to another computer in ad-hoc mode................................28 5.3 UMTS/GSM modem.........................................................................................29 5.3.1 Prerequisite....................................................................................................29 5.3.2 Manual configuration.....................................................................................29 5.3.3 Automatic startup...........................................................................................32 5.4 Serial Port..........................................................................................................32 5.4.1 Load kernel modules......................................................................................33 5.4.2 Automatic startup...........................................................................................33 5.5 LibUSB..............................................................................................................34 5.5.1 Prerequisite....................................................................................................34 5.5.2 Write a program using libusb.........................................................................34 6 Serial Port.............................................................................................35 6.1 UEI Serial Server...............................................................................................35 6.2 Using the CPU layer’s serial port for general purpose......................................37 7 Testing the I/O layers...........................................................................38 7.1 devtbl.................................................................................................................38 7.2 Run examples.....................................................................................................38 7.3 PowerDNA server..............................................................................................39 8 Application development.....................................................................40 8.1 Prerequisites.......................................................................................................40 8.2 Compiling and running Hello World.................................................................40 8.3 Debugging Hello World.....................................................................................41 8.4 PowerDNA Library............................................................................................42 8.4.1 PowerDNA API.............................................................................................44 8.4.2 Building and running the examples...............................................................47 8.4.3 Building your own program...........................................................................48 8.5 Real-Time Programming...................................................................................48 8.6 Running a program automatically after boot.....................................................50 8.7 Running a program periodically........................................................................51 9 Firmware installation and upgrade....................................................52 9.1 Installing or upgrading the Linux kernel...........................................................52 9.1.1 UEIPAC with Freescale 5200 CPU (100MBit Ethernet)...............................52 © Copyright 2017 www.ueidaq.com United Electronic Industries, Inc. ii 508.921.4600 UEIPAC SDK User Manual 9.1.2 UEIPAC with Freescale 8347 CPU (1GBit Ethernet)...................................53 9.2 Initializing an SD card.......................................................................................53 9.2.1 On a Linux PC...............................................................................................53 9.2.2 On the UEIPAC itself....................................................................................55 9.3 Running the standard DAQBios