4

I understand that in order to use these two pins as general purpose I will need to disable UART. I tried following these instructions but /etc/inittab doesn't exist on raspberry pi 2 as far as I can tell. How do you set up these two pins on the Pi 2 so that you can use them as general purpose?

Thank you

2
  • 2
    I will probably never understand why people follow obsolete 4 year old posts and wonder why they don't work. Run sudo raspi-config and disable in Advanced.
    – Milliways
    Mar 14, 2016 at 5:17
  • Under sudo raspi-config it's Interfacing, Serial, then no to Serial Login and no to Serial Port Hardware Enabled
    – Dave X
    Feb 20, 2021 at 21:48

2 Answers 2

2

You do not need to disable their use as a UART if you want to use them in INPUT mode or OUTPUT mode. Just switch them to that mode.

You only need to disable the system's use of them as a UART if you want to leave them in UART mode, i.e. you want to use them to send/receive serial messages.

2
  • Would serial activity (ex. kernel output) break in GPIO activity, wouldn't it?
    – edo1
    Mar 14, 2016 at 10:28
  • No. When you change the mode to an INPUT or an OUTPUT (or any mode other then ALT0) the serial output in in effect lost. An internal switch redirects serial output to a sink.
    – joan
    Mar 14, 2016 at 11:38
3

Like @Milliways said, you will need to run the command sudo raspi-config then navigate to Advanced and then Serial and select no. Then reboot and you should be set.

1
  • In 2021, it's under sudo raspi-config it's Interfacing, Serial, then no to Serial Login and no to Serial Port Hardware Enabled
    – Dave X
    Feb 20, 2021 at 21:49

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.