blachanc wrote:I do not understand why nobody was willing to help the OP enabling a pull up via a shell command.
WiringPi's gpio command
is the best way to control advanced functionality such as pulls, drive strength, and pwm from the shell. To my knowledge there is no alternative that would be easier to install or offer other advantages.
Any good GPIO library also allows you to make a program to set pulls, and of course you can run your own program from the shell. But to write the program
without using an existing library you would need to read the datasheet and other resources, and be confident in C.
The experiment results shows the pull up does not survive reboots:
GPIO38 is an output pin. Pulling it up is not going to help if it is being driven low.
First you need to configure the GPU firmware to drive the pin high. If you are using NOOBS, you must configure the firmware that lives in the NOOBS partition, as well as the firmware in the boot partition of the OS you are using.
Then, setting a pull up
as well may prevent the pin from floating in the brief period during reset and while the firmware is loading.
Incidentally, a year ago in this thread I said that firmware disables most pulls, so they do not survive a reboot in practice. That is no longer true. For pins that belong to the user, pulls really do survive a reboot now.
I still doubt that a pull on GPIO38 will survive, however. That pin belongs to the firmware, and it is specified as no_pulling in the device tree. A pull will survive during reset, and hopefully for long enough for the firmware to read config.txt.