This is a cache of https://www.96boards.org/blog/path-libmraa-96boards-part-1/. It is a snapshot of the page at 2024-12-22T03:36:59.512+0000.
Our path to libmraa on 96Boards - Part 1 - 96Boards

Our path to libmraa on 96Boards - Part 1

Manivannan Sadhasivam
|

Introduction

It’s been about 2 weeks since I came to know about the existence of this cool library ‘libmraa’ This library was an initiative from Intel for their work towards building IoT ecosystem and later as like many open source projects it also utilized community efforts.  As of now, three of our CE boards are supported in this library (Dragonboard410c, Hikey620 and Bubblegum).

What’s so special about this?

Well, the first thing I like about this library is its ability to support many peripherals like gpio, i2c, spi, uart, pwm, iio, firmata and aio. In Order to develop any IoT project, you’d need to interface sensors/actuators and this library will take care of all low level framework, and in turn it provides easy to use api’s.

One more important thing to note is the programming interface. Although Linux kernel is completely written in C, for a vast majority of applications, developers prefer to use other crafty languages like C++, Python, Java etc… Similarly, libmraa also supports bindings(interfaces) in all languages mentioned above. This makes the library readily available to one who wants to quickly develop some projects.

Library breakdown

Now it’s time to look into the source of libmraa to get hold of its architecture. Well, this blog is not about explaining libmraa but indeed mentioning some important blocks of it. Major directories to watch out are:

  1. api - contains headers for all peripherals/boards supported

  2. examples - contains examples in different languages

  3. include - contains architecture and board specific files

  4. src - contains source code for all peripherals/boards supported

Since this is a Linux library, the underlying code which interfaces to kernel must be written in C. So, the authors decided to write the low level code in C and provided bindings in different languages.

How to start?

Before you start building projects with the help of libmraa, the library needs to be installed in the target system. Libmraa provides the library as package, so you can just install it like other packages and start using it. But there are people who want to customize the library and install it on their system like me :P

For these people, libmraa provides set of instructions on how to build and install the library in target. Link to instructions can be found below:

  1. Install as package

  2. Build and install

Current support for 96Boards

It’s worth mentioning the limitations in the library for 96Boards. Not all the peripherals supported by libmraa are enabled in 96Boards. As of now only gpio, i2c and spi support is enabled.

We are currently pushing more support for our 96Boards and their peripherals. 96Boards specific files can be found in below links:

  1. Boards header

  2. Boards source

libupm

libupm is another library created by Intel for providing high level api’s for commonly used sensors and actuators. This library makes use of libmraa for interacting with the hardware so you can’t use this library standalone. The combination of libmraa and libupm will allow developers to start programming on Linux boards seamlessly.

What is missing?

  • 96Boards support

    • This one is going to be the top priority for us. We are working on adding support for more boards in libmraa and also enabling the peripherals.
  • Chardev access

    • We planned to integrate new chardev gpio access introduced in Kernel 4.8 to libmraa.  This will replace the legacy sysfs interface for gpios in newer kernels. Also, this new way of accessing gpios seems to be faster and efficient.

Conclusion

So, that’s it about libmraa and libupm from 96Boards perspective. If you think that I missed something about the library or if you have any idea for 96Boards support to this, do let us know in comments :)


Resources

For 96Boards announcements and fun, be sure to visit and follow all of our social media channels!

Twitter |Linkedin |Facebook |YouTube

For those of you who prefer a mailing list, we have just the one for you! You can choose between our “Monthly Newsletter” and our “Weekly Digest”. Get ready for just the right amount of commitment and information, 2017 is calling and 96Boards is here to answer.

Every week at 4:00pm UTC the 96Boards team engages in the ultimate community driven experience - OpenHours. All are welcome to join LIVE, for free, to interact as equal members in the 96Boards tribe of enthusiasts and developers. This is your channel/means to bring up interesting/controversial topics, explore new possibilities around the 96Boards brand, and pretty much anything else you would like to talk about! You can also just simply join to hang out and have a quick chat while you enjoy your morning coffee/tea :D

OpenHours Image
comments powered by Disqus