mraa on up4000

KrissNC
KrissNC New Member Posts: 31

Hello
My mraa won't work.
Apparently according to https://forum.up-community.org/discussion/3028/up-board-using-mraa-unable-to-initalize-gpio#latest , a new new kernel would be needed ? (I have the "up" 5.4 kernel, on my unbuntu 20.04
When I try to list the pins, it says "No pins"
What can I do ?

Answers

  • garyw
    garyw New Member, Moderator, AAEON Posts: 79 admin

    @KrissNC
    if you are using official mraa from Github with our up 5.4 kernel, you have add the UP4000 board name "UP-APL03" into src/x86/x86.c as

    else if (strncasecmp(line, "UP-APL03", strlen("UP-APL03") + 1) == 0) {
    platform_type = MRAA_UP2;
    plat = mraa_up2_board();
    }
    }

  • KrissNC
    KrissNC New Member Posts: 31

    I can see 2 mraa. one from up division (https://github.com/up-division/mraa) and one from eclypse.(https://github.com/eclipse/mraa) which one works on a 5.4 "up" kernel (on a 20.04 ubuntu)
    I'll try the eclypse one since you are talking about "official".

  • KrissNC
    KrissNC New Member Posts: 31

    It didnt work, using the eclypse mraa, it compiled well thow, and installed well.
    (mkdir build, cd build, cmake .., make, make install)

    mraa-gpio list

    No pins

  • Lubo
    Lubo New Member Posts: 32 ✭✭

    @garyw said:
    @KrissNC
    if you are using official mraa from Github with our up 5.4 kernel, you have add the UP4000 board name "UP-APL03" into src/x86/x86.c as

    else if (strncasecmp(line, "UP-APL03", strlen("UP-APL03") + 1) == 0) {
    platform_type = MRAA_UP2;
    plat = mraa_up2_board();
    }
    }

    I used this , enhanced x86.c with this , budt mraa is still not working on my UP4000 .
    I still see only

    mraa-gpio version
    Version v2.2.0 on Unknown platform

    as well as

    mraa-gpio list
    No Pins

    I am confused, is there clear step by step manual how to get mraa running on UP4000/Ubuntu 20.04 from "clear" board with "kernel 5.4.0 from PPA" installed from this instruction :
    https://github.com/up-board/up-community/wiki/Ubuntu_20.04

    Any idea how to get it run ?
    Thanx.

  • Lubo
    Lubo New Member Posts: 32 ✭✭

    I ensured again that there is something not clear with mraa on UP4000/Ubuntu platform...

    • I unpacked new , clean UP4000 from box.
    • I installed there clean Ubuntu20.04.
    • Then I followed instructions on UP wiki and replaced kernel with 5.4.0 ( link is in previous comment ).
    • Restarted board, everything went without issue.
    • Then I clone mraa-master from git and updated src/x86/x86 as @garyw sugested, installed cmake, build-essential and so on... and compiled mraa.
    • Then I install it. Its all.

    still same issue :

    mraa-gpio version
    Version v2.2.0 on Unknown platform

    mraa-gpio list
    No Pins

    Can someone please confirm that mraa is running on UP4000/Ububtu , and give instructions how to get mraa running on "clean unpacked" UP4000 ?

  • garyw
    garyw New Member, Moderator, AAEON Posts: 79 admin

    @Lubo
    we are switching to new pinctrl driver, if you don't need customization kernel (UP kernel 5.4),
    you can refer below comment I provide to other user. it's suitable for UP 4000 too.

    https://forum.up-community.org/discussion/comment/13367#Comment_13367