1

I accidentally connected UART wires one row lower than it should be (see image): enter image description here then I unplugged them shortly after that and then connected correctly, but serial console doesn't work anymore. USB was not connected at all, so pi was powered over GPIO. I've looked at a several posts where people bricked their zero's totally, but my zero works fine except UART and maybe GPIO at all but I don't know how to check latter.

  1. Can Pi zero 2W be recovered after this kind of UART connection?
  2. How can I diagnose if UART is really dead? Maybe check any pins with a multimeter?
  3. I also think this is result of a static charging. How can I check that and/or discharge PCB?
2
  • Connect Tx to Rx on the serial adapter then use a terminal program and see if it echo's what you type. If it does it is ok, if not you probably fried it. Best to try this with a known good one as I do not know your terminal program or what it needs to communicate.
    – Gil
    Sep 6, 2022 at 1:08

2 Answers 2

4

If a UART GPIO is damaged that is a permanent failure and can not be fixed. In fact the damage can spread to adjacent GPIO causing them to fail and eventually the whole board may be damaged.

To check the GPIO you can use my gpiotest script.

#!/bin/bash

skipped=""
tested=""
failed=""

usage()
{
   cat <<EOF
This program checks the Pi's (user) gpios.

The program reads and writes all the gpios.  Make sure NOTHING
is connected to the gpios during this test.

The program uses the pigpio daemon which must be running.

To start the daemon use the command sudo pigpiod.

Press the ENTER key to continue or ctrl-C to abort...
EOF

   read a
}

restore_mode()
{
   # $1 gpio
   # $2 mode

   case "$2" in
        0) m="r" ;;
        1) m="w" ;;
        2) m="5" ;;
        3) m="4" ;;
        4) m="0" ;;
        5) m="1" ;;
        6) m="2" ;;
        7) m="3" ;;
        *)
           echo "invalid mode $2 for gpio $1"
           exit 1
   esac

   $(pigs m $1 $m)
}

check_gpio()
{
   # $1 gpio
   # $2 i2c

   m=$(pigs mg $1) # save mode
   L=$(pigs r $1)  # save level

   s=$(pigs m $1 w)

   if [[ $s  = "" ]]
   then
      f=0
      tested+="$1 "

      # write mode tests
      $(pigs w $1 0)
      r=$(pigs r $1)
      if [[ $r -ne 0 ]]; then f=1; echo "Write 0 to gpio $1 failed."; fi

      $(pigs w $1 1)
      r=$(pigs r $1)
      if [[ $r -ne 1 ]]; then f=1; echo "Write 1 to gpio $1 failed."; fi

      # read mode tests using pull-ups and pull-downs
      $(pigs m $1 r)

      if [[ $2 -eq 0 ]]
      then
         $(pigs pud $1 d)
         r=$(pigs r $1)
         if [[ $r -ne 0 ]]; then f=1; echo "Pull down on gpio $1 failed."; fi
      fi

      $(pigs pud $1 u)
      r=$(pigs r $1)
      if [[ $r -ne 1 ]]; then f=1; echo "Pull up on gpio $1 failed."; fi

      $(pigs pud $1 o)   # switch pull-ups/downs off
      $(pigs w $1 $L)    # restore original level
      restore_mode $1 $m # restore original mode

      if [[ $f -ne 0 ]]; then failed+="$1 "; fi
   else
      skipped+="$1 "
   fi
}  2>/dev/null

usage

v=$(pigs hwver)

if [[ $v < 0 ]]
then
   echo "The pigpio daemon wasn't found.  Did you sudo pigpiod?"
   exit
fi

echo "Testing..."

for ((i=0;  i<4;  i++)) do check_gpio $i 1; done
for ((i=4;  i<16; i++)) do check_gpio $i 0; done

if [[ $v -ge 16 ]];
then
   check_gpio 16 0
else
   skipped+="16 "
fi

for ((i=17;  i<28; i++)) do check_gpio $i 0; done
for ((i=28; i<30; i++)) do check_gpio $i 1; done
for ((i=30; i<32; i++)) do check_gpio $i 0; done

if [[ $failed = "" ]]; then failed="None"; fi

echo "Skipped non-user gpios: $skipped"
echo "Tested user gpios: $tested"
echo "Failed user gpios: $failed"

See https://elinux.org/R-Pi_Troubleshooting#Testing for details.

1
  • Thank you. Got Failed user gpios: 14 15 which are UART pins, farewell uart ;-(
    – aryndin
    Sep 4, 2022 at 11:24
0

First you should NEVER connect the 5V pin of a serial adapter to the Pi (most sites warn of this).

Second what you have ACTUALLY done is connect -5V to GPIO pins. If you are lucky only these 2 pins are damaged, but in all likelihood the whole SoC (or GPIO bank) is dead.

3
  • At least this site learn.adafruit.com/raspberry-pi-zero-creation/give-it-life suggests to connect 5V to the corresponding pin.
    – aryndin
    Sep 4, 2022 at 13:40
  • It sounds like time to get another one. I would suggest you get more than one, this type of thing happens to the best of us. If you can program it use it in a project where those pins are not needed. Expect it to fail so use it for testing, protype etc.
    – Gil
    Sep 4, 2022 at 18:35
  • @aryndin Actually the link shows 2 possible connections. It MAY be possible to power a Pi Zero this way (it would be marginal) but the PiZero W requires >350mA; the default for a compliant USB port is 150mA (of course many are not compliant).
    – Milliways
    Sep 5, 2022 at 4:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.