Using The Programming Cable When RPi Is On

The Programming Cables (both version 1 and 2) are used to program the Sleepy PI boards as standalone boards, but can also used when the Sleepy Pi is sat atop a Raspberry Pi and that Pi is powered on.

The Programming Cable use the serial TXD and RXD pins (GPIO's 14 and 15 which are physically pins 8 & 10). There's a problem that arises in that both devices use these pins and it can affect the programming. The way to stop the conflict, is to make the RPi pins inputs whilst you are debugging.

Setting the Serial Pins to Inputs #

Open up a Terminal window from the RPI desktop or remotely via an SSH session. We are going to use the "gpio" and to see what the initial state of the GPIO is type:

"gpio readable"

and you should see something like this:

gpio readall

Note: If you are using a RPi 3B+ or 4 then you can get the following type message:

gpio fail

in which case you need to update WiringPi (this forum post also sheds light on it).

From the "gpio readall" you can see that TXD and RXD are listed as Mode "ALT5" and we want them as inputs. Now we need to use wiringpi's "gpio" functionality to change these to inputs and slightly confusingly, they are pins 15 and 16 instead of 14 and 15. Do it in stages and check with "gpio readall" and you shouldn't go far wrong.

Use the "gpio mode 15 in" to set the TXD to input.

gpio mode 15 in

Then use the "gpio mode 16 in" to set the RXD to input.

gpio mode 16 on

Now you can program!!!!

Leave a Reply

Your email address will not be published. Required fields are marked *