Home

GE863-PRO Linux Software User Guide - Glyn High

image

Contents

1. 44 Laa CO Tora e A E EE E EEE E E N 45 Mo WE POR eee E E E T E ESE 45 4 4 OPO EE E E E A EE A E E E E EE 47 E O e mem 48 PE Ic a E T E AAE E A EA AA NAAR ANAE ONT AT 48 d W Ta E T EGNE NE E EE A NEEE NEA EE AOE TE 49 LP MEE NE E E E E EE E TOEA E E E E EE E ene een saeepaaaiaeea ed 50 4 5 VY AUC No CE EEE EN E OEN O E E O S E TO E O 50 do ODE ee E A E E NISUPN UND MEM MNT RU IE 50 i edi E Rm 51 OSE E EA E E EE E EE E O E S E 53 4 6 SDIO a 53 SE O do mE TET A E N E E 54 4 8 MB PE n 55 ASA USB Mass SlordrE sessur a c u M 55 4 5 2 USB device Ethernet CHILD uaseeseaseketnienes vos nes Resa caasa Sox uaa nne eR Un ee nice Ein a eR MM E SH rna aa AEEA KE EEN UNR EAEE 55 VI ETENEE A T AE OA AO A A N O E 57 5 1 Code CX AUN acts ca ee sa 58 Reproduction forbidden without Telit Communications S p A written authorization All Rights Reserved page 5 of 59 a e Telit 1vv0300781 Rev 0 04 06 08 1 Introduction 1 1 Scope This user guide serves the following purpose Provides details about the GE863 PRO software architecture e Describes how software developers can use the functions of Linux device drivers to config
2. S J User Space clibc library Kernel Space System Call Interface Kernel Architecture dependent kernel code Hardware gre Fi is Reproduction forbidden without Telit Communications S p A written authorization All Rights Reserved page 12 of 59 Telit 1vv0300781 Rev 0 04 06 08 Two regions can be identified 1 User space where the user applications are executed 2 Kernel space where the kernel with all its components such as device drivers works These two regions are separated and have different memory address spaces there are several methods for user kernel interaction e Using the System Call Interface that connects user to the kernel and provides the mechanism to communicate between the user space application and the kernel through the C library e Using kernel calls directly from application code leaping over the C library e Using the virtual filesystem The ordinary C library in Linux system is the glibc Uclibc is a C library mainly targeted for developing embedded Linux systems despite being much smaller than the glibc it has almost all its features including shared libraries and threading making easy to port applications from glibc to uclibc The Linux kernel architecture independent code stays on the top of platform specific code for the GE863 PRO board this code is allows exploiting all hardware features of the GE863 PRO
3. L aa 7a ua b Reproduction forbidden without Telit Communications S p A written authorization All Rights Reserved page 21 of 59 fe e Telit 1vv0300781 Rev 0 04 06 08 MsEBGS PROS Hypedienmninal File Edit View Call Transfer Help B 7 at91sam9268 apio 16176 1 g ether Connected 0 09 57 Auto detect 115200 8 N 1 To unload a module type in the terminal i rmmod module name Beware that rmmod removes only modules which are not currently used or are not needed by other modules as a dependency 3 4 Auto Setup at system startup To automatically launch commands after boot create a script file in etc init d called Sxy where Xy is a number starting from 00 to 99 Inside this file put all the commands you need to be started after boot For example suppose you want to load the Ethernet on USB module and to configure this interface create the file etc init d S00 and edit it with the following content modprobe g ether ifconfig usb 192 109 1 9 netmask 2955 29554 2995 0 At the next reboot the script should be executed automatically page 22 of 59 lelit 1vv0300781 Rev 0 04 06 08 3 5 Downloading a file into GEB63 PRO There are several ways to download a file in the target In the following paragraphs you can find explained two of these methods for further details refer to document 4 3 5 1 Downloading a file using the Ethernet connection Be sure to
4. rd e Telit 1vv0300781 Rev 0 04 06 08 VALUE WRITTEN Read example char read buff BUFF LEN read farts read butt sizeort read burtt Close the serial port Close Forts Reproduction forbidden without Telit Communications S p A written authorization All Rights Reserved page 59 of 59
5. close fd return ret 4 4 GPIO The GPIO driver creates a series of devices under the dev directory Each device is named as at91sam97250 gpro spino GPIO pins are numbered from O to 95 The first 32 pins refer to the A bank the second 32 pins refer to the B bank and the others refer to the C bank GPIO pins can be read and written thorough simple read write operations The read operation returns the status and the level of the pin if it is configured as a GPIO otherwise it fails The write operation can change the configuration and output value The configuration can be changed using OQ for output enable with pull up 0 for output enable without pull up input enabled with pull up jinput enabled without pull up j setthe level up 0 set the level low To test a gpio you can use the shell for example gpio number 92 echo O1 gt dev at9lsam9260_gpio 92 to raise up the signal Lm RM a a Eu Reproduction forbidden without Telit Communications S p A written authorization All Rights Reserved page 47 of 59 a e Telit 1vv0300781 Rev 0 04 06 08 The following subparagraphs show all the functions that can be used from C source code to perform read write operations onto GPIOs pins 4 4 1 open The open function establishes the connection between a file and a file descriptor The file descriptor is used by other I O functions to refer to the opened file Header fi
6. rtd WDLIOC SETOPTIONS amp Options j Example to enable the watchdog int options WDIOS ENABLECARD ioctl fd WDIOC SETOPTIONS amp options WDIOC GETTIMEOUT amp P 18 1 cu E i TuS p Er UNAM it P A nu n x 21 i T a ARE y a iiit Reproduction forbidde yr n without Telit Communications S p A written authorization All Rights Reserved page 52 of 59 lelit 1vv0300781 Rev 0 04 06 08 It is possible to query the timeout using the WDIOC GETTIMEOUT ioctl The third argument is an integer representing the timeout in seconds Example roctl td WDIOC GETIIMBEOUI amp trimeout printf The timeout is d seconds n timeout 4 5 3 close The close function deallocates the file descriptor indicated by fildes To deallocate means to make the file descriptor available for subsequent calls to open or other functions that allocate file descriptors Header file unistd h Prototype int close int fildes Parameters fildes file descriptor Returns 0 if operation is completed successfully otherwise it is 1 Example Close the watchdog device if close fd O0 Error Management Routine else e File Closed 4 6 SDIO GE863 PRO support for Secure Digital SD and Multimedia Card MMC is built in the kernel First create a directory where the device will be mounted for example mkdir mnt sdcard Then conn
7. wireless solutions Teli GE863 PRO Linux Software User Guide 1vv0300781 Rev 0 04 06 08 a E y LPT T as u d bw x YA uw WM 1 JP a b a i T 4 I 3 Ne E c L TIL c i 3 Fm E I T i E a A aN 1 r i P LL LL E l Making machines talk a e Telit 1vv0300781 Rev 0 04 06 08 Disclaimer The information contained in this document is the proprietary information of Telit Communications S p A and its affiliates TELIT The contents are confidential and any disclosure to persons other than the officers employees agents or subcontractors of the owner or licensee of this document without the prior written consent of Telit is strictly prohibited Telit makes every effort to ensure the quality of the information it makes available Notwithstanding the foregoing Telit does not make any warranty as to the information contained herein and does not accept any liability for any injury loss or damage of any kind incurred by use of or reliance upon the information Telit disclaims any and all responsibility for the application of the devices characterized in this document and notes that the application of the device must comply with the safety standards of the applicable country and where applicable with the relevant wiring rules Telit reserves the right to make modifications additions and deletions to this document due to t
8. refer to 2 2 2 starts and in the terminal you should see a countdown If you wish to enter in U Boot command mode for further details refer to document 2 press any key otherwise the startup process will continue within a few seconds U Boot loads the kernel image in RAM then starts it 3 07253 91105 yer seririnicl a ize Logical address 0xD0000000 D0000000 to DOO87FFF RO Area 1 D0008000 to DOBIFFFF RO F xxx Warning bad CRC using default environment serial serial serial Hit any key to stop autoboot 2 Connected 0 00 03 Auto detect 115200 8 N 1 e he kernel image decompresses itself and starts After the initial sequence the control is passed to the shell refer to 3 2 which can be used to interact with the target At this point the system is ready to be used Reproduction forbidde gy a n without Telit Communications S p A written authorization All Rights Reserved page 19 of 59 rd e Telit 1vv0300781 Rev 0 04 06 08 GES GS HOJ Jarrin File Edit View Call Transfer Help D 8 DB E Creating 2 MTD partitions on spi0 1 AT45DB642x 0x00000000 0x00131400 RRMboot 0x00131400 0x00840000 root at91 rtc at91 rtc rtc core registered at91 rtc as rtc BT91S8H9 Real Time Clock driver at91sam9 wdt invalid timeout must be between 1 and 16 TCP cubic registered tc clksrc tc0 at 12 625 MHz JFFS2 write buffering enabled buffer 1056 erasesize 84
9. 1vv0300781 Rev 0 04 06 08 Note that on the host you need to load the suitable drivers and configure the new virtual Ethernet link for correct working For further details refer to document 4 To remove the link type ifconfig usb down ra Reproduction forbidden without Telit Communications S p A written authorization All Rights Reserved page 56 of 59 a e Telit 1vv0300781 Rev 0 04 06 08 5 CMUX GE863 PRO implements the GSM 7 10 multiplexing protocol that enables one serial interface to transmit data to different customer applications Using the multiplexer features GE863 PRO can perform e g a fax data GPRS call while using the SMS service Cmux protocol can be enabled by starting cmuxt daemon once the modem has been turned on with the options shown below Synopsis cmuxt parameters Parameters p lt serport gt Serial port device to connect to default value dev ttyS1 b lt baudrate gt MUX mode baudrate 0 9600 19200 115200 u sleep time Sleep time after send AT command msec C crtscts Hw control OFF d Daemonize create a daemon Don t make pts symLinks Links needs root privileges h Show this help message Since GE863 PRO use dev ttyS3 device to access to modem cmuxt is called typing cmuxt p dev ttyS3 b 115200 d Once cmuxt has been started the following four devices are created into dev directory dev cmux1 dev cocmuxz2
10. Inside the kernel we can find among the others the following fundamental components page 13 of 59 lelit 1vv0300781 Rev 0 04 06 08 The Linux kernel is a monolithic one i e all OS services run along with the main kernel thread thus also residing in the same memory area but it has the capability to dynamically load unload some of its components called modules A kernel module is a compiled piece of code which can be dynamically linked to the kernel when is needed becoming part of the kernel as the other normal kernel code then removed when it is no longer needed modules are mainly used for device drivers 2 2 3 2 The GE863 PRO Linux kernel The Linux kernel on the GE863 PRO is based on version number 2 6 24 Below there is a picture showing the kernel main components Libraries Modules Operating System Services 4 D c v Dn i o O gt o MER B SG m Q o 2 Eo gt gt C Q 0 i oO wn O ng c O0 c9 5 Oe 2 F c ir S Low Level Drivers EE 4 p P D LN GC m ier 3 Lee t ELU A 2 2 1 BUS ZI F Jl ae AND ui AER Reproduction forbidden without Telit Communications S p A written authorization All Rights Reserved page 14 of 59 lelit 1vv0300781 Rev 0 04 06 08 The GE863 PRO Linux kernel comes with some of its features linked statically while others are compiled as modules see the tab
11. The constant values defined in the spidev h file will be used to set the SPI mode Please note that SPI CS HIGH SPI CPHA SPI CPOL and SPI MODE 0O SPI MODE 3 are the only constant values listed in the spidev h file supported by the current SPI driver Example uint8 t mode mode SPI CS HIGH SPI CPOL SPI CPHA Beware this is just an example Check your device before setting these fields ret ioctl fd SPI IOC WR MODE amp mode if ret 1 printf can t set SPI mode oPI IOC RD BITS PER WORD and SPI IOC WR BITS PER WORD Get RD or set WR the number of bits per word exchanged The third parameter is a pointer to a byte which will return RD or assign WR the number of bits in each SPI transfer word Example inte Ct Dats ret ioctl fd SPI IOC WR BITS PER WORD amp bits if ret 1 printf can t set bits per word SPI_IOC_RD_MAX_SPEED_HZ and SPI IOC WR MAX SPEED HZ Get RD or set WR the SPI max speed The third parameter is a pointer to a uint32 t which will return RD or assign WR the maximum SPI transfer speed in Hz It is not required that the controller assigns specific clock speed Example uint32 t speed ret ioctl fd SPI IOC WR MAX SPEED HZ amp speed if ret 1 printf can t set max speed hz page 42 of 59 a e Telit 1vv0300781 Rev 0 04 06 08 oPHI IOC MESSAGE otandard read and write operations are obviously only half duplex and
12. VER RE d 22 35 Downloading a file into GES63 PRO scsccsssssesssasstesesscsvssvnssesscbiesedssedacstevasecaveessasatesesnseivessesslovsietarsterers 23 3 5 1 Downloading a file using the Ethernet connection ccccccccccccccccceceeeseeseseseeeeceeeeceeeeeeaaaeaessssesseeeeceeeeeeeeaaaas 23 3 5 2 Downloading a file using an USB mass storage device essssssesssssssssssseseseeeee nennen nennen nennen nnns 24 d PCV ICO DIRUTA ST TETTE 26 4 1 Seral DOT em S 26 MEE SE t r 27 A MACE t 21 2 MEE M enrian T E S AN 28 Adla clo eca E EE OS ATAN 29 page 4 of 59 7 e Telit 1vv0300781 Rev 0 04 06 08 E 29 421 Loading 120 MOC S oscsecsnempu tunteseEedenatuttuntesssaduxudufi tunica ean tuae tus UE E a E Rd tutum Rad RMU do c du esaUR N RRE EE 30 LEA MEE IEEE T m 3 s M MEM ei Rem 32 FP T S E AE A E E 36 M E E E A EN 37 A CO a Em 38 LACE NE MIU o m em 38 4 3 vl m 40 ASA Loading the SPI module E M 40 XM ub ER T 4 MD TOC UY MC Lr 4 A E e E E EE E E E E E E E tsar essen 43 LoS TTBS A A E ET E E E E
13. be set e g O NOCTTY If pathname refers to a terminal device it will not become the process s controlling terminal even in case the process does not have one O NDELAY or O NONBLOCK when possible the file is opened in non blocking mode Returns The new file descriptor fildes if operation is completed successfully otherwise it is 1 Example Open the dev ttyS1 device ime Td 77 tile descriptor for Jdevy ttysl entry if fd open dev ttyS1 O_RDWR O_NOCTTY O NDELAY lt 0 ERROR MANAGEMENT ROUTINE else SERIAL PORT OPENED 4 1 2 read The read function reads nbyte bytes from the file associated with the open file descriptor fildes and copies them in the buffer that is pointed to by buf Header file unistd h Identifies ID of the file T d its Reproduction forbidde n without Telit Communications S p A written authorization All Rights Reserved page 27 of 59 a e Telit 1vv0300781 Rev 0 04 06 08 Prototype ssize t read int fildes void buf size t nbyte Parameters fildes file descriptor buf destination buffer pointer nbyte number of bytes that read attempts to read Returns The number of bytes actually read if operation is completed successfully otherwise it is 1 Example Read sizeof read buff bytes from the file associated with fd and stores them into read buff char read buff BUFF LEN if read fd read
14. client Setting this flag treats any NACK as an ACK and all subsequent messages are sent I2C M NO RD ACK in a read message the ACK NACK bit from the master is skipped The struct i2c msg also contains a pointer into a data buffer The function will write or read data to or from that buffer depending on whether the I2C M RD flag is set or not in the flags field of a particular message Finally in the 1en field you have to set the number of bytes you want to be read written to from the array pointed by buf In the following example we suppose that our slave device is an EEPROM We want to read a data from a specific internal address of the EEPROM in this case the address is 0x0 First we have to do a write with the internal address and then a read of the data struct i2c rdwr ioctl data work queue char buf 1l struct 220 msg mesgs 2 3j butfro eos0s llthqs is the Internal address msgs 0 len 1 msgs 0 flags 0 msgs 0 addr 0x50 this is the device address msgs 0 buf bur msgs 1 addr addr msgs 1 flags I2C M RD msgs 1 len 255 msgs 1 buf buf2 work_queue msgs msgs work_queue nmsgs 2 ret ioctl fd I2C RDWR amp work queue Lf 4 ret OQ 1 Prince Error during I2ZC BDWE ioctl with error coda Sdun Tfe6t else printf The value read at address X is s n buf 0 work_queue msgs 1 buf 2C SMBUS oet the system to do SMBus transfers You also have to use the followi
15. close int fildes Parameters fildes file descriptor Returns 0 if operation is completed successfully otherwise it is 1 Example Close the GPIO device if close fd lt 0 Error Management Routine else 7 Flle Closed 7 4 5 Watchdog A Watchdog Timer WDT is a hardware circuit that can reset the computer system in case of a software fault Usually a userspace daemon will notify the kernel watchdog driver via the dev watchdog special device file that the userspace is still alive at regular intervals When such a notification occurs the driver will usually tell the hardware watchdog that everything is in order and that the watchdog should wait before resetting the system If userspace fails RAM error kernel bug whatever the notifications cease to occur and the hardware watchdog will reset the system causing a reboot after the timeout expires Userspace can interact with the kernel watchdog driver through the functions shown in the paragraphs below 4 5 1 open The open function establishes the connection between a file and a file descriptor The file descriptor is used by other I O functions to refer to the opened file Header file i h P A wu Tras EET Ky 4 n ae L a l a n i r r 4 m ee j y Reproduction forbidde n without Telit Communications S p A written authorization All Rights Reserved page 50 of 59 a e Telit 1
16. cycles once for each bit that is transmitted e Slave Select NSS This control line allows slaves to be turned on and off by hardware it is also called chipselect 4 3 1 Loading the SPI module The SPI driver is released to customer under in the form of a loadable module To load the SPI module type in the terminal modprobe spidev When loaded the SPI driver will installs a new device named spidev1 1 under the dev directory The 1 1 name extension represents the number of the selected SPI bus and the selected chipselect Once installed the SPI device can be used as a normal character device and can be accessed by any application running in userspace ee k 7 2 m A A TT IOIDIGHER without Telit Communications S p A written authorization All Rights Reserved page 40 of 59 a e Telit 1vv0300781 Rev 0 04 06 08 4 3 2 open The open function shall establish the connection between a file and a file descriptor The file descriptor is used by other I O functions to refer to the opened file Header file fcntl h Prototype int open const char pathname int flags Parameters pathname file name with its own path flags is an int specifying file opening mode is one of O RDONLY O WRONLY or O_RDWR which request opening the file read only write only or read write respectively Returns The new file descriptor fildes if operation is completed successfully otherwise it is
17. dev cmux3 dev cmux4 The devices above are the serial virtual channels that have to be accessed by applications in order to perform multiple operations at the same time see figure below Please note virtual port cmux4 is reserved and cannot be used amp P 18 1 cu E i TuS p Er UNAM it P A nu n x 21 i T a ARE y a iiit li 77 Reproduction forbidde n without Telit Communications S p A written authorization All Rights Reserved page 57 of 59 Z e Telit 1vv0300781 Rev 0 04 06 08 GE863 PRO Application 3 5 1 Code example Cmux virtual channels can be simply managed as a serial device as shown in the example below Open the virtual channel port for example dev cmux1 int fdPts Cmux Port l d ev emuxl struct termios serCfg if fdPts open cmux port O RDWR lt 0 recurn Ls else if tcgetattr fdPts amp serCfg 0 revurn 13 cfmakeraw amp serCftg if tcsetattr fdPts TCSANOW amp serCfg 0 recur l3 Commit the desired operation Write example char AT _cmdl1 ATOV p if write fdPts AT cmdl strlen AT cmd1 lt 0 ERROR MANAGEMENT ROUTINE zh a I Qe i TTEA l m J md L2 aem Lond m So gg i i E T3 V oe a j 4 l Ea 3 ae HH j a r i eS EE M i i X E LI I cations S p A written authorization All Rights Reserved page 58 of 59
18. in C C and Python the Telit GE863 PRO is the ideal hardware platform for complete and compact customer solutions Application development is accomplished easily given Telit s continued commitment to open systems With the use of LINUX developers have access to an extensive library of drivers for different peripherals and to complete development environments The GE863 PRO was designed to simplify connectivity through the availability of interfaces such as SPI IIC SD MMC and USB Host Device Telit offers a vast collection of reference designs enabling use of the PRO with external peripherals such as camera keyboard display Wi Fi amp Bluetooth omartCard SD Card Ethernet ZigBee and GPS For further information about hardware refer to document 1 2 2 Software The GE863 PRO software architecture from a high level perspective is based on the following components Telit Bootloader Telit customized U Boot Customized Linux kernel based on 2 6 24 Filesystem page 10 of 59 a e Telit 1vv0300781 Rev 0 04 06 08 Telit Bootloader U Boot Kernel Filesystem 2 2 1 Telit Bootloader Telit Bootloader is a small binary used for hardware related management its main task is to load and start Telit customized U Boot For further details refer to document 2 2 2 2 Telit customized U boot U Boot is the Open Source universal cross platform bootloader supporting hundreds of embedded boards and a w
19. other Telit GSM GPRS modules but also incorporates a standalone ARM9 CPU and memories dedicated to user applications This eliminates the need for an external host CPU in many applications bringing true real time and multi tasking capabilities to an embedded module 1 6 Document Organization This manual contains the following chapters e Chapter 1 Introduction provides a scope for this manual target audience technical contact information and text conventions e Chapter 2 GE863 PRO Architecture provides an overview on GE863 PRO hardware and software architecture describing the main software components Telit Bootloader Telit customized U Boot Linux kernel 2 6 24 and Filesystem e Chapter 3 System Startup describes how to perform the start up process how to download a file onto GE863 PRO and how to load a kernel module e Chapter 4 Device Drivers details Linux device drivers and shows how software developers can use them to interact with GE863 PRO hardware resources and peripherals e Chapter 5 CMUX describes GSM 7 10 multiplexing protocol implemented by GE863 PRO and its use How to Use If you mainly use this document as reference the main chapters of interest are Chapter 3 System Startup and Chapter 4 Device Drivers If you are new to this product it is recommended to start by reading through TelitGE863PRO3 EVK User Guide 1VV0300776 TelitGE863PROS3 Linux Development 1VV0300780 and this document i
20. write functions instead of the ioctl with the I2C RDWR request you ll send messages with a stop condition between them The argument of the 1oct 1 call is a pointer to a struct 2c rdwr ioctl data 1 struct i2c msg msgs ptr to array of simple messages int nmsgs number of messages to exchange where nmsgs is the number of messages to exchange These messages are contained in the struct i2c_msg pointer that points to an array of structures with following definition SLPuct 120 mso 4 _ le addr slave address a uio flags ul16 len msg length u Uo Ipul pointer to msg data Hs In the addr field you have to put the address of the slave device you want to communicate with In the 1ags field you have to set the options among the ones listed below I2C M TEN setting this option you indicate that the address in the addr field is composed by ten bits so you ll use the ten bit address mode I2C_M_RD if set a read operation will be performed if you don t set it it ll automatically do a write operation I2C M NOSTART if set there won t be any start condition during the sending of this message with the i2c protocol I2C M REV DIR ADDR you should set this flag if you want to do a write but need to simulate the process of a Read instead of a normal Write or vice versa lelit 1vv0300781 Rev 0 04 06 08 I2C M IGNORE NAK Normally a message is interrupted immediately if there is NACK from the
21. 1 Example Open the dev spidev1 1 int fd file descriptor for the dev watchdog entry if fd open dev spidevl 1 O RDWR lt 0 Error Management Routine else SPI Device Opened 4 3 3 ioctl The ioctl function manipulates the underlying device parameters In particular many operating characteristics can be controlled with ioctl requests Header file sys ioctl h linux spi spidev h Prototype int ioctl int fildes int request Parameters fildes file descriptor request device dependent request code The following ioctls request codes can be used for SPI OPI IOC RD MODE and SPI IOC WR MODE to get set the SPI mode Reproduction forbidden without Telit Connu S p A written authorization All Rights Reserved page 41 of 59 lelit 1vv0300781 Rev 0 04 06 08 oHI IOC RD BITS PER WORD and SPI IOC WR BITS PER WORD to get set the number of bits per words exchanged SPI IOC RD MAX SPEED HZ and SPI IOC WR MAX SPEED HZ to get set the maximum allowed speed OPI IOC MESSAGE to exchange data in full duplex mode The third argument is a void and depends on the ioctl request code used see the examples below Returns 0 if operation is completed successfully otherwise it is 1 Examples SPI IOC RD MODE and SPI IOC WR MODE Get RD or set WR the SPI mode The third parameter is a pointer to a byte which will return RD or assign WR the SPI transfer mode
22. 48 VFS Mounted root jffs2 filesystem Freeing init memory 100K init started BusyBox v1 6 0 2008 02 29 10 41 52 CET multi call binary starting pid 327 tty etc 1nit d rcS Initializing mdeu dynamic device directory done mount mounting tmpfs on var cache apt failed MBCB mii bus probed eth Atmel MACB at Oxfffc4000 irq 21 00 00 00 00 00 00 ae attached PHY driver Davicom DM916181 mii bus phy addr ffffffff 00 irq 1 RT91S8H9 Watchdog disabled Watchdog card disabled Hello world starting pid 346 tty dev console bin sh H Auto detect 115200 8 N 1 3 2 The Linux shell The Linux shell is a user program that allows you to interact with the target by entering commands from the keyboard the shell parses the command executes it and display the output of the command on the screen When the target has finished booting in the terminal the shell prompt will appear This means that the shell is ready to accept command you can type in the terminal the command you want to execute for example ls You should see the listing of the directory as in the image below Reproduction forbidden without Telit Cor m nicatl ns S p A written authorization All Rights Reserved page 20 of 59 lelit 1vv0300781 Rev 0 04 06 08 Seles a GERAS PRO FI Hypenhenminal Fie Edit View Cal Transfer Help D Ey a Bg at91 rtc a
23. 59 d e Telit 1vv0300781 Rev 0 04 06 08 if fd open dev i2c 0 O RDWR lt 0 Error Management Routine else I2C Device Opened 4 2 3 ioctl The ioctl function manipulates the underlying device parameters In particular many operating characteristics can be controlled with ioctl requests Header file sys ioctl h Prototype int ioctl int fildes int request Parameters fildes file descriptor request device dependent request code The following ioctls request codes can be used for I C Il2C SLAVE I2C SLAVE FORCE to select the slave address I2C TENBIT to set the ten bit addressing I2C PEC to enable the packet error checking I2C FUNCS to get the adapter functionality mask Il2C RDWR to do a combined read write transaction Il2C SMBUS to use SMBus functionalities I2C RETRIES to set the number of retries when not acknowledged Il2C TIMEOUT to set the timeout value The third argument is a void and depends on the ioctl request code used see the examples below Returns 0 if operation is completed successfully otherwise it is 1 Examples 2C SLAVE I2C SLAVE FORCE Both set or change the slave address for the device opened with ile descriptor The address is passed in the 7 lower bits of the addr argument except for 10 bit addresses passed in the 10 lower bits With the I2C SLAVE FORCE request the address passed is used as slave address even i
24. INUS fogees D 8 ES Document IHSUOE Vo eseseex a ERREEREREREENEERY EIN S ERES EU VERRE ENS EREMO XM RENE EVEN UN REESE UEM SEUUN VERE QE DESEE VO FERNER EEEEEE ENS LE 8 2 XES0JS PROP AFCHHIODIUFO e iseisseiteissrenioe dei vie ques ves sme quoi sees cecatsedeastaces E E O T N 9 2 1 NRE Wy AEC oboe E E A E E EE TEET UR Es EUTA E REESE E 9 2 VIDEA IER Pe 10 PMVSMEMMI US uA UNES 11 2 2 2 Telit customized U boot ceeeccccccccccesssscccceeecaeeseeecceeeeeeeeeeeeeeeeeeeeeaeeeeeeeeeeesaeeeeeeeeeeesaaeesseeeeeeeaaeseeeeeeeseaaaeeeeeeeeneas 11 PASS EMEN VOD CLIC ly sy arasatonanetinatannenty EA E A E A 12 2 2 3 1 E AUI 12 2 2 94 The GESOS PROP Linux kernel ausi dossnvonzesieeessntks se eus dodi Veo pRe upto Ed evt M bo SEU FU UPS ANANE d UR K POS KO EXAM DUE E CORE T INE 14 Be TAC Sy SC A E tenahaconenaenoesad A A T AE 15 2 2 4 1 EE a o E O O NEO AAE EEE n 15 2225 2 Thefilesystern SOCIO einer EEEa a aiaa 15 eS B DO aa E E E 18 E D O O a NEENA E T EEE EEEE EA EE 19 3 1 Startup proCESS 2 osicsdioduicepug edo secu sdisteeuslencsiusdedssaasdusvesucdietepeslansstuccabevassdescecuctinacauclansseucsatavassCaseeaweels 19 3 2 The Cna sell sostiene nin Uam eite TU 20 3 3 Intr DL e 21 54 JAuto etup atsystent stari iu iai esses couoi dos eE ENNEA EE F YE YE VADER LESE GUY ERE Ct evED IS E TUER
25. N if read fd read buff sizeof read buff lt O0 Error Management Routine else Value Read 4 4 3 write The write function writes nbyte bytes from the buffer that are pointed by buf to the file associated with the open file descriptor fildes Header file unistd h Prototype ssize t write int fildes const void buf size t nbyte Parameters fildes file descriptor buf destination buffer pointer nbyte number of bytes that write attempts to write Returns The number of bytes actually written if operation is completed successfully this number shall never be greater than nbyte otherwise it is 1 Example Write sizeof value to be written bytes from the buffer pointed by value to be written to the file associated with the open file descriptor fd char value to be written O1 if write fd value to be written sizeof value to be written lt 0 Error Management Routine else Value Wratten 7 Reproduction forbidde EF d n n without Telit Communications S p A written authorization All Rights Reserved page 49 of 59 a e Telit 1vv0300781 Rev 0 04 06 08 4 4 4 close The close function deallocates the file descriptor indicated by fildes To deallocate means to make the file descriptor available for subsequent calls to open or other functions that allocate file descriptors Header file unistd h Prototype int
26. UT jiffies 4 2 4 read The read function reads nbyte bytes from the file associated with the open file descriptor fildes and copies them in the buffer that is pointed to by buf Reproduchon forbidden without Telit Connu S p A written authorization All Rights Reserved page 36 of 59 a e Telit 1vv0300781 Rev 0 04 06 08 Header file unistd h Prototype ssize t read int fildes void buf size t nbyte Parameters fildes file descriptor buf destination buffer pointer nbyte number of bytes that read attempts to read Returns The number of bytes actually read if if operation is completed successfully otherwise it is 1 Example Read sizeof read buff bytes from the file associated with fd and stores them into read buff char read buff BUFF LEN if r ad td read burt sizeof read buff 0 Error Management Routine else Value Read 4 2 5 write The write function writes nbyte bytes from the buffer that are pointed by buf to the file associated with the open file descriptor fildes Header file unistd h Prototype ssize t write int fildes const void buf size t nbyte Parameters fildes file descriptor buf destination buffer pointer nbyte number of bytes that write attempts to write Returns The number of bytes actually written if operation is completed successfully this number shall never be greater than nbyte o
27. a e Telit 1vv0300781 Rev 0 04 06 08 fildes file descriptor buf destination buffer pointer nbyte number of bytes that read attempts to read Returns The number of bytes actually read if operation is completed successfully otherwise it is 1 Example Read sizeof read buff bytes from the file associated with fd and stores them in read buff char read buff BUFF LEN if read fd read buff sizeof read buff lt O0 Error Management Routine else Value Read 4 3 5 write The write function writes nbyte bytes from the buffer that are pointed by buf to the file associated with the open file descriptor fildes Header file unistd h Prototype ssize t write int fildes const void buf size t nbyte Parameters fildes file descriptor buf destination buffer pointer nbyte number of bytes that write attempts to write Returns The number of bytes actually written if operation is completed successfully this number shall never be greater than nbyte otherwise it is 1 Example Write sizeof value to be written bytes from the buffer pointed by value to be written to the file associated with the open file descriptor fd char value to be written dummy write if write fd value to be written sizeof value to be written lt 0 Error Management Routine n fy a E f mE Reproduction forbidden without Telit Communica
28. ains executable files are mainly used by the root user for administration task By default in the GE863 PRO most of these files are symbolic links that depend on Busybox see paragraph 2 2 4 3 sys This directory contains system files used for device configuration tmp This directory contains temporary files fuse This directory contains files and directories related to user tools and applications By default in the GE863 PRO some of these files are symbolic links that depend on Busybox see paragraph 2 2 4 3 27 a This directory contains variable data files The mount point is the location in the operating system s directory structure where a mounted file system appears li 77 Reproduction forbidde n without Telit Communications S p A written authorization All Rights Reserved page 17 of 59 a e Telit 1vv0300781 Rev 0 04 06 08 2 2 4 3 Busybox Inside the filesystem in the directory bin there is the Busybox Busybox gives the user a set of commands useful to interact with the system with it the user can carry out normal tasks such as copying files cp command listing directories 1s command deleting files cm command etc etc BusyBox combines tiny versions of many common UNIX utilities into a single small executable It provides replacements for most of the utilities usually found in a GNU Linux system Note that the utilities in BusyBox generally have fewer options than their fu
29. buff sizeof read buff lt O0 Error Management Routine else Value Read 4 1 3 write The write function writes nbyte bytes from the buffer that are pointed by buf to the file associated with the open file descriptor fildes Header file unistd h Prototype ssize t write int fildes const void buf size t nbyte Parameters fildes file descriptor buf destination buffer pointer nbyte number of bytes that write attempts to write Returns The number of bytes actually written if operation is completed successfully this number shall never be bigger than nbyte otherwise it is 1 Example Write sizeof value to be written bytes from the buffer pointed to by value to be written to the file associated with the open file descriptor fd char value to be written Hello world r n Reproduction forbidde BF a i n without Telit Communications S p A written authorization All Rights Reserved page 28 of 59 a e Telit 1vv0300781 Rev 0 04 06 08 If Owritetcrd value ro be written Sizeoft value to be written lt U Error Management Routine else Value Written 4 1 4 close The close function deallocates the file descriptor indicated by fildes To deallocate means to make the file descriptor available for subsequent calls to open or other functions that allocate file descriptors Header file unistd h Prototype int
30. close int fildes Parameters fildes file descriptor Returns 0 if operation is completed successfully otherwise it is 1 Example Close the dev ttyS1 device if close fd O0 Error Management Routine else File Closed 4 2 C The GE863 PRO is provided with the Atmel Two wire Interface TWI It is useful to connect several components like EEPROM and I C compatible device using a unique two wire bus In this chapter is described how to load I C modules on the Linux Operating System and how to do a little test with a C program that opens the I C bus interface i e dev i2c 0 and writes some data on the device Reproduction forbidde EF d n n without Telit Communications S p A written authorization All Rights Reserved page 29 of 59 lelit 1vv0300781 Rev 0 04 06 08 Although there are many I C devices and chips we can use a unique I C kernel interface composed by a core module used by both master and slave device modules In the following picture we can see the whole module structure a more specific algorithm module optional module i2c dev module i2c algo bit module i2c core i module i2c gpio mamucme l ae device aver modes MI driver modules gp other optional adapter modules So in our system in order to use the I C Interface the following steps shall be followed Load the i2c core module Load the i2c algo bit module Load the i2c de
31. ect the device and mount it mount dev mmcblk0O0p1 mnt sdcard Reproduction forbidde EF f n n without Telit Communications S p A written authorization All Rights Reserved page 53 of 59 rd e Telit 1vv0300781 Rev 0 04 06 08 The device is now ready to be used Note that the card filesystem must be Fat Fat32 in order to work correctly To un mount the device type umount mnt sdcard 4 Ethernet The GE863 PRO Linux operating system is able to drive an Ethernet interface the Ethernet support is built as a module To load the module type in the terminal modprobe macb Once the module is loaded you will find a new Ethernet device called et h0 to properly configure the device use the ifconfig command First of all you have to assign the MAC address ifconfig ethO hw ether MAC address gt For example ifconfig ethO hw ether AA BB AA BB AA BB Then you have to assign the IP address and netmask ifconfig ethO ip address gt netmask lt netmask gt For example suppose you want to assign the IP address 192 168 1 12 to the device with a netmask 255 255 255 0 ifconfig ethO 192 168 1 12 netmask 255 255 255 0 To test if everything works correctly on the device you can type ping lt ip address of another station in the network gt And you should see packets transmission Lm Aw ji F 1 a Eu Reproduction forbidden without Telit Communications S p A writte
32. erved for i2c To load the i2c dev module type the command modprobe i2c dev 4 The i2c gpio module is an adapter driver or in other words a bus controller for the GPIO bus If we don t load adapter driver we won t be able to find any item in the dev directory So we have to load one adapter driver for each I C bus in our system In this case we ll have only one bus and its correspondent driver To load the i2c gpio module type the command modprobe i2c gpio 5 Of course you ll need to use the I C Interface to connect I C chips or devices to your system So after loading the previous modules you may also need to load the driver module s of your specific device s In order to do this you can use the modprobe command followed by your module s name 4 2 2 open The open function establishes the connection between a file and a file descriptor The file descriptor is used by other I O functions to refer to opened file Header file fcntl h Prototype int open const char pathname int flags Parameters pathname file name with its own path flags an int specifying file opening mode that can be O RDONLY O WRONLY or O_RDWR which requests opening the file read only write only or read write respectively Returns The new file descriptor fildes if operation is completed successfully otherwise it is 1 Example Open the dev i2c 0 ids Ses file descriptor for the dev watchdog entry page 31 of
33. ess of the I C device you want to write Otherwise you can initialize that variable with a random value In this case you can connect an oscilloscope to the SDA and SCL pins of the board to observe the behaviour of the signal on the pins If you connect an I C device to the board the write call should be successful and the program should report Write OK Otherwise the program displays Write error but this is not a problem it only means that there is no device connected on the bus 4 3 SPI The Serial Peripheral Interface SPI is a synchronous four wire serial link used to connect microcontrollers to sensors memory and peripherals The Serial Peripheral Interface is essentially a shift register that serially transmits data bits to other SPIs During a data transfer one SPI system acts as the master and controls the data flow while the other devices act as slaves The SPI system consists of two data lines and two control lines Master Out Slave In MOSI This data line supplies the output data from the master shifted into the input s of the slave s Master In Slave Out MISO This data line supplies the output data from a slave to the input of the master There may be no more than one slave transmitting data during any particular transfer e Serial Clock SPCK This control line is driven by the master and regulates the flow of the data bits The master may transmit data at a variety of baud rates the SPCK line
34. exclusively dedicated to customer applications The GE863 PRO incorporates much of the necessary hardware for communicating microcontroller solutions including the critical element of memory significant simplification of the bill of material vendor management and logistics effort are achieved Below there is a simple plot and a list of the GE863 PRO key elements 8MB 4MB SDRAM FLASH o A Antenna i lt a gt a 5 E Power Mgmt GSM 26 Radio MHZ ARM9 9 Power Mgmt AT91SAM9260 GSM GPRS i Baseband Oscillator PROCESSOR 32 6 MHz m KHZ i i Ball Grid Array EF 3 j pte A j ri 2 T e j ur T SE HF E 1 Reproduction forbidden without Telit Communications S p A written authorization All Rights Reserved page 9 of 59 felit 1vv0300781 Rev 0 04 06 08 e Atmel AT91SAM9260 microcontroller 200 Mips at 180Mhz MMU EmbeddedICE Debug Communication Channel Support 8MB SDRAM Mobile Micron 4MB Serial Flash Atmel via SPI interface Quad band EGSM 850 900 1800 1900 Mhz 4 A D with A D trigger and 6 PWM D A converters 1 USB device and 2 USB host 1 IIC interface 2 SPI bus interface 1 SSC digital audio interface 1 image sensor interface 6 USARTs and 1 UART 1 MMC and SD cards interface The GE863 PRO is offered in a Ball Grid Array BGA package enabling a very low profile and small product size required for the design of extremely compact applications With its extended programming capabilities
35. have the Telit Development Environment correctly installed with an Ethernet connection up and coLinux started refer to document 4 for further details In the host system go to Start Telit Development Platform Console and the Linux console will be opened Type cd mnt windows Now the current directory is where the Windows partition has been mounted Loading uzr share keumaps is38b quertu it kmap gz debianz ed mnt windawz debiani mnt windouwss D Once identified the file to be copied use the cp command in the following form cp r path where the file is gt lt file name var www apache2 default For example cp r ARM binaries executable var www apache2 default The file is ready to be uploaded in the target open the terminal software as explained in 3 1 and when the shell is ready within the directory where you want to place the uploaded file type t wget http 192 168 121 2 apache2 default file name gt b 7 7 a ie HPA AF i a i Reproduction forbidden without Telit Communications S p A written authorization All Rights Reserved page 23 of 59 lelit 1vv0300781 Rev 0 04 06 08 You should see an output similar to that in the image below supposing that the file is called serialTest e cru A BRO 3 rhygsr Fari I File Edit View Call Transfer Help F wget http 192 168 121 2 apache2 default seriallest Connecting to 192 168 121 2 192 168 121 2 88 lse
36. hts Reserved page 45 of 59 define ARRAY SIZE a static const char device dev spidev1 1 sizeof a Static void myTransfer int fd LIC Lewy LC 1 0 Hints t txi OXFF 0x40 xFFE OxFF OxFF OXDHB OxEO OXF FE 0x00 xFE OxFF XFE OxAD OxOD xEE 0x00 OxFF OXFF OxFF XBH OxFF 0x00 OxFF OxFE XxPE OxEF Sazeor la OxFF 0x00 OxFF OFF OxFF US BA 19013 OxFF Ux 95 OxFF xP Fr XEN OxAD a e Telit 1vv0300781 Rev 0 04 06 08 by uint8 t rx ARRAY SIZE tx 0 if write fd tx ARRAY SIZE tx ARRAY SIZE tx printf Write Failed n else pDrintr l AnTransmrirtted Burferf in 5s for i2 0 i lt ARRAY SIZE tx 1F Print OUxex tx a1 73 1 1 10 amp amp i 20 Prince Tin IT rescdord rx ARRAY SIZE tx ARRAY SIZE tx printf nRead Failed n else printf unBeceived Burrer n for i 0 i lt ARRAY SIZE tx 1 DETHCT U0x2 x if i 10 pL T3 s le Printi nA NON forbidden without Telit earmlnicalions S p A written authorization All Rights Reserved page 46 of 59 e Telit 1vv0300781 Rev 0 04 06 08 return int malmixmo argo Char atgvill int ret 0 inc id fd open device O_RDWR if fd lt 0 princi can t Open device return L myTransfer fd
37. ide variety of microcontrollers the Atmel AT91SAM9260 included Some of the features provided by U Boot are Hardware initialization Providing boot parameters for the Linux kernel Starting the Linux kernel Reading and writing memory locations Uploading new binary images to the board s RAM Copying binary images from RAM to FLASH memory Storing environment variables which can be used to configure the system The GE863 PRO has a customized version of U Boot to get the most out of the board For further Fs t F T ra Hu pum re a e ie aL Reproduction forbidden without Telit Communications S p A written authorization All Rights Reserved page 11 of 59 a e Telit 1vv0300781 Rev 0 04 06 08 2 2 3 Linux kernel 2 2 3 1 Overview The kernel is the central part of the GNU Linux operating system its main task is to manage system s resources in order to make the hardware and the software communicate A kernel usually deals with process management including inter process communication memory management and device management The Linux kernel belongs to the family of Unix like operating system kernel created in 1991 it has been developed by a huge number of contributors worldwide during these years becoming one of the most common and versatile kernel for embedded systems Below there is a schematic representing from a high level perspective the architecture of a GNU Linux operating system
38. l h gt Reproduction forbidde EF f n n without Telit Communications S p A written authorization All Rights Reserved page 38 of 59 Z e Telit 1vv0300781 Rev 0 04 06 08 tinclude 5U8 100tl h include lt stdio h gt include lt stdlib h gt include lt unistd h gt include lt linux i2c h gt include linux i2c dev h int main iit xj char val Cher bur int addr 0x40 This I2C address is a random value because no device is attached on the bus if you connect a device change this value with the correct one fd open dev i2c 0 O_RDWR Le Ic ow Uy 4 rprintf stderr Error during o penun exit 1 The following ioctl call sets in slave mode the device located at the addr address if ioctl fd I2C SLAVE addr lt O printi stderr Error during TOCTI n exit 1 j PUTO SD Pre ih es es Durlsp USt DUTLS a for val 1 val valt 1 255 buf 4 val if wrrte fd but 5 1e 5 frprintfistocerr Write error 9d n varl else fprintfisboerr Write OR 6d n val usleep 500000 return Uj S zu i te a ur i i x e TID j y i mi tions S p A written authorization All Rights Reserved page 39 of 59 rf e Telit 1vv0300781 Rev 0 04 06 08 If you have some I C device connected to the board you ll have to set the addr variable with the correct addr
39. le fcntl h Prototype int open const char pathname int flags Parameters pathname file name with its own path flags is an int specifying file opening mode is one of O RDONLY O WRONLY or O_RDWR which request opening the file read only write only or read write respectively Returns The new file descriptor fildes if operation is completed successfully otherwise it is 1 Example Open the GPIO device for example number 92 inc idi file descriptor for GPIO dev entries if fd open dev at91sam9260 gpio 92 O RDWR lt 0 Error Management Routine else Gpio Opened 4 4 2 read The read function reads nbyte bytes from the file associated with the open file descriptor fildes and copies them in the buffer that is pointed to by buf Header file unistd h Prototype ssize t read int fildes void buf size t nbyte Parameters fildes file descriptor buf destination buffer pointer nbyte number of bytes that read attempts to read li IE j I Reproduction forbidde n without Telit Communications S p A written authorization All Rights Reserved page 48 of 59 a e Telit 1vv0300781 Rev 0 04 06 08 Returns The number of bytes actually read if operation is completed successfully otherwise it is 1 Example Read sizeof read buff bytes from the file associated with fd and stores them into read buff char read buff BUFF LE
40. le below At the moment available drivers are Driver Name Module Module Name GPIO N N A MMC SD N N A Ethernet Y macb Usb Human Interface Device Y usbhid Support for Host side USB Y ohci hcd Support for USB Mass Storage Y usb storage USB Ethernet Gadget Y g ether i2c core i2c algo bit Be Y i2c dev i2c gpio SPI Y Spidev 2 2 4 Filesystem 2 2 4 1 Overview A filesystem is the entity where the files are placed logically for storage and retrieval The filesystem also specifies conventions for naming files e g maximum number of characters for the file name Usually the file system has a hierarchical tree structure files are placed in directories inside this tree structure The GE863 PRO has the JFFS2 a log structured file system specifically for use on flash devices in embedded systems It implements file compression with the following formats Zlib LZO Real time 2 2 4 2 The filesystem structure The image below shows the filesystem root tree page 15 of 59 Z e Telit 1vv0300781 Rev 0 04 06 08 bin dd ev etc home 5 n oldroot proc root sbin sys tmp 1 us bin This directory contains essential tools and other programs so called binaries note that by default in the GE863 PRO a most of these files are symbolic link that depend on Busybox see paragraph 2 2 4 3 Moreover the Busybox binary is also placed under this directory dev This directory contains files rep
41. ll featured GNU counterparts however the options that are included usually satisfy the users needs and provide a fairly complete POSIX environment Busybox is composed of e A single binary placed in bin which is the real executor of the various utilities e A number of symbolic links through all the filesystem having the name of the various utilities cp ls kill etc which refer to the Busybox binary To discover the currently defined commands for the GE863 PRO open a terminal refer to 3 1 for further details and type Tr od bin busybox To see help content for any command type in the terminal command name help Reproduction forbidde BF a i n without Telit Communications S p A written authorization All Rights Reserved page 18 of 59 rd e Telit 1vv0300781 Rev 0 04 06 08 3 System Startup 3 1 Startup process Connect the GE863 PRO to your host system via serial cable use Debug port of the EVK for further details refer to document 3 In your host system open a terminal program such as Hyper Terminal and use the following parameters for the connection Bits per second 115200 Data bits 8 Parity None Stop bits 1 Flow Control None After turning on the GE863 PRO the following operations occur e The Telit Bootloader refer to 2 2 1 starts and after initializing the hardware it loads the U Boot image from flash into RAM and runs it e Telit customized U Boot
42. n their entirety in order to understand and the concepts and specific features provided by the built in software of the GE863 PRO 1 7 Text Conventions This section lists the paragraph and font styles used for the various types of information presented in this user guide TT IOIDIGHER without Telit Communications S p A written authorization All Rights Reserved page 7 of 59 a e Telit 1vv0300781 Rev 0 04 06 08 Format Content Courier Linux shell commands filesystem paths and example C source code 1 8 Helated Documents The following documents are related to this user guide 1 TelitGE863PRO3 Hardware User Guide 1vv0300773a 2 TelitGE863PRO3 U BOOT Software User Guide 1vv0300777 3 TelitGE863PRO3 EVK User Guide 1VV0300776 4 TelitGE863PRO3 Linux Development Environment 1VV0300780 5 TelitGE863PRO3 Linux GSM Library User Guide 1vv0300782 6 TelitGE863PROS3 Product Description 80285ST10036a All documentation can be downloaded from Telits official web site www telit com if not otherwise indicated 1 9 Document History Revision Date Changes ISSUE 0 04 06 08 First Release Reproduchon forbidden without Telit Connu S p A written authorization All Rights Reserved page 8 of 59 rf e Telit 1vv0300781 Rev 0 04 06 08 2 GE863 PRO Architecture 2 1 Hardware The GE863 PRO is an innovation to the quad band RoHS compliant GE863 product family which includes a powerful ARM9 processor core
43. n authorization All Rights Reserved page 54 of 59 Z e Telit 1vv0300781 Rev 0 04 06 08 4 8 USB 4 8 1 USB Mass Storage Any type of USB Mass Storage Device can be connected to the GE863 PRO For that purpose some kernel modules have to be loaded Type in the terminal modprobe ohci hcd modprobe usb storage Now create a directory where the device will be mounted for example mkdir mnt usbdevO Connect the device then mount it mount dev sdal mnt usbdev0 Note that the GE863 PRO has two USB ports A type so if you connect two devices they will be called dev sdal and dev sdbl To un mount the device type umount mnt usbdevO 4 8 2 USB device Ethernet Gadget The GE863 PRO has Ethernet on USB capabilities so the USB link B type target side A type PC side can behave like a normal Ethernet link For that purpose some kernel modules need to be loaded Type in the terminal modprobe g ether Connect the USB cable and configure the interface ifconfig usbO0 ip address netmask lt netmask gt For example ifconfig usb 192 168 121 383 netmask 255 255 2755 0 To test the correct working of the device you can type ping lt ip address of another station in the network gt And you should see packets transmission n a i d 57 Reproduction forbidde n without Telit Communications S p A written authorization All Rights Reserved page 55 of 59 lelit
44. n case it s already in use by another program or driver Example long addr 0x5 ret roctl rile descriptor ZC SLAVE addr LH ER le ri Reproduction forbidde n without Telit Communications S p A written authorization All Rights Reserved page 32 of 59 a e Telit 1vv0300781 Rev 0 04 06 08 II fret g Praner An rror OOOUPESO XH XO09bL U j 2C TENBIT Selects ten bit addresses if the select argument does not equal 0 selects normal 7 bit addresses if the select argument equals 0 The default value is 0 This request is only valid if the adapter has I2C FUNC 10BIT ADDR Example long select 0 ret ioctl file descriptor I2C TENBIT select 2C PEC Selects SMBus PEC Packet Error Checking generation and verification if select argument does not equal 0 disables if select equals 0 The default value is O It is used only for SMBus transactions This request only has an effect if the adapter has I2C FUNC SMBUS PEC this might not be available and will have no effect Example long select 0 ret ioctl file descriptor I2C PEC select 2C FUNCS Gets the adapter functionality mask and puts it in funcs Example unsigned long funcs user ioctl file descriptor I2C FUNCS amp funcs After this call the uncs mask should be equal to FFF800F the hexadecimal value for 1111111111111000000000001111 which indicates that the following adapter functionalities a
45. ng data structure struct 12c smbus ioctl data 1 u8 read write u8 command i UT P a P fr j i I i E SS E 1 Reproduction forbidden without Telit Communications S p A written authorization All Rights Reserved page 35 of 59 a e Telit 1vv0300781 Rev 0 04 06 08 342 Size union iz2c smb s data u8 byte _ ule word Xo block IZC_SMBUS BLOCK MAX 2 block 0 is used for length and one more for user space compatibility j bi The read write variable can be configured with I2C SMBUS READ or with 12C_SMBUS_WRITE The command values are always valid The size value can be l2C SMBUS BLOCK PROC CALL 12C SMBUS QUICK l2C SMBUS PROC CALL Il2C SMBUS BYTE l2C SMBUS BYTE DATA Il2C SMBUS WORD DATA I2C SMBUS BLOCK DATA I2C SMBUS I2C BLOCK Example struct i20 smbus ioctl data myomd mycmd read write 0 mycmd command 0 mycmd size I2C_SMBUS_QUICK this means probe if this address replies mycmd data NULL perteloctli rt li2C SMBUS e amp mvyomo s if ret lt 0 printf An error occurred in ioctl 2C RETRIES sets the number of times a device address should be polled when not acknowledging Example unsigned long num_retries 4 res ioctl file descriptor I2C RETRIES num retries 2C TIMEOUT With this macro you can set the timeout value in jiffies Example unsigned long jiffies 100 res ioctl file descriptor I2C TIMEO
46. or debugging ttyS2 available ttyS3 A available e g for accessing the GSM modem Refer to document 3 for further information about hardware setup of serial ports before using them If you want to test the ttyS1 serial port you can for example connect with a serial cable your host pc and the GE863 PRO on ttyS1 On GE863 PRO shell type cat dev ttyS1 amp in order to print on standard output any character received over this serial port Now open a terminal on you host pc by default configured for 9600 data rate and type for example hello lt carriage return TT IOIDIGHER without Telit Communications S p A written authorization All Rights Reserved page 26 of 59 a e Telit 1vv0300781 Rev 0 04 06 08 to write the hello test string over ttyS1 The following subparagraphs show all the functions that can be used from C source code to perform read write operations on the serial devices 4 1 1 open The open function establishes the connection between a file and a file descriptor The file descriptor is used by other I O functions to refer to that file Header file fcntl h Prototype int open const char pathname int flags Parameters pathname file name with its own path flags an int specifying file opening mode is one of O RDONLY O WRONLY or O RDWR which request opening the file read only write only or read write respectively In addition zero or more file flags can
47. re available I2C FUNC I2C I2C FUNC 10BIT ADDR I2C FUNC PROTOCOL MANGLING I2C FUNC SMBUS HWPEC CALC I2C FUNC SMBUS BLOCK PROC CALL I2C FUNC SMBUS QUICK I2C FUNC SMBUS READ BYTE I2C FUNC SMBUS WRITE BYTE I2C FUNC SMBUS READ BYTE DATA I2C FUNC SMBUS WRITE BYTE DATA I2C FUNC SMBUS READ WORD DATA I2C FUNC SMBUS WRITE WORD DATA I2C FUNC SMBUS PROC CALL E i gt al m IE a alie ES i 2 ay 4e cre fae a E t Reproduction forbidden without Telit Communications S p A written authorization All Rights Reserved page 33 of 59 rf e Telit 1vv0300781 Rev 0 04 06 08 I2C FUNC SMBUS READ BLOCK DATA I2C FUNC SMBUS WRITE BLOCK DATA IL2C FUNC SMBUS READ IZC BLOCK I2C FUNC SMBUS WRITE I2C BLOCK I2C FUNC SMBUS BYTE I2C FUNC SMBUS BYTE DATA I2C FUNC SMBUS WORD DATA I2C FUNC SMBUS BLOCK DATA i2C FUNC SMBUS LA2C BLOCK Of course if the funcs mask is different from FFF800F the system will support different functionalities See the i2c h file in the linux source tree for the available functionalities 20C RDWR Do a combined read write transaction without break in between This is valid only if the adapter has I2C FUNC 2C The difference between doing normal read write calls and using an ioct1 with the I2C RDWR request is that in the second case you can do the several read or write using the repeated start condition between two messages If you use multiple calls to read and
48. resenting the system s various hardware devices Here for example can be found all the devices representing the various GPIOs feto This directory contains system configuration files startup files other Here for example can be found the file fstab used for mounting the various devices in the filesystem home This directory contains the home directories of the various users lib Reproduction forbidde z kt E psi E cont Vel m A i rahe EJ 1 a van Seen ess me n E A CEEP 77 f mi n without Telit Communications S p A written authorization All Rights Reserved page 16 of 59 a e Telit 1vv0300781 Rev 0 04 06 08 This directory contains shared libraries requiered by programs for example here there can be found the uclibc libraries Moreover in its subdirectories there are the various loadable kernel modules for example the modules for USB Mass Storage Devices they can be easily recognized by the ko extension mnt This directory contains the mount points for the various devices oldroot By default this directory is empty It is used by the system for the startup process prog This directory contains virtual folders and files which represent the current state of the kernel for example here you can find info about the cpu type cat proc cpuinfo 7 LOCC This directory is the home of the user root By default it is empty Jabin This directory cont
49. rlallest 160 3636363636 QE JE JE JE ME QE QE EE IE OE QE E JE E OE OE OEC OE JE ME HE 218042 AA 0G A FTA home mnt root SyS var lib oldroot sbin tmp linuxre proc seriallest usr Connected 0 02 39 Auto detect 115200 8 N 1 The 1s command shows that the file has been downloaded To remove the file from the development environment type in the Linux console rm rf var www apache2 default file name gt 3 5 2 Downloading a file using an USB mass storage device Follow the procedure described in 4 8 1 for mounting the device for example an USB memory key Then type in the terminal cd mnt usbdevO in order to have the current working directory in the USB mass storage device Now the file can be copied using the cp command cp file name directory where the file is to be copied page 24 of 59 Z e Telit 1vv0300781 Rev 0 04 06 08 For example cp test c home Qi GEB6S PROS Hyperienninal File Edit View Cal Transfer Help Lay a Eg I cd mnt usbdev l cp test c home t Is home httpd test c Auto detect 115200 8 N 1 The 1s command shows that the file has been copied Reproduction forbidden page 25 of 59 rf e Telit 1vv0300781 Rev 0 04 06 08 4 Device Drivers Under Linux OS devices distinguish among three fundamental types char block and network Each kernel module see paragraph 2 2 3 usually implements one of these types and th
50. t91 rtc rtc core registered at91 rtc as rtc IHI91S5B8H9 Real Time Clock driver at91sam9 wdt invalid timeout must be between 1 and 16 ICP cubic registered tc clksrc tc at 12 625 MHz JFFS2 write buffering enabled buffer 1056 erasesize 8448 VFS Mounted root jffs2 filesystem Freeing init memory 100K init started BusyBox v1 6 0 2008 02 29 10 41 52 CET multi call binary starting pid 327 tty etc 1init d rcS lInitializing mdey dynamic device directory done mount mounting tmpfs on var cache apt failed IMBCB mii bus probed leth Atmel MACB at Oxfffc4000 irq 21 00 00 00 00 00 00 leth attached PHY driver Davicom DM9161A mii bus phy addr ffffffff 00 1 HI915HH9 Watchdog disabled Watchdog card disabled Hello world ee pid 346 tty deyv console bin sh H l etc lib mnt proc sbin tmp home linuxrc oldroot root Sys usr Connected 0 14 05 Auto detect 1152008 N 1 ROLL 3 9 Loading a module To load a module type in the terminal modprobe module name gt refer to 2 2 3 2 for modules name By default modprobe tries to load the module from the directory and subdirectories where modules are usually stored Some of the modules are dependent form others and require loading of other modules first modprobe commits to solve these dependencies before loading the specified module To see which modules are currently loaded in the kernel use the 1smod command as shown below
51. the chipselect is deactivated between those operations Full duplex access and composite operation without chipselect de activation is available using the SPI IOC MESSAGE N request Please note that the SPI IOC MESSAGE N request needs as parameter a pointer to struct spi ioc transfer Whose fields speed hz and bits per word mustbe setto O Example uint8 t tx OXPEP UXFF D XxEE OXFE QOXERBR UDOER Uxd0 0x00 0x00 0X007 0x00 0x95 OXFF OXFE O xFE xFE OXEF OxEF OXFF OXFE OxFFE OXEFE OXPE O xEF OxFE OXFFE O xFF O xEE OxPE OxEF OxDE OxAD OxBE OxEF OxBA OxAD O xPFO Ox D bi uint8 t rx ARRAY SIZE tx 0 JH struct spi ioc transfer tr tx buf unsigned long tx rx buf unsigned long rx Len ARRAY SIZE CX delay usecs delay Delay before chipselect deactivation Speed hz 0 Must be set to 0 bits per word 0 Must be set to 0 by for i 0 i lt 100 i ret ioctl fd SPI IOC MESSAGE 1 amp tr if ret 1 printf can t send spi message 4 3 4 read The read function reads nbyte bytes from the file associated with the open file descriptor fildes and copies them in the buffer that is pointed to by buf Header file unistd h Prototype ssize t read int fildes void buf size t nbyte Parameters Reproduction forbidden without Telit Communications S p A written authorization All Rights Reserved page 43 of 59
52. therwise it is 1 Example rx m k i 1 l Li I i pi x F I Fuer m s uu P BER r gs i bh at A Mn Ma t memg l Reproduction forbidden without Telit Communications S p A written authorization All Rights Reserved page 37 of 59 lelit 1vv0300781 Rev 0 04 06 08 Write sizeof value to be written bytes from the buffer pointed by value to be written to the file associated with the open file descriptor fd char value to be written dumy write if write fd value to be written sizeof value_to_be written lt 0 Error Management Routine else Value Written 4 2 6 close The close function deallocates the file descriptor indicated by fildes To deallocate means to make the file descriptor available for subsequent calls to open or other functions that allocate file descriptors Header file unistd h Prototype int close int fildes Parameters fildes file descriptor Returns 0 if operation is completed successfully otherwise it is 1 Example Close the I C device if close fd lt 0 Error Management Routine else File Closed 4 2 A Test Program The following simple C program is useful to test the I C interface It opens the dev i2c interface and calls the write function in an infinite loop to write some random values on the device include lt sys types h gt include lt sys stat h gt include lt fcnt
53. thorization All Rights Reserved page 51 of 59 a e Telit 1vv0300781 Rev 0 04 06 08 0 if operation is completed successfully otherwise it is 1 Examples WDIOC KEEPALIVE The AT91Sam9260 watchdog driver supports the WDIOC KEEPALIVE ioctl It notifies the watchdog that userspace is still alive In this case the third argument in the ioctl is ignored This function call resets the timer and leaves the system alive is used to avoid reset when the watchdog is active Example fd open dev watchdog O WRONLY int dummy for l ioctl fd WDIOC KEEPALIVE amp dummy sleep 1 WDIOC SETTIMEOUT Setting Timeout is performed by the SETTIMEOUT ioctl The third argument is an integer that represents the timeout in seconds max timeout is 16 seconds in at91sam92060 architecture The driver returns the real timeout used in the same variable and this timeout can be different from the one that has been set due to limitation of the hardware The watchdog timeout can be written only once at91sam9260 only permits one program operation Example int timeout 215 ioctl fd WDIOC SETTIMEOUT amp timeout Notice If the watchdog start is enabled the user must set the timeout otherwise it will use the default value WDIOC SETOPTIONS It enables or disables the watchdog The third argument is an integer indicating the option to be set Example to disable the watchdog int options WDIOS DISABLECARD looctl
54. tions S p A written authorization All Rights Reserved page 44 of 59 a e Telit 1vv0300781 Rev 0 04 06 08 L Value Written 4 3 6 close The close function deallocates the file descriptor indicated by fildes To deallocate means to make the file descriptor available for subsequent calls to open or other functions that allocate file descriptors Header file unistd h Prototype int close int fildes Parameters fildes file descriptor Returns 0 if operation is completed successfully otherwise it is 1 Example Close the SPI device if close td 0 Error Management Routine else File Closed 4 3 7 A Test Program Below it is reported a simple piece of code that opens the device writes some random data reads some data if available and then closes the devices Please note that the following code works for half duplex communication For typical full duplex communication the SPI IOC MESSAGE ioctl will be used In order to receive data when executing the read function a transmitting SPI peripheral must be connected include lt stdint h gt Finclude lt unistd h gt include lt stdio h gt include lt stdlib h gt include lt getopt h gt finclude rontl h tinclude 8v5 108tl h tinoclude linux types h include linux spi spidev h Reproduction forbidde EF d n n without Telit Communications S p A written authorization All Rig
55. ure manage and use GE863 PRO hardware resources and system peripherals 1 2 Audience This User Guide is intended for software developers who develop applications on the ARM processor of GE863 PRO module 1 3 Contact Information Support Our aim is to make this guide as helpful as possible Keep us informed of your comments and suggestions for improvements For general contact technical support report documentation errors and to order manuals contact Telits Technical Support Center at TS EMEA telit com or http www telit com en products technical support center contact php Telit appreciates feedback from the users of our information 1 4 Open Source Licenses Linux system is made up of many Open Source device drivers licensed as follows GNU GENERAL PUBLIC LICENSE Version 2 June 1991 Copyright C 1989 1991 Free Software Foundation Inc 675 Mass Ave Cambridge MA 02139 USA Everyone is permitted to copy and distribute verbatim copies of this license document but changing it is not allowed LH ER le ri Reproduction forbidde n without Telit Communications S p A written authorization All Rights Reserved page 6 of 59 e e Telit 1vv0300781 Rev 0 04 06 08 Please refer to the following web page for the full text of the license http www gnu org licenses gpl 2 0 html 1 5 Product Overview The GE863 PRO module contains a fully featured GSM GPRS communications section compatible with the
56. us is classifiable as a char module a block module or a network module A char character device is one that can be accessed as a stream of bytes like a file serial ports e g dev ttyS0 are examples of char devices A char driver usually implements at least the open close read and write system calls allowing this type of communication Like char devices block devices are accessed by filesystem nodes in the dev directory A block device is a device e g a disk that can host a filesystem Block and char devices differ only in the way data is managed internally by the kernel thus block drivers have a completely different interface to the kernel than char drivers A network interface is a device that is able to exchange data with other hosts and is controlled by a network driver Not being a stream oriented device a network interface doesn t have a corresponding entry in the filesystem Some types of drivers work with additional layers of kernel support functions for dedicated device interface for example USB devices are driven by a USB module that works with the USB subsystem but the devices themselves can be char devices USB serial ports block devices USB memory cards or network devices USB Ethernet interfaces 4 1 Serial port As discussed above serial ports are char devices that can be accessed through the following filesystem nodes available on the GE863 PRO ttySO used by the shell ttyS1 available e g used f
57. v module Load the i2c gpio module and or other adapter driver module s Load your IC device driver module s eS However you can find the list of all the available I C loadable modules in the directory lib modules your_kernel_version kernel drivers i2c 4 2 1 Loading i2c modules 1 The module i2c core is used by every other I C modules so it must be loaded first To load this module type the command modprobe i2c core 2 The i2c algo bit module implements a generic algorithm for the communications on the bus If you need a more specific algorithm you can modify the i2c algo bit source file or implement another module that uses i2c algo bit To load the i2c algo bit module type the command modprobe i2c algo bit Reproduchon forbidden without Telit Communications S p A written authorization All Rights Reserved page 30 of 59 felit 1vv0300781 Rev 0 04 06 08 3 The i2c dev module implements a useful tool that allows the user to access all devices on an adapter from userspace through the dev interface So we ll have one item in the dev directory for each bus adapter in our system Each registered i2c adapter gets a number counting from 0 I C device files are character device files with major device number 89 and a minor device number corresponding to the number assigned as explained above So for example we ll have in dev the following files i2c 0 i2c 1 i2c 10 All 256 minor device numbers are res
58. vv0300781 Rev 0 04 06 08 fcntl h Prototype int open const char pathname int flags Parameters pathname file name with its own path flags an int specifying file opening mode that can be O RDONLY O WRONLY or O_RDWR which request opening the file read only write only or read write respectively Returns The new file descriptor fildes if operation is completed successfully otherwise it is 1 Example Open the dev watchdog ime dob file descriptor for the dev watchdog entry if fd open dev watchdog O WRONLY 0 Error Management Routine else Watchdog Device Opened 4 5 2 ioctl The ioctl function manipulates the underlying device parameters In particular many operating characteristics can be controlled with ioctl requests Header file sys ioctl h linux watchdog h Prototype int ioctl int fildes int request Parameters fildes file descriptor request device dependent request code The following ioctls request codes can be used for watchdog device WDIOC KEEPALIVE to notify the watchdog that userspace is still alive WDIOC SETTIMEOUT to set a timeout WDIOC SETOPTIONS to enable or disable the watchdog WDIOC GETTIMEOUT to query the timeout The third argument is a void and depends on the ioctl request code used see the examples below Returns f A f mi Pe Reproduction forbidden without Telit Communications S p A written au
59. ypographical errors inaccurate information or improvements to programs and or equipment at any time and without notice ouch changes will nevertheless be incorporated into new editions of this document All rights reserved O 2008 Telit Communications S p A li 77 Reproduction forbidde n without Telit Communications S p A written authorization All Rights Reserved page 2 of 59 rd e Telit 1vv0300781 Rev 0 04 06 08 Applicable Products Product Part Number GE863 PRO with Linux OS 3990250698 Linux SW Version 01 0001 i i i P i E uiu d Reproduction forbidden without Telit Communications S p A written authorization All Rights Reserved page 3 of 59 e Telit 1vv0300781 Rev 0 04 06 08 Contents T 0000771817072 E HH 6 1 1 vel 6 1 2 Publ c 6 1 3 Contact Information SupDOFL iicee ei esee sese kee eee bevoER e eV Ya eue EEUU poS UN KEEN PEE VV EY PNE Yee d ENT UNS ESE NE E SET S r NEE MEE a 6 14 OpenSource EiCOHS09 oai ii oem EHE PIE TES E PA OUI vo PE E02 DPI TL VES EE RS ER ONES LIN Ya eEE ERES OOo o PEE eR ME RRUS 6 1 5 PFOGUCE OVEEVICW e 7 EG Document OF GANIZAMON m 7 1 7 MGS Oy CHG ONS asses TOILET m 7 1 8 orici PV OCUIIC

Download Pdf Manuals

image

Related Search

Related Contents

Programmable Gain Amplifier User Manual  Balance compacte 5000g/2g  Manual de instrucciones  downloaded here. - Otto Driving Companion  SOYO SY-6IWM User's Manual  ハイブリゼップ - 扶桑薬品工業株式会社  Notice Micra Notices ancienne gamme  User Manual  User Manual  LinkSprite RFID Reader/Writer Module (ISO14443  

Copyright © All rights reserved.
Failed to retrieve file