Archive

Posts Tagged ‘programming’

Top 10 Programming Languages in 2016 for Embedded Software Development

July 27th, 2016 6 comments

IEEE Spectrum has published a list of the top programming languages in 2016 for Web, Mobile, Enterprise, and Embedded sectors with rankings created by weighting and combining 12 metrics from 10 sources. So I thought it would be fun to have a look at the top 10 of languages used for embedded software, and the results are:

Top_10_Embedded_Programming_Languages_2016As expected, C and C++ are at the top, but I’m quite surprised that “Arduino” is now considered a programming language, as it is simply based on C/C++.  When I worked as an embedded software engineer a few years ago, I personally used C, and Assembly, and to a lesser extend C++ and VHDL. I only recently started to play with Arduino code, and while I’ve heard of most other languages in the list, it’s the first time I’ve ever seen Ladder Logic, probably because it’s designed to program PLCs in industrial control applications.

The methodology used is interesting, as the company did not survey actual engineers or developers, but instead used data from technical, social and job search websites, such as Github, Twitter, or CareerBuilder, to generate the rankings.

Google Summer of Code 2015 is Now Open for Student Applications

March 19th, 2015 2 comments

Google has now announced that students applications for Google Summer of Code (GSoC) are now open. Students can get paid up to $5,500 to work on various open source projects selected for the event.

GSoC_2015Fewer companies have been accepted this year, and even big names like the Linux Foundation and Mozilla got their application rejected. There are still over 137 open source projects to work on including:

  • MinnowBoard  project – Potential software projects for the Intel Atom embedded board include making low speed I/O buses more accessible via intermediate open source libraries (e.g. SMBus/PMBus/Wiring libraries), and improving the open source firmware.
  • lowRISC SoC project – Potential projects: Schematic Viewer for Netlists (SVG/JavaScript), open source FPGA compilation flow using Yosys, accessing the OpenCores ecosystem, etc…
  • BeagleBoard.org – Lots of project ideas relying on the BeagleBone Black board, dealing with Linux kernel support for embedded devices and interfaces, ARM processor support in open source operating systems and libraries, Heterogeneous co-processor (PRU) support in open source operating systems and libraries, and more.

Interested students can browse the projects, and submit their own proposals based on the “idea pages” or not, before Friday, March 27 at 19:00 UTC on the application page.

Students who are accepted will work on an actual open source software project over the summer, be paired with a mentor, and get paid for their work.  You need to be at least 18 years old, and be enrolled in an accredited academic institution anywhere in the world. You don’t necessarily need to be follow a Computer Science or Electronics Engineering program to apply, as past students Shave also come from disciplines such as Ecology, Medicine and Music. Getting accepted to GSoC and having worked on an open source project for several weeks is certainly something nice to have on your CV. Good luck!

Thanks to Alex (lowRISC) for the tip.

Learn How to Write a Driver for Linux 3.x With The Linux Driver Template

November 14th, 2012 No comments

A Linux Driver Template (LDT) has been published to help new Linux kernel developers writing hardware device drivers.

Constantine Shulyupin posted the Linux Driver Template (LDT) on the Linux mailing list in order to merge it into the mainline Linux kernel. The code can be used as as a starting point for new drivers, and shows how to use several Linux facilities such as  module, platform driver, file operations (read/write, mmap, ioctl, blocking and nonblocking mode, polling), kfifo, completion, interrupt, tasklet, work, kthread, timer, simple misc device,
multiple char devices, Device Model, configfs, UART, hardware loopback, software loopback and  ftracer.

This sample has been added to other device drivers samples in eLinux.org. And if you want to learn further there’s always the Linux driver bible: “Linux Device Drivers, Third Edition” which can be downloaded for free as PDF, although it’s for 2.6.10 kernel and many parts may not be up-to date.

Via: Phoronix

Debian is Worth a Lot (Yet it’s Free) and C/C++ Language Still Rules

February 16th, 2012 No comments

James E. Bromberger (JEB) , a contributor to Perl CPAN and Debian, has estimated the cost of developing Debian Wheezy (7.0) from scratch based on the the number of lines of code (LOC) counted with SLOCCount tool, the Constructive Cost Model (COCOMO) and the average wage of a developer of 72,533 USD (using median estimates from Salary.com and PayScale.com for 2011).

He found 419,776,604 lines of code in 31 programming languages giving an estimated cost of producing Debian Wheezy in February 2012 of 19 billion US dollar (14.4 Billion Euros), making each package source code (out of the 17,141 packages) worth an average of 1,112,547.56 USD to produce.

He also estimated the cost of Linux 3.1.8 Kernel with almost 10 millions lines of source code would be worth 540 million USD at standard complexity, or 1.877 billions USD when rated as ‘complex’.

