/sys/class/gpio gone away in linux kernel 6.6
Open source flash program for STM32 using the ST serial bootloader
Brought to you by:
tormod
A command of this form worked perfectly on Raspberry Pi OS with kernel 6.1.x:
stm32flash -b 9600 -i '21&20,-20,,:-21,20,-20' /dev/ttyAMA4 -w L051.hex
Now on kernel 6.6.x (default for Raspberry Pi OS), it generates an error something like:
error writing in file "/sys/class/gpio/export"
It seems that GPIO sysfs is going away, and thus the -i
option will become unusable. Users may have to resort to using the pinctrl
command to put the chips in Boot mode.
Anonymous
We have a merge request for using libgpiod in https://sourceforge.net/p/stm32flash/code/merge-requests/13/
GPIO sysfs is still available in current kernels, even though it is deprecated. The default RPi kernel may have disabled it but that does not mean it has gone away.
FWIW, I have added RPi-specific information about this to the Hints section in the wiki, with a contributed pinctrl example.