Toggling P0.12 also toggles P0.11 on nRF52832 dev kit

When I toggle pin 12, it toggles pin 11 as well. When I toggle pin 11, nothing happens. I also checked pins 13-18 to see if they were affected by both pin 11 & 12 and they weren't. I have no code but the following running. Is there some configuration I'm missing?

	const struct device *mux_dev = device_get_binding("GPIO_0");
	gpio_pin_configure(mux_dev, 12, GPIO_OUTPUT | GPIO_ACTIVE_HIGH);

	for(;;) {
		gpio_pin_toggle(mux_dev,12);
		k_sleep(K_MSEC(1000));
	}

Here are images of the pins 11 & 12 I'm scoping.

  • Hello,

    It sounds like there may be a short between the pins, or have you already measured for continuity between them? If it is not a short, please try to program the hex file included below and see if you still get the same result. 

    0523.gpio_11_12_toggle_test.hex

    You can program this hex file from the command line with nrfjprog or with the Programmer app in nRF connect for desktop.

    With nrfjprog:

    $ nrfjprog --program gpio_11_12_toggle_test.hex --chiperase --reset

    Expected result with my hex file:

    My test code (Note: fetching of the gpio binding is slightly different here as I used SDK v2.2.0) 

    /*
     * Copyright (c) 2012-2014 Wind River Systems, Inc.
     *
     * SPDX-License-Identifier: Apache-2.0
     */
    
    #include <zephyr/device.h>
    #include <zephyr/drivers/gpio.h>
    #include <zephyr/kernel.h>
    
    const struct device *mux_dev = DEVICE_DT_GET(DT_NODELABEL(gpio0));
    
    void main(void)
    {
    	int err;
    
    	printk("Hello World! %s\n", CONFIG_BOARD);
    
    	err = gpio_pin_configure(mux_dev, 11, GPIO_OUTPUT | GPIO_ACTIVE_HIGH | GPIO_OUTPUT_INIT_HIGH);
    	if (err) {
    		printk("gpio_pin_configure() failed. (%d)\n", err);
    	}
    
    	err = gpio_pin_configure(mux_dev, 12, GPIO_OUTPUT | GPIO_ACTIVE_HIGH | GPIO_OUTPUT_INIT_LOW);
    	if (err) {
    		printk("gpio_pin_configure() failed. (%d)\n", err);
    	}
    
    	for (;;) {
    		err = gpio_pin_toggle(mux_dev,11);
    		if (err) {
    			printk("gpio_pin_toggle() failed. (%d)\n", err);
    		}
    
    		err = gpio_pin_toggle(mux_dev,12);
    		if (err) {
    			printk("gpio_pin_toggle() failed. (%d)\n", err);
    		}
    
    		k_sleep(K_MSEC(1000));
    	}
    }
    

    Best regards,

    Vidar

  • I just checked with a multimeter and it is a short. How can that occur?

  • As far as I can recall, this is the first time I am hearing of a short circuit problem on a development kit, so I am afraid I do not have a good suggestion as to what may have caused it. It could be something like a bad solder joint or damaged PCB trace.

    I suggest you ask for a replacement board if you bought it through one of our distributors. 

Related