OpenEmbedded RPB + libMRAA

96boards

#1

Greetings,

I’ve been looking into the OpenEmbedded version of the BSP provided by QCOM on their IMM branch mainly due to their more stable WIFI integration. However, now I’m faced with trying to get all the components of my project working with the OpenEmbedded build environment by creating my own layer and adding recipes for each component needed by the project.

One very necessary library in particular is libMRAA which we use to control a couple devices connected to our GPIO ports. I’ve been banging my head against the existing bitbake recipes on the Yocto recipe repository and haven’t got very far with my efforts. I have a nagging suspicion that this is due to these versions of the recipes being biased toward the Intel Edison devkit which is a different architecture altogether.

For the record I’ve tried the following recipes in my custom layer here:
https://layers.openembedded.org/layerindex/recipe/33538/
and
https://layers.openembedded.org/layerindex/recipe/66136/

Has anyone else tried to get this working in OE?


#2

Hi Rob,

How far did you get?

I might need it as as well and did a quick test: I made a libmraa recipe based on the actual recipe from Edison (changed to tag v1.8.0 and disabled python and nodejs). Using that setup I can control a gpio (didn’t test anything else like i2c).

mraa_1.8.0.bb

SUMMARY = "Low Level Skeleton Library for Communication on Intel platforms"
SECTION = "libs"
AUTHOR = "Brendan Le Foll, Tom Ingleby"

LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://COPYING;md5=66493d54e65bfc12c7983ff2e884f37f"

SRC_URI = "git://github.com/intel-iot-devkit/mraa.git;protocol=git;tag=v1.8.0"

S = "${WORKDIR}/git"

inherit distutils-base pkgconfig python-dir cmake

FILES_${PN}-doc += "${datadir}/mraa/examples/"

FILES_${PN}-dbg += "${libdir}/node_modules/mraajs/.debug/ \
                    ${PYTHON_SITEPACKAGES_DIR}/.debug/"

#PACKAGECONFIG ??= "python nodejs"
PACKAGECONFIG[python] = "-DBUILDSWIGPYTHON=ON, -DBUILDSWIGPYTHON=OFF, swig-native python"
PACKAGECONFIG[nodejs] = "-DBUILDSWIGNODE=ON, -DBUILDSWIGNODE=OFF, swig-native nodejs"

do_compile_prepend () {
  # when yocto builds in ${D} it does not have access to ../git/.git so git
  # describe --tags fails. In order not to tag our version as dirty we use this
  # trick
  sed -i 's/-dirty//' src/version.c
}

The gpio numbering starts at 23, but the actual nrs are here: https://github.com/intel-iot-devkit/mraa/blob/v1.8.0/src/arm/96boards.c#L47

So to control GPIO_25 you need to set pin 30:

root@dragonboard-410c:~# mraa-gpio list
23      GPIO-A: GPIO 
24      GPIO-B: GPIO 
25      GPIO-C: GPIO 
26      GPIO-D: GPIO 
27      GPIO-E: GPIO 
28      GPIO-F: GPIO 
29      GPIO-G: GPIO 
30      GPIO-H: GPIO 
31      GPIO-I: GPIO 
32      GPIO-J: GPIO 
33      GPIO-K: GPIO 
34      GPIO-L: GPIO 
root@dragonboard-410c:~# mraa-gpio set 30 0
root@dragonboard-410c:~# mraa-gpio set 30 1

#3

Also the mraa(1.7.0)/upm(1.3.0) recipes from the OE master branch seem to work reasonably well (again didn’t bother with python/nodejs), then you can also have upm.