Jump to content

Recommended Posts

Posted

Hello, I use the NanoPi Neo (4.19.38-sunxi,  Armbian #5.85 ) to pool an external device over /dev/ttyS1 serial port.  At flashing moment of the external device, I should switch pins of ttyS1 to input mode by using bash commands

#!/bin/bash
firmware=`ls update_*.hex`

echo "198" > /sys/class/gpio/export
echo "199" > /sys/class/gpio/export
echo "in" > /sys/class/gpio/gpio198/direction
echo "in" > /sys/class/gpio/gpio199/direction

# device update
flash -P linuxgpio -b 40000 $firmware

echo "198" > /sys/class/gpio/unexport
echo "199" > /sys/class/gpio/unexport

Is it possible to change up the mode of pins to the alternate function (ALT5) without the rebooting the OS?

Posted

While I'd like to give a foxing clever response...

 

I'm not seeing a way to do what you're asking - it's late in the day for me, so I'm sure someone will find a solution perhaps..

 

GPIO's are assigned by uboot/device tree/DT overlay on boot

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines