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
- 287 All Categories
- 104 Announcements & News
- 47 Product News - New Product/Product Change Notice/ End-of-life
- 179 Welcome Developers!
- 49 Unboxing & Project Sharing
- 18 Tech Updates
- 377 UP Products
- 6 UP Xtreme i11
- 13 UP Squared 6000
- 38 UP Squared Pro
- 126 UP Xtreme
- 796 UP Squared
- 1.4K UP Board
- 86 UP Core Plus
- 217 UP Core
- 3 UP Xtreme Lite
- 40 UP AI Edge
- 213 Starter Kits & Peripheral