beagleboard / beagleboard/librobotcontrol
Weird input behaviour with PINMUX_GPIO
- Dominant language
- C
- Stars
- 212
- Forks
- 167
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
I use the `rc_pinmux_set()` to set some of the SPI pins to regular GPIO as well as using it for some of the normal GPIO pins as well to set pull-ups. Now the strange thing is that if I chose either `PINMUX_GPIO_PU` or `PINMUX_GPIO_PD` as the mode there is no problem, everything works as expected when I read the inputs. But if I chose `PINMUX_GPIO` then some of the pins are stuck to only reading 0.
I am using *GPIO1_25, GPIO1_17, GPIO3_20, GPIO3_17, SPI1_MOSI, SPI1_MISO, SPI1_SCK, SPI1_SS2* and out of those *SPI1_MOSI, GPIO1_17, GPIO3_17* are not reading anything but 0 unless I activate the internal pull-ups/downs.
**To Reproduce**
Set the before mentioned pins to `PINMUX_GPIO` as well as initialize them as input using `rc_gpio_init()`, if you read them they only return a 0. If you instead enable pull-ups/downs with the pinmux, then they work as expected.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the behavior with rc_pinmux_set() and rc_gpio_init() on the listed SPI and GPIO pins, comparing PINMUX_GPIO with PINMUX_GPIO_PU and PINMUX_GPIO_PD. Trace the pinmux and GPIO input paths to determine why the affected pins read only 0 without pulls; done means the affected inputs read correctly in the plain GPIO mode and the behavior is covered by an appropriate validation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, linux
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100