beagleboard / arm64-mainline-linux

MIT License
1 stars 0 forks source link

GPIO not working on the BeagleBoneAI64 with firmware versions after April 2023 #7

Open kevinacahalan opened 1 year ago

kevinacahalan commented 1 year ago

https://github.com/beagleboard/Latest-Images/issues/109

GPIO does not work on the BeagleBoneAI64 with firmware versions after April 2023. It neither works from Linux, or from an R5 core

With some no not so thorough testing, I have found that with the images before bbai64-emmc-flasher-debian-11.6-minimal-arm64-2023-04-06-4gb.img.xz , I am still able to control GPIO. With the images after bbai64-emmc-flasher-debian-11.6-minimal-arm64-2023-04-06-4gb.img.xz I can not control GPIO.

I initially hit this bug after I updated my BBAI64 and ran the eMMC firmware update scripts. With later testing I found that a simple apt dist-upgrade would stop GPIO from working.

Take a look at the #beaglebone-ai-64 channel in Discord to see discussion.

ALEX_PARK on the BeagleBone forum found that the problem is a device tree issue. Solution: https://forum.beagleboard.org/t/bb-ai64-gpio-basics/36032/7?u=alex_park

orgua commented 10 months ago

Just for completion I add steps for current debian / ubuntu images with kernel 5.10 ti - as this is still broken.

Check you are running 5.10 ti

uname -r

as there are images with kernel 6.1 or newer.

Now refresh devicetree-files & reboot

arm64/src/arm64/k3-j721e-beagleboneai64-bone-buses.dtsi
git clone https://github.com/beagleboard/BeagleBoard-DeviceTrees.git
cd BeagleBoard*
git checkout v5.10.x-ti-arm64 
# ... (instead of default v5.10.x-ti-unified)
make all_arm64
sudo make install_arm64

sudo reboot

Testing GPIO (here P8_03) should work now

gpioset 1 20=1
gpioset 1 20=0

sudo echo 320 >  /sys/class/gpio/export
sudo echo out > /sys/class/gpio/gpio320/direction
sudo echo 1 > /sys/class/gpio/gpio320/value