Can a GPIO Pin (HAT) change from input to output (or reverse) in Linux (Ubuntu)?

I have 2 Up2 boards (one with BIOS UPA1AM21, another with BIOS UPA1AM50), I try to change a GPIO pin from input to output (or reverse), but none of the pins on HAT can do this. These pins are redefined as either input or output only. So can a GPIO Pin (HAT) change from input to output (or reverse) in Linux (Ubuntu)?
For example:
Config HAT pin 29 (linux pin 430) on BIOS setting
(1) I first try ACPI mode
LPSS SPI #1 Support [ACPI Mode]
LPSS SPI #3 Support [ACPI Mode]
GPIO 11 (PIN29) Confi LPSS SPI #3
(2) also, try to disable ACPI mode
LPSS SPI #1 Support [Disabled]
GPIO 11 (PIN29) Confi [Input]
On linux
(init pin as default state: input)
$ echo 430 > /sys/class/gpio/export
(1) pin is an input/high impedance, but (2) pin is an output/high
then I change the pin to output
$ echo out > /sys/class/gpio/gpio430/direction
(1) pin keep as an input, (2) pin is an output, but now pull low
then I change the state of the output
$ echo 1 > /sys/class/gpio/gpio430/value
(1) pin keep as an input, (2) pin is an output, now pull high as expected
The above is a simple example showing that a GPIO stage seems to be redefined at the BIOS setting. Is there something wrong with my board, or it's just that the GPIO can not do it because of the current FPGA config?
Thank you!
Answers
-
Thread closed. Follow conversation here:
https://forum.up-community.org/discussion/4734/up-squared-change-a-gpio-pin-hat-from-input-to-output-or-reversed#latest
Categories
- All Categories
- 105 Announcements & News
- 54 Product News - New Product/Product Change Notice/ End-of-life
- 185 Welcome Developers!
- 55 Unboxing & Project Sharing
- 48 Tech Updates
- 693 UP Products
- 11 UP 7000
- 1 UP Squared i12
- 10 UP Xtreme i12
- 11 UP Squared Pro 7000
- 1 UP Element i12 Edge
- 19 UP Squared V2
- 59 UP 4000
- 24 UP Xtreme i11
- 35 UP Squared 6000
- 60 UP Squared Pro
- 143 UP Xtreme
- 837 UP Squared
- 1.4K UP Board
- 89 UP Core Plus
- 222 UP Core
- 3 UP Xtreme Lite
- 44 UP AI Edge
- 216 Starter Kits & Peripheral