I don’t know which tool he used for the calculation (maybe his own), but there are two simple COCOMO calculators on the internet in order to estimate the number of man hours required for a particular project based on the LOC and the code complexity:

Bromberger also estimated the cost of several individual projects used in Debian and found that developing Apache 2.2.9 would cost 33.5 million USD and MySQL 64.2 million USD with today’s salary.

Of course, there are some caveats to such cost estimation. First, those costs assume software engineers based in the US. Taking into account outsourcing would significantly reduce those cost estimations. Second, he also tried another source code analysis tool (Ohcount) which found much less lines of code in Debian Wheezy. Finally, you also need to estimate the code complexity in the COCOMO model which may lead to great variation in the final costs.

In the last section of his post, Bromberger also analyzed the 31 programming languages that were used to develop the Debian software (See his chart below). It shows C and C++ still rule the (programming) world with respectively 40% and 20% of code written in those 2 programming languages. Java comes a distant third at 8%.

C/C++ Rules the World !!!

Top 11 Programming Languages of Debian Wheezy

Android Training & Tutorials

December 16th, 2011 No comments

The Android team just announced the launch of Android Training a collection of classes aimed at helping developers to build better Android applications.

Each class explains the steps required to solve a problem, or implement a feature, with code snippets and sample code.

They’ll add more materials over time, but right now developers can already learn (more) about the following Android Graduatetopics:

  • Designing for Multiple Screens
  • Improving Layout Performance
  • Managing Audio Playback
  • Optimizing Battery Life
  • Remembering Users
  • Sharing Content
  • Capturing Photos
  • Maintaining Multiple APKs
  • Developing for Enterprise
  • Monetizing Your App
  • Designing Effective Navigation

There are currently 34 lessons on all those topics, and most include code samples such as the News Reader  (Designing for Multiple Screens).

You can get started immediately by visiting Android Training page.

Qt Quick QML Digital Signage Demo Part 2

December 12th, 2011 4 comments

Following up on Qt Quick QML Digital Signage Demo Part 1, I’ve updated the digital signage demo to support the following:

  • Play 5 videos in a loop
  • Display 5 pictures in a loop where the picture is changed every 5 seconds
  • Use a (twitter) RSS feed for the scrolling text
Digital Signage Programmed with QtQuick/QML

QML Digital Signage Demo Screenshot

I initially planned to use QML to list the media files, but it is apparently not possible without using C/C++ and I may do it later on. So instead, I hard-coded the video and picture playlists in the QML files with the ListModel element. Videos are located in the video directory and pictures in the pic folder.

An index is needed to scroll thru the playlist, but QML does not support global variables, so I created a JavaScript file (globals.js) to store the video and picture index:

// Global variables in JavaScript file
var iVideoIndex = 0
var iPicIndex = 0

Then imported the script at the top of main.qml:

Now the code to play 5 videos in a loop looks like:

I only used Windows Media (wmv), WebM and Mpeg video, as it seems the AVI and MP4 video I used made the emulator crash.

The picture zone uses a 5 files list (pic/pic1.jpg to pic/pic5.jpg) with a 5 second timer:

In the code above, I had to switch parent.visible between false and true or the picture would not be updated.

In the scrolling text zone, I used cnxsoft twitter feed, retrieved it, parsed it and displayed it with QML XmlListModel and ListView:

Here’s what the Qt QML Digital Signage demo looks like when running in Qt Simulator (Nokia N900):

You can also download the source code (main.qml, ScrollingText.qml and global.js). You’ll need to create the video and pic directories in your project and add 5 videos and 5 pictures to test it.
The full QtQuick project is also available on Gitorious.

Qt Quick QML Digital Signage Demo Part 1

December 10th, 2011 No comments

I’ve recently started to play around with Qt and since I’d like to do a digital signage player running on Raspberry Pi, I’ve decided to try to make a simple digital signage demo application to evaluate the development platform.

Raspberry Pi Digital Signage

Screenshot of Digital Signage Demo Written with Qt Creator/QML

In Part 1, my goal was to make a 3 zones layout with a video zone, a picture zone and a scrolling text zone. I would just play one hard-coded media in each zone and the video and scrolling text would have to continuously loop.

I used Qt Creator to create  a “Pigital Signage” application (or should it be Πgital Signage ?).

To create the 3 zones I used the Gridview Element with 3 rectangles:

  • Video zone: 600×432
  • Picture zone: 200×432
  • Text zone: 800×48

Displaying the image is very easy with the Image Element:

The video playback was also supposed to be easy with the Video Element but it can not work on Desktop, so I had to revert to used the Nokia N900 emulator to be able to play a short video (hence the 800×480 resolution of the demo).  It works fine but there is a transparency issue with the emulator (in my PC), so if I want to clearly see the video I have to open a black picture and move the emulator on top. Here’s the video playback code:

