Embedded Linux Device Interfacing Workshop, Report

The "Embedded Linux Device Interfacing Workshop", was organized on July 1 and 2, in Chennai, and on July 15, in Banglore. The workshop was done using our in-house hardware: ZKit-ARM-VF50 and DietIO. The ZKit-ARM-VF50 is the baseboard, powered by a Vybrid VF5xx SoC. The DietIO is the add-on board, that has variety of devices for teachning and learning embedded systems and device drivers.

The Training Team

The training team consisted of Babu, Deepak, Joses Paul, Raashid, Vijay Kumar (in alphabetical order).

Workshop in Chennai

About 33 people from various organizations, including Trane, e-con Systems, NIELIT (Calicut), Visteon, VVDN Technologies, attended the workshop.

Day 1, Forenoon: Introduction to Python

The target audience for this workshop, was primarily application developers, who would like to get their feet wet in the world of embedded Linux. So we decided to use Python instead of C, for the example code. But to accomodate people who were not familiar with Python, we had a few sessions introducing Python.

Day 1, Afternoon: Introduction to Devices & Drivers

Now that people were comfortable with Python, we next moved on to, what Embedded Linux is all about. Deepak gave an introduction to Linux in embedded systems, and how to use an Embedded Linux system. Everyone tried connecting to the target, through the USB serial interface.

We then discussed about how the CPU talks to devices using Memory Mapped IO and Controller Based IO. This was followed by an introduction to driver in Linux, where we showed the power of the file abstraction in Linux. Vijay showed examples, with the mouse device, audio device, hard disk device, and CD-ROM device.

Day 2, Forenoon: Serial, I2C and SysFS

After laying a strong foundation on devices and driver, it was time to get started with accessing devices. The serial interface was presented first. Babu demonstrated the use of serial interface for communicating with a GSM modem. The DietIO board has a UART based LCD, that people tried accessing from the host. The I2C interface was presented next. Babu demonstrated how an I2C accelerometer can be accessed from the host. The add-on board has a I2C 4-way joystick, that people tried accessing by writing a simple Python script.

Now, not all devices are accessed through /dev interface, some devices are exposed throug /sys on Linux, especially GPIO, PWM and ADC. So Rashid, did a session on the sysfs filesystem, and showed how it differs from /dev and /proc. Rashid demostrated the utility of sysfs, with 3 examples: laptop backlight control, a custom ifconfig clone, and a partition table printing tool.

Deepak introduced GPIOs and their sysfs interface. The add-on board has an RGB LED that can be controlled through GPIOs, that people tried controlling using a Python script. Then GPIOs were used to read status of GPIO connected buttons.

Day 2, Afternoon: PWM and ADC

After lunch, Deepak introduced PWMs and their sysfs interface. The add-on board has a buzzer that can be controlled through PWMs. People tried playing various tones on the buzzer, by controlling the frequency of the PWM signal. People then tried controlling the speed of the motor, by varing the duty cycle of the PWM signal. We connected motors, ripped from old CD-ROM drives, for the purpose of this exercise.

The next interface was ADC. Babu introduced the ADC and its sysfs interface. The add-on board has a Potentiometer and Light Sensor. People were able to read the state of the potentiometer and the intensity of the light using the sysfs interface.

/static/images/em-linux-chennai-1.jpeg /static/images/em-linux-chennai-2.jpeg

Workshop in Bangalore

The workshop in Bangalore, was organized as part of Bangpypers workshop series. Bangpypers is the Banglore Python User Group, and has a very active Python community. Since the audience here are Python users, we conveniently skipped off, the initial Python introduction and made it a 1 day workshop.

We started off with an introduction to device and drivers, and then moved on to serial, I2C, SysFS, GPIO, PWM and ADC. The participants were enthusiastic and kept the trainers engaged through-out the day! A big thanks to Bangpypers for the wonderful audience.

A comprehesive report on the workshop by the Bangpypers team is available at http://bangalore.python.org.in/blog/2017/07/15/jul-workshop/

/static/images/em-linux-banglore-1.jpeg /static/images/em-linux-banglore-2.jpeg

Picture Courtesy: Bangpypers

Reactions

The workshop provided a great start for many participants. But some of the participants, were expecting a driver development workshop, which we promised, will be done in upcoming months.

Thanks

We would like to thank all the participants and participating organizations, for all the enthusiasm. Stay tuned, for more exciting workshops, you can sign-up on our enquiry page, to get notifications about upcoming workshops.