Snerler
Posts: 9
Joined: Wed Feb 10, 2016 2:20 pm

B+ GPIO16 high on boot

Wed Feb 10, 2016 3:37 pm

I have a B+ with Raspbian Jessie. After I reboot, the pin (GPIO 16, Physical pin 36) is on HIGH and lights a connected LED. I can then turn the LED on and off with a python script.

According to the BCM2835 Peripherals documentation, the power-on state is LOW for that pin.

Is everyone's GPIO16 HIGH on boot also? How can I check what the Raspbian default setting is for that pin?

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5331
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: B+ GPIO16 high on boot

Wed Feb 10, 2016 5:02 pm

You can see the state the firmware configures gpio here: https://github.com/raspberrypi/firmware ... t-blob.dts

16 is not specifically mentioned for B+, so it gets the default:
[email protected] {
polarity = "active_high";
termination = "pull_down";
startup_state = "inactive";
function = "input";
}; // pin

so it should be set as an input. What does:

Code: Select all

gpio readall
show ?

Snerler
Posts: 9
Joined: Wed Feb 10, 2016 2:20 pm

Re: B+ GPIO16 high on boot

Wed Feb 10, 2016 11:42 pm

Code: Select all

 +-----+-----+---------+------+---+--B Plus--+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 |  19 |  24 | GPIO.24 |   IN | 0 | 35 || 36 | 1 | OUT  | GPIO.27 | 27  | 16  |
And its the only pin set to OUTPUT in the list. Why is that? I'm using a new install of Raspbian Jessie. The only thing I've done so far is update and install wiringPi and Python 3.

User avatar
joan
Posts: 14267
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: B+ GPIO16 high on boot

Thu Feb 11, 2016 9:12 am

Do you have any SPI related entries in /boot/config.txt? GPIO 16 is ce2 (third chip select for auxiliary SPI) and would be high by default if the auxilary SPI was enabled.

How recent is your firmware (uname -a)?

Snerler
Posts: 9
Joined: Wed Feb 10, 2016 2:20 pm

Re: B+ GPIO16 high on boot

Fri Feb 12, 2016 4:24 am

Do you mean this section? Everything is commented out.

Code: Select all

# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on
uname -a results in:

Code: Select all

Linux raspberrypi 4.1.17+ #838 Tue Feb 9 12:57:10 GMT 2016 armv6l GNU/Linux
Do I need to update the firmware aside from using the update/upgrade commands?
I found another person with the same issue http://raspberrypi.stackexchange.com/qu ... on-at-boot.

I'm going to try and see if the same thing will happen with a completely new raspbian image.

rzusman
Posts: 346
Joined: Fri Jan 01, 2016 10:27 pm

Re: B+ GPIO16 high on boot

Fri Feb 12, 2016 5:21 am

Not to Hijack this thread, but is there a similar firmware configuration available for the Compute Module?
dom wrote:You can see the state the firmware configures gpio here: https://github.com/raspberrypi/firmware ... t-blob.dts

16 is not specifically mentioned for B+, so it gets the default:
[email protected] {
polarity = "active_high";
termination = "pull_down";
startup_state = "inactive";
function = "input";
}; // pin

so it should be set as an input. What does:

Code: Select all

gpio readall
show ?

User avatar
rpdom
Posts: 15209
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: B+ GPIO16 high on boot

Fri Feb 12, 2016 5:45 am

The CM pins are defined at the end of that file. Look for the section

Code: Select all

      pins_cm {
Again, 16 is not explicitly mentioned, so will get the defaults, which are the same as mentioned above.

Snerler
Posts: 9
Joined: Wed Feb 10, 2016 2:20 pm

Re: B+ GPIO16 high on boot

Fri Feb 12, 2016 2:40 pm

My boot.txt file does not have that entry.

Code: Select all

# For more options and information see
# http://www.raspberrypi.org/documentation/configuration/config-txt.md
# 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=i2s=on
#dtparam=spi=on

# Uncomment this to enable the lirc-rpi module
#dtoverlay=lirc-rpi

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on
core_freq=250
sdram_freq=400
over_voltage=0
gpu_mem=0

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5331
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: B+ GPIO16 high on boot

Fri Feb 12, 2016 2:55 pm

Snerler wrote:My boot.txt file does not have that entry.
report output of:

Code: Select all

vcgencmd version
cat /proc/cpuinfo
vcgencmd get_config int
vcgencmd get_config str

Snerler
Posts: 9
Joined: Wed Feb 10, 2016 2:20 pm

Re: B+ GPIO16 high on boot

Fri Feb 12, 2016 3:48 pm

These are the results:

Code: Select all

vcgencmd version
Feb 1 2016 17:51:17
Copyright (c) 2012 Broadcom
version b3dc56931507f355d503ea69397778643f7a3dc3 (clean) (release)

Code: Select all

 cat /proc/cpuinfo
processor : 0
model name : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS : 2.00
Features : half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xb76
CPU revision : 7

Hardware : BCM2708
Revision : 0010
Serial : 0000000035e4f5d2
vcgencmd get_config int
arm_freq=800
audio_pwm_mode=1
audio_sdm_mod_order=2
config_hdmi_boost=5
core_freq=250
disable_auto_turbo=1
disable_commandline_tags=2
emmc_pll_core=1
force_eeprom_read=1
force_pwm_open=1
framebuffer_ignore_alpha=1
framebuffer_swap=1
hdmi_force_cec_address=65535
init_uart_clock=0x2dc6c0
lcd_framerate=60
overscan_bottom=32
overscan_left=32
overscan_right=32
overscan_top=32
pause_burst_frames=1
program_serial_random=1
sdram_freq=400
temp_limit=85
vcgencmd get_config str
device_tree=-

Granpino
Posts: 7
Joined: Thu Jun 04, 2015 8:26 am

Re: B+ GPIO16 high on boot

Wed May 25, 2016 9:10 pm

I have exactly the same issue with an led connected to gpio16. I have the latest Jessie updates and rpi-upgrade. If I do a shutdown the led flashes a few times and turns off. Anybody has a fix?

Ok. I just installed wheezy and the problem disappeared. This is related to Jessie.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5331
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: B+ GPIO16 high on boot

Fri May 27, 2016 3:40 pm

Can anyone with this problem (either on a Pi1 A+ or B+) test this bootcode.bin:
https://dl.dropboxusercontent.com/u/366 ... otcode.bin

I think that is where the gpio is being incorrectly set.

Granpino
Posts: 7
Joined: Thu Jun 04, 2015 8:26 am

Re: B+ GPIO16 high on boot

Sat May 28, 2016 2:19 am

Tried it on B+ and now gpio16 boots low .

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5331
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: B+ GPIO16 high on boot

Tue May 31, 2016 11:53 am

The bootcode.bin fix is now in latest rpi-update.

Return to “Troubleshooting”