The scrolling text should also have been easy since we can use  Webview  Element and html marquee, but I could not solve a problem with left and top margins that always left white border to the text zone.  Finally, I wrote the scrolling text code based on sample code provided by Kunal. I added a new file called ScrollingText.qml to the project:

The code is modified to start scrolling the text from the right until it fully disappears on the left and continuously repeat it.

Here’s the full main.qml with the code for the 3 zones:

In order for QtMultimediaKit to work properly, you also need to modify PigitalSignage.Pro since it is part of QtMobility:

Developing with Qt Creator and QML language seems relatively straightforward as this short demo could be written in one afternoon.

I’m not sure Qt 5 Video Element will be supported for the Raspberry Pi so QML Binding Element may have to be used to call an external video player that support R-Pi GPU.

In Part 2, I plan to list video and pictures file in a directory and play them continuously. For the scrolling text, the plan is to use a (twitter) RSS feed, scroll it and reload it each time the scroll is finished. I may also try to play online video (e.g. YouTube) and parse a config file to configure things like picture display duration, text color and scrolling speed etc…

Nokia Developer Day 2: Qt QML Workshop – Chiang Mai

December 8th, 2011 No comments

I’ve just attended Nokia Developer Day  on 6-7 December 2011 in Chiang Mai.

I’ve already written a summary about the first day dealing with Series 40 Java and Web Apps Workshop.

The second day was focused on Qt/QML (Qt Meta-Language) software development for Nokia’s Symbian phones. Nokia will phase out Symbian operating system in 2016, but they’ll still support it until that time. Nokia will also port  Qt to lower end phones (e.g. Series 40) on a new operating system based on Linux called Meltemi.

Overall Business Direction & Strategy

The first 45-minutes for was presentation given by Grant Aaron McBeath, Managing Director, Nokia Thailand and Emerging Asia, about Nokia business direction: focus on Windows Phone for smartphones, Java/Web Apps for feature phones and future disruption. He also showed the progress of Nokia Ovi Store with 10 million downloads a day and 177 publishers with more than 1 million downloads. The new Nokia Lumia 710 and 800 (WP7) and Nokia Asha 300 & 303 were also showcased.

Some other interesting fact during the presentation:

  • Once operator billing is enabled, you can get 20 times more purchase than with payment requiring a credit card.
  • The best business model for app developers (at least in Thailand) is to provide freemium: try before you buy.

Finally, he talked about expected NFC growth in the next few years and different ways an application can be monetized:

  • directly: paid download, subscriptions, in-app purchases…
  • Indirectly: advertizing, sponsors…

Introduction to Qt Quick (QML) in Qt 4.7

The rest of the day 10:00 till 16:00 was devoted to Qt QML for Symbian workshop animated by Manikantan Krishnamurthy, Technical Manager, Nokia, Southeast Asia & Pacific.

The first thing to do is to download Nokia Qt SDK Windows offline (Qt_SDK_Win_offline_v1_1_3_en.exe)   and follow the installation procedure given at http://www.forum.nokia.com/Develop/Qt/Getting_started/

You can also download the Qt QML Workshop Presentation Slides.

There was first a quick introduction about Qt, Symbian and the Ovi Store. An overview of Qt Creator, Qt SDK and QML was then provided. Mani also quickly explained it was possible to use Remote Device Access to test your application on real phones remotely.

Then the worskhop started and only involved QML programming (similar to javascript in some respects). We basically followed what’s inside the slides above and learnt the following:

  • Create a new Qt project for Symbian and run the hello world application in the Emulator.
  • Create an application to display an image that can be moved to a new location by pressing the mouse button.
  • States, Transition and Timer: Updating the application above by adding code that fades-in / fades-out the image.
  • How to create an animation, list view, grid view etc… with QML
  • Introduction to Qt Quick Components for Symbian.
  • Create an application that converts degree Celsius to Kelvin with a text field, button (with image) and text showing the result. (cnxsoft: This was one of the most interesting part, as the source code was not available and we add to code ourselves and look for relevant API in Qt help, not just type the code in the PDF…).
  • Create a MAP application using QtMobility.location 1.2 API where we were able to display the map, create a map circle, pan the map and zoom in/out with a slider.
  • Create a multimedia application (Jukebox) that play/pauses and stop a MP3 file.

To conclude the workshop, mani explained how we could submit Qt applications to the Ovi Store.

This was followed by the Q&A session without any questions asked…

The day was concluded with a lucky draw for a Nokia C601 (and I was kindly explained it would not be my turn this time…), distribution of a certificate participation and a group picture.

All in all the workshop was quite interesting, but this was quite a rush (especially I was unable to copy /past the code in the PDF slides and had to type everything). But that’s fine as it gives good starting point to start developing your app. I may start playing around more with Qt once I receive my Nokia C601 and/or the Raspberry Pi becomes available.