JulianR 0 Posted May 6, 2022 Hi there, I am trying to port software from RPI4 to the tinkerboard. We used to access the GPIOs not with WiringPI but manually using "nmap" with a file descriptor ("/dev/mem"). To find the peripheral offset address we were reading this file: "/proc/device-tree/soc/ranges". But I can not find this path or a similar one on the tinkerboard. Can someone help me to get on the right track? Thanks in advance! Julian R. Share this post Link to post Share on other sites
tooz 52 Posted May 12, 2022 hello @JulianR, here's the GPIO config table for your reference: User Guide · TinkerBoard/TinkerBoard Wiki · GitHub Share this post Link to post Share on other sites
JulianR 0 Posted May 12, 2022 Thank you for your response. The paths there do not exist on my board (Tinkerboard2). For example physical pin 3 states: "/sys/class/gpio/gpio73". If I do an ls on that path, none of them listed there: $ sudo ls /sys/class/gpio/ export gpio16 gpio25 gpiochip0 gpiochip128 gpiochip32 gpiochip64 gpiochip96 unexport Share this post Link to post Share on other sites
yi-hsin_hung 3 Posted May 13, 2022 Hi @JulianR: This is the linux common functions. Need to echo the pin number to export and then show the gpio$number in the path. Please reference the following website link and reference sample. Thank a lot! ---> Website link for GPIO Programming: Using the sysfs Interface https://www.ics.com/blog/gpio-programming-using-sysfs-interface ---> Examples GPIO input control example 0, 8 GPIO: /sys/class/gpio/gpio8 TEST_CLKOUT2 GPIO0_B0 7 * Console command: - Export the GPIO pin echo 8 > /sys/class/gpio/export - Set the GPIO pin to input mode echo in > /sys/class/gpio/gpio8/direction - Read input value: cat /sys/class/gpio/gpio8/value GPIO output control example 0, 8 GPIO: /sys/class/gpio/gpio8 TEST_CLKOUT2 GPIO0_B0 7 * Console command: - Export the GPIO pin echo 8 > /sys/class/gpio/export - Set the GPIO pin to output mode echo out > /sys/class/gpio/gpio8/direction - Set value to GPIO pin: echo 1 > /sys/class/gpio/gpio8/value - Read the GPIO value cat /sys/class/gpio/gpio8/value Share this post Link to post Share on other sites