I recently got a CrowPi kit w/ Pi 3B+ to mess around with and eventually pull the Pi out and use in another project. I did a sudo apt-get update
and sudo apt-get upgrade
today seeing as a good number of packages were out of date, but after rebooting the Pi some GPIO pins are set to output that previously weren't. I would just ignore and work around it, but one of the pins (pin 12/GPIO 18) is wired to the CrowPi's buzzer, so I get a minute long 1kHz tone in my ear while the pi loads the OS and gets to my desktop. Hardware-wise, nothing has changed.
So, the question is: what could have changed during the update/upgrade that would set some of the GPIO pins to output on boot, or how could I find out what is setting them, and how can I disable it?
I have searched around but could not find anyone with this specific issue (or at least none that solved it), and most results I get are for people that want to set their own pin states on boot. While I could potentially use this as a workaround I would prefer to fix the root of problem.
The pins that are enabled on boot are pins 12, 38 and 40, (GPIO 18, 20 and 21). The hardware hasn't changed since before the update and there don't seem to be any hardware issues. The pins can be disabled/set to input individually once it reaches a state that I can run python.
Video [sound warning]: https://youtu.be/KTmo1es62LM
To answer Milliways' questions: As far as I am aware, I am running Elecrow's Raspian image for the CrowPi kit, per their suggestion in the CrowPi User Manual (pg 9). The Pi came with the kit with the OS image pre-installed on the sd card. gpio readall output (immediately after reboot):
+-----+-----+---------+------+---+---Pi 3B+-+---+------+---------+-----+-----+
| BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM |
+-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
| | | 3.3v | | | 1 || 2 | | | 5v | | |
| 2 | 8 | SDA.1 | ALT0 | 1 | 3 || 4 | | | 5v | | |
| 3 | 9 | SCL.1 | ALT0 | 1 | 5 || 6 | | | 0v | | |
| 4 | 7 | GPIO. 7 | IN | 1 | 7 || 8 | 1 | ALT5 | TxD | 15 | 14 |
| | | 0v | | | 9 || 10 | 1 | ALT5 | RxD | 16 | 15 |
| 17 | 0 | GPIO. 0 | OUT | 1 | 11 || 12 | 1 | OUT | GPIO. 1 | 1 | 18 |
| 27 | 2 | GPIO. 2 | IN | 0 | 13 || 14 | | | 0v | | |
| 22 | 3 | GPIO. 3 | IN | 1 | 15 || 16 | 0 | IN | GPIO. 4 | 4 | 23 |
| | | 3.3v | | | 17 || 18 | 0 | IN | GPIO. 5 | 5 | 24 |
| 10 | 12 | MOSI | ALT0 | 1 | 19 || 20 | | | 0v | | |
| 9 | 13 | MISO | ALT0 | 1 | 21 || 22 | 1 | IN | GPIO. 6 | 6 | 25 |
| 11 | 14 | SCLK | ALT0 | 0 | 23 || 24 | 1 | OUT | CE0 | 10 | 8 |
| | | 0v | | | 25 || 26 | 1 | OUT | CE1 | 11 | 7 |
| 0 | 30 | SDA.0 | IN | 1 | 27 || 28 | 1 | IN | SCL.0 | 31 | 1 |
| 5 | 21 | GPIO.21 | IN | 1 | 29 || 30 | | | 0v | | |
| 6 | 22 | GPIO.22 | IN | 1 | 31 || 32 | 0 | IN | GPIO.26 | 26 | 12 |
| 13 | 23 | GPIO.23 | IN | 1 | 33 || 34 | | | 0v | | |
| 19 | 24 | GPIO.24 | ALT4 | 1 | 35 || 36 | 1 | OUT | GPIO.27 | 27 | 16 |
| 26 | 25 | GPIO.25 | IN | 1 | 37 || 38 | 0 | ALT4 | GPIO.28 | 28 | 20 |
| | | 0v | | | 39 || 40 | 0 | ALT4 | GPIO.29 | 29 | 21 |
+-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
| BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM |
+-----+-----+---------+------+---+---Pi 3B+-+---+------+---------+-----+-----+
/boot/config.txt:
# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1
# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1
# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16
# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720
# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1
# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1
# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2
# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4
# uncomment for composite PAL
#sdtv_mode=2
#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800
# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=on
dtparam=spi=on
# Uncomment this to enable the lirc-rpi module
dtoverlay=lirc-rpi,gpio_in_pin=20
# Additional overlays and parameters are documented /boot/overlays/README
# Enable audio (loads snd_bcm2835)
dtparam=audio=on
# Enable UART
enable_uart=1
# SPi Related configuration
dtoverlay=spi1-3cs
dtparam=i2c1=on
dtparam=i2c_arm=on
dtparam=i2c_arm_baudrate=100000
# Lirc Config
dtoverlay=lirc-rpi,gpio_in_pin=20,gpio_out_pin=20
# Touch screen config
hdmi_force_hotplug=1
max_usb_current=1
hdmi_group=2
hdmi_mode=1
hdmi_mode=87
hdmi_cvt 1024 600 60 6 0 0 0
hdmi_drive=1
start_x=1
gpu_mem=128