Accessing I2C devices with Digi Embedded Linux 5.2 example on Digi Connect ME 9210

Similar documents
Application Development Kit for Android Installation Guide

Matrix 510/520 User Guide

In-System Programmer USER MANUAL RN-ISP-UM RN-WIFLYCR-UM

Yun Shield User Manual VERSION: 1.0. Yun Shield User Manual 1 / 22.

Designing VM2 Application Boards

- 35mA Standby, mA Speaking pre-defined phrases with up to 1925 total characters.

GSM Click - Cross-Platform Development Quick Start Guide

Intro to Intel Galileo - IoT Apps GERARDO CARMONA

Adding a Real Time Clock to Raspberry Pi

SheevaPlug Development Kit README Rev. 1.2

ipac-5010 User Guide + -

Quick Note 32. Using Digi RealPort with a Digi TransPort Router. UK Support September 2012

BIT COMMANDER. Serial RS232 / RS485 to Ethernet Converter

How to setup a serial Bluetooth adapter Master Guide

E-Blocks Easy Internet Bundle

Embedded Linux BSP BootCAMP

Embedded Display Module EDM6070

Quick Start Guide. Quick Start Guide. taskit GmbH. for Portux920T EU / SW Portux Mini-PC Portux Panel-PC Panel-Card MoLUX Stamp

To perform Ethernet setup and communication verification, first perform RS232 setup and communication verification:

A+ Guide to Managing and Maintaining Your PC, 7e. Chapter 1 Introducing Hardware

SecureLinx Spider Duo Quick Start Guide

IP SERIAL DEVICE SERVER

[HOW TO RECOVER AN INFINITI/EVOLUTION MODEM IDX ] 1

ERIKA Enterprise pre-built Virtual Machine

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Microprocessor Project Laboratory

Version 1.0. File System. Network Settings

Quick Setup Guide High Power Wireless Ethernet Converter WLI-TX4-G54HP

Workshop Intel Galileo Board

How to design and implement firmware for embedded systems

Installing an Omnicast System Omnicast version 3.5

Using the VEX Cortex with ROBOTC

UniPi technical documentation REV 1.1

An Introduction to MPLAB Integrated Development Environment

WA Manager Alarming System Management Software Windows 98, NT, XP, 2000 User Guide

Zynq SATA Storage Extension (Zynq SSE) - NAS. Technical Brief from Missing Link Electronics:

DSO138 oscilloscope program upgrade method

L16. Quectel GNSS Engine. EVB User Guide L16_EVB_UGD_V1.0

Section 5: Connecting the Laser to Your Computer

SNMP-1 Configuration Guide

RCC2 Test Proceedures

SBC6245 Single Board Computer

FRM301 SNMP Upgrade Procedure

RN-WIFLY-EVAL-UM. WiFly Evaluation Kit Roving Networks. All rights reserved. RN-WIFLY-EVAL-UM Version 1.32r 10/9/2012 USER MANUAL

System Area Manager. Remote Management

PBX DIGITAL TELEPHONE EXCHANGE MAINTENANCE GUIDE

RN-131-PICTAIL & RN-171-PICTAIL Web-Server Demo Application

Plena Voice Alarm System Firmware update

LINDY ELECTRONICS LIMITED & LINDY-ELEKTRONIK GMBH - SECOND EDITION

How To Connect A Directsofl To A Powerpoint With An Acd With An Ctel With An Dm-Tel Modem On A Pc Or Ipad Or Ipa (Powerpoint) With A Powerline 2 (Powerline

The embedded Linux quick start guide lab notes

Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs

Manual Serial PCI Cards

5inch HDMI LCD User Manual

Network connectivity controllers

June 2013 v. 0.2

KTA-223 Arduino Compatible Relay Controller

XPort Universal Demo Board User Guide

NB3H5150 I2C Programming Guide. I2C/SMBus Custom Configuration Application Note

1 Mi kołaj Z Mik ar ołaj Z zyc arzy ki cki

Software User Guide UG-461

Honeywell Internet Connection Module

Digitale Signalverarbeitung mit FPGA (DSF) Soft Core Prozessor NIOS II Stand Mai Jens Onno Krah

USER MANUAL GUIMGR Graphical User Interface Manager for FRM301/FRM401 Media Racks

First Steps. Remote Access Gateway IGW/922. with DIL/NetPC ADNP/9200

File Transfers. Contents

Programmable set for Ethernet Modbus/TCP in IP67 TI-BL67-PG-EN-2

Pre-tested System-on-Chip Design. Accelerates PLD Development

Communication with BushingGard using computer USB port

SEC 4100 SYSTEM MONITOR Programmable Serial Interface Card Series 2

User Manual. AS-Interface Programmer

Omron I/O Driver (Series 2) Programmable Serial Interface Card

MediaTek LinkIt Smart 7688 FAQ

PM1122 INT DIGITAL INTERFACE REMOTE

WinCON8000-R2/R8. Hardware User s Manual

Connecting the DG-102S VoIP Gateway to your network

WHQL Certification Approval...2 User Interface...3 SUNIX s COMLab..4

Programming Flash Microcontrollers through the Controller Area Network (CAN) Interface

Update Firmware from GUI

Table of Contents. Safety Warnings..3. Introduction.. 4. Host-side Remote Desktop Connection.. 5. Setting Date and Time... 7

FLYPORT Wi-Fi G

Creating a Webserver on the Nios development kit Stratix Edition board Enoch Hwang

Updating MNS-6K software on Magnum 6K Switches

ic-mq EVAL MQ1D EVALUATION BOARD DESCRIPTION

T3 Mux M13 Multiplexer

Digi Connect Wan 3G Application Guide Update the firmware, backup and restore the configuration of a Digi Connect Wan 3G using a USB flash drive.

File Transfers. Contents

PiFace Control & Display

RPLIDAR. Low Cost 360 degree 2D Laser Scanner (LIDAR) System Development Kit User Manual Rev.1

TEGRA LINUX DRIVER PACKAGE R21.1

UPiS - Uninterruptible Power intelligent Supply

The following is a summary of the key features of the ARM Injector:

Digital Photo Bank / Portable HDD Pan Ocean E350 User Manual

10 STEPS TO YOUR FIRST QNX PROGRAM. QUICKSTART GUIDE Second Edition

USB 2.0 Flash Drive User Manual

Tutorial for MPLAB Starter Kit for PIC18F

Adafruit's Raspberry Pi Lesson 5. Using a Console Cable

RN-XV-RD2 Evaluation Board

US-122L/US-144 Release Notes

Fiery Clone Tool For Embedded Servers User Guide

Transcription:

Accessing I2C devices with Digi Embedded Linux 5.2 example on Digi Connect ME 9210 Document History Date Version Change Description 17/09/2010 Initial entry/outline 24/02/2011 V1.1 Retested with latest patches 10/03/2011 V1.2 Need to add kernel config and Linux tests, pics of test setup

Table of Contents Document History... 1 Table of Contents... 2 1 Problem Description... 2 2 Requirements... 3 3 Hardware pin considerations... 3 4 Software Setup... 4 4.1 Configure U-Boot to include I2C commands... 4 4.1.1 Create U-Boot project for Digi Connect ME 9210... 4 4.1.2 Configure and build the U-Boot to include I2C support... 6 4.1.3 Program this U-Boot onto the module... 8 4.1.4 Testing I2C bus from U-Boot... 9 4.2 Create a new Digi EL Kernel/Rootfs/U-Boot Project... 11 4.3 Patch support for your I2C device into the mach file... 13 4.4 Configure the kernel for I2C... 14 4.5 Built the kernel/rootfs project... 16 5 Hardware Setup... 17 6 Testing from Linux... 18 1 Problem Description Most Digi embedded ConnectCore modules or Digi Connect ME 9210 modules have integrated on chip I2C bus hardware. Typically these micro processors are used as I2C bus master, to access one or several external (or on module, or on development board) I2C devices. I2C (also referred as two wire interface) is a bus with two signal lines: SCL serial clock line SDA serial data line The master is driving the clock line, which can be stretched by slower slaves. On the data line, the master addresses individual slaves by a 7-Bit (optional 10 bit) address. An additional bit is used to decide for read or write access to the connected I2C device. Talking about an 8- or 11 Bit address, it means device ID including read/write information. Specific I2C devices have pre-defined device ID = bus address. Equal devices can be hardware strapped to have a different ID. The Linux kernel provides basic I2C bus driver and the interface to integrate hardware specific drivers for the local master. In order to communicate with remote I2C devices Copyright 2011 Digi International Page 2/18

you need to register chip specific drivers for those devices. E.g. you register an EEPROM chip driver with device ID = 17 or an external RTC with ID=0x68. 2 Requirements To try the example in this document you need: Digi Connect ME 9210 mounted on Digi development board. Digi Embedded Linux (DEL) 5.2 or above development environment. You can get everything together in a Digi Linux JumpStart Kit You also need a I2C sample device, e.g. Dallas DS1307 I2C RTC (Alternatively use a Digi development board for 9P9360 or 9M2443, both have Dallas DS1307 RTC on board). 3 Hardware pin considerations Digi Connect ME 9210 module pin out: Copyright 2011 Digi International Page 3/18

We will use the standard UART for U-Boot and Linux console on serial Port P1, and use I2C from the signal rail P3: Pin 15 3,3V <- connect to your I2C device 3,3V input pin -> Pin 16 GND <- connect to your I2C device GND pin -> Pin 17 I2C SDA (GPIO[12]) <- connect to your I2C device SDA pin -> Pin 18 I2C SCL (GPIO[9]) <- connect to your I2C device SCL pin -> This should work with the I/O selection switch SW3 to either GPIO or RS232. 4 Software Setup For your convenience find all files and images compiled into the archive these instructions came with, you might want to skip this section. Find Archive Here. Install Digi Embedded Linux (DEL) 5.2 or higher, apply latest patches with the Package Manager. 4.1 Configure U-Boot to include I2C commands If you just want to access your I2C from Linux, you can skip this section. For testing your initial hardware connection to the I2C device and to check its ID or to modify the content of an I2C EEPROM having I2C features enabled in U-Boot might be useful. 4.1.1 Create U-Boot project for Digi Connect ME 9210 Open the Digi ESP, make sure you have the latest patches installed with the Package Manager. Create a new U-Boot project: File - > New -> Digi EL- Kernel/Roots/U-Boot Project. Copyright 2011 Digi International Page 4/18

Select appropriate project name and Digi Connect ME 9210 as platform with U-Boot as Project component: Click Next and select TFTP Configuration to /tftpboot, finally click Finish to create the project: Copyright 2011 Digi International Page 5/18

4.1.2 Configure and build the U-Boot to include I2C support Select configure on the U-Boot project (e.g. right click -> configure): Copyright 2011 Digi International Page 6/18

In Commands, select Data bus -> I2C to enable CONFIG_CMD_I2C: Save and Quit the configuration and build the U-Boot: After the build finished: Copyright 2011 Digi International Page 7/18

Install the binary into the /tftpboot directory: 4.1.3 Program this U-Boot onto the module Connect the Digi Connect ME 9210 via Ethernet and serial line to your development PC, make sure IP settings do match and serial 38400 8N1. Do a serial Terminal connection to the module: Copyright 2011 Digi International Page 8/18

And update the U-Boot in flash with your custom U-Boot image, and reboot the firmware: 4.1.4 Testing I2C bus from U-Boot Now you can use the iprobe command to check for device or the imm/imd commands to modify connected I2C memory devices. Use the help command or the U- Boot command line reference to get more information about those commands. Copyright 2011 Digi International Page 9/18

If you are getting no chip addresses reported at all, you have not connected SDA/SCL correctly: If you are getting timeouts, you have not connected GND/3.3V or the I2C pull up resistors need to be tuned: The output of iprobe can help you to determine under which device IDs you need to register the chip device drivers in Linux in the next section. Copyright 2011 Digi International Page 10/18

4.2 Create a new Digi EL Kernel/Rootfs/U-Boot Project Copyright 2011 Digi International Page 11/18

Select Kernel and Root File System as project components: Select appropriate NFSROOT/TFTP Configuration Copyright 2011 Digi International Page 12/18

4.3 Patch support for your I2C device into the mach file In the machine file $WORKSPACE/$YOURPROJECT/build/kernel/arch/arm/machns9xxx/mach-cms9210js.c you need to register your device with your device ID, e.g. for Dallas RTC: /* I2C devices */ static struct i2c_board_info i2c_devices[] initdata = { { + #if defined(config_rtc_drv_ds1307) defined(config_rtc_drv_ds1307_module) + I2C_BOARD_INFO("ds1337", 0x68), + #else + #endif }; }, I2C_BOARD_INFO("device_name", address), /* I2C devices */ - /* <= uncomment this i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices)); - */ <= uncomment this Copyright 2011 Digi International Page 13/18

For the RTC example you can also use the patch attached with: cd /usr/local/digiel-5.2/kernel/linux/arch/arm/mach-ns9xxx patch -p0 <mach-cme9210js.patch 4.4 Configure the kernel for I2C Open the Kernel config. In the Device drivers section, select I2C support and Digi ns9360, ns921x support: Enable support for your I2C device, e.g. to enable support for Maxim DS1337 I2C RTC, either search the kernel config (Edit->Find) or select and enable Real Time Clock and Dallas/Maxim DS1307/37 support, this will create /dev/rtc: Copyright 2011 Digi International Page 14/18

Configure rootfs with Application template -> rtc_test: Copyright 2011 Digi International Page 15/18

So rtc_test will work, as well as hwclock. However if clock is not detected, system might not boot sometimes, if the driver is statically linked in. 4.5 Built the kernel/rootfs project Build the project from the project explorer (right mouse button): Copyright 2011 Digi International Page 16/18

Install the project from the project explorer: 5 Hardware Setup Turn off the development board. Connect the power cable. Plug the Connect ME 9210 or ConnectCore module to the development board. Connect Ethernet between development board and your development PC or switch (for updating firmware). Connect a serial null modem cable (pins 2 and 3 crossed) to your host computer (e.g. COMA is the CONSOLE). Plug the cable into Serial Port 1 (P1) of the Digi development board. Connect your external I2C device with SDC/SLA/GND/3.3V as indicated in section 3. Power on the Connect ME 9210 dev board Copyright 2011 Digi International Page 17/18

6 Testing from Linux Run the new built kernel and rootfs on module (e.g. update the images into flash built in section 4.5 update linux tftp; update rootfs tftp;dboot linux flash, or boot with NFSroot: dboot linux tftp ). During boot up you should notice message from your selected I2C device driver, e.g.: rtc-ds1307 0-0068: rtc core: registered ds1337 as rtc0 And from the I2C bus driver: i2c-ns9xxx i2c-ns9xxx: NS9XXX I2C adapter Run the I2C device test applications specific to your device, or access the device file directly, e.g. for the Dallas RTC: # hwclock # rtc_test # rtc_test --help Copyright 2011 Digi International Page 18/18