mraa: Up Squared Board - unknown platform

Hi,

I am unable to use GPIOs with mraa on an Up Squared Board. I suspect the board is not properly recognized because running this C code

#include "mraa.h"
int main(int argc, char** argv)
{
    const char* board_name = mraa_get_platform_name();
    fprintf(stdout, "hello mraa\n Version: %s\n Running on %s\n", mraa_get_version(), board_name);

    mraa_deinit();
    return MRAA_SUCCESS;
}

yields

hello mraa
 Version: v1.8.0-40-g568c077
 Running on Unknown platform

Any idea ? The output of uname -a on the board is Linux upsquared 4.4.0-ubi4-amd64 #1 SMP Debian 4.4.35-1 (2016-11-29) x86_64 GNU/Linux.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 17 (11 by maintainers)

Most upvoted comments

Hi the user is using the wrong kernel

Linux upsquared 4.4.0-ubi4-amd64 #1 SMP Debian 4.4.35-1 (2016-11-29) x86_64 GNU/Linux.

For the up squared the user should use either ubilinux 4 or ubuntu 16.04.01 with the 4.10 kernel from the ppa

So no changes are necessaries in mraa Best Regards Nicola Lunghi

ps by the way contact @Dan-Emutex about this I’m not on the project anymore 😃

Works like a charm now, both platform recognition and GPIO control. Many thanks to you !

Try this patch:

diff --git a/src/x86/up2.c b/src/x86/up2.c
index 4517362..5460ec5 100644
--- a/src/x86/up2.c
+++ b/src/x86/up2.c
@@ -251,7 +251,7 @@ mraa_up2_board()
     // Configure ADCs
     b->aio_count = 0;
 
-    const char* pinctrl_path = "/sys/bus/platform/drivers/upboard-pinctrl";
+    const char* pinctrl_path = "/sys/bus/platform/drivers/up-pinctrl";
     int have_pinctrl = access(pinctrl_path, F_OK) != -1;
     syslog(LOG_NOTICE, "up2: kernel pinctrl driver %savailable", have_pinctrl ? "" : "un");

We’ll have to work out if this is a long term name and deal with it when the up2 guys respond.

I’m sorry, I messed up and pasted the output of my laptop and not the board, silly me. The actual output is UP-APL01. It corresponds to the MRAA_UP2 then.