Hello, I have a couple of questions about the UART interface and GPIO usage for the i.Pi SMARC RB5 board with Ubuntu 20.
1) In the board wiki page (url: https://www.ipi.wiki/pages/rb5-docs?page=UserInterfaces.html) I found the expansion header pinout with the GPIO enumeration. However, there is no reference or example to how do I control those GPIOs. To use them should I export them with /sys/class/gpio/export? What are the names within ubuntu of the GPIOs? If you could provide me an example to set and reset a GPIO it would be great.
2) In the same expansion header, there are the pins UART TXD and UART RXD for an UART interface. What device file should I use to interact with this interface in Ubuntu 20?
Thank you
Thank you for the reply.
What is the difference between E_GPIO and S_GPIO and is it possible to change the logic level of the GPIOs? For example pin40 seems to be 3.3V while pin7 seems to be 1.8V by default.
Also, I need to use GPIOs from an application, however i don't want to run the application as root. How can i export/unexport GPIOs and write into direction and value files without being root?
Also, the two free serials SER1 (/dev/HS1) and SER2 (/dev/HS2) seems to be RS232 serials. Is there a TTL UART serial that I can use? For example pin 8/10 of the expansion header 1 of the board?
@Riccardo Damiani,
S_GPIO -> GPIO from the SoC Lines.
E_GPIO -> GPIO from the SX150Q(i2c GPIO expander).
(CN1001)Header - 1 has UART(TTL) Pins [6(GND), 8(TX), 10(RX)]
To manage the GPIOs from a user-level application without running as root, you may try to adjust permissions on the GPIO interface file.
Use udev
rules to adjust permissions for GPIO files.
$ sudo nano /etc/udev/rules.d/99-gpio.rules
Add the following line to the file. Save the file and exit.
SUBSYSTEM=="gpio", KERNEL=="gpio*", GROUP="gpio", MODE="0660"
Create a gpio
group and add your user to it:
$ sudo groupadd gpio
$ sudo usermod -aG gpio your_username
Reload udev
rules:
$ sudo udevadm control --reload-rules
Reboot the device to check it.
To change the logic level of the GPIO is not supported by Qualcomm.