Is GPIO programming supported on UP2 Pro?

Carey New Member Posts: 4

I'm working on a prototype device and I need to be able to bitbang data across the GPIO to a connected device (raspberry pi). I need at least 40kbps, and I've already tested the Pi at over 1mpbs using low-level C.

I have an UP2 pro with the V2.2 BIOS. I've set all the GPIO pins to input in the BIOS.

I've followed the given instructions to install 18.04 Desktop LTS, the updated kernel, and the HAT functionality (added to my user)

uname -a gives:

Linux UpUpBallot 5.4.0-1-generic #0~upboard4-Ubuntu SMP Thu Sep 23 01:47:49 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

And I've followed the directions to install MRAA

running hellomraa.c gives:

hello mraa
Version: v2.0.0
Running on Unknown platform

Trying to run the gpio.c example results in an error for whatever pin number I try to test:

Failed to initialize GPIO 23

Which confuses me because I can use the filesystem to control the pin voltages by writing to /sys/class/gpio

echo 23 > export
cd gpio23
echo "out" > direction
echo 1 > value

** confirm with DMM that pin is high **

echo 0 > value

** confirm with DMM that pin is low **

echo "in" > direction
cd ..
echo 23 > unexport

Is there a step I missed somewhere here? I'd really like to use the up2 pro board for this product, but I'm running out of time. Everything else is set and ready to go, so it's frustrating getting hung up on something so seemingly simple.



  • camillus
    camillus Administrator, Moderator, AAEON Posts: 188 admin
    edited January 2022

    Hi @Carey ,

    No you did not miss any step. GPIO programming is supported on UP2 Pro but not using libmraa. We are working to have more of our devices supported. You can see from the list here that UP2 Pro is not supported yet on libmraa. We have UP, UP Squared, UP Xtreme and UP Xtreme i11 currently supported by libmraa.

  • Carey
    Carey New Member Posts: 4

    Thank-you for the quick response. You said GPIO programming is supported. Is there a different library you could point me to? My needs are not mraa-specific, merely bandwidth driven.

  • Carey
    Carey New Member Posts: 4

    For any future visitors that might search for this: it appears the filesystem interface to the GPIO, when manipulated with file handles through a c program, is capable of at least 15,000 bytes per second, when latching 8 bits per "cycle".