MMDVM_RPT_Hat Reset

The other day VK7HSE asked me how to manually reset a MMDVM_RPT_Hat without pulling the power supply aka. do that remotely. As the BOOT0 and RESET pin of the STM32F722 MCU is wired to the Raspberry Pi GPIOs there is a simple command line solution to do this. You just need to flip some GPIOs (in the right order of course). Here is how to do it.

MMDVM_RPT_Hat
MMDVM_RPT_Hat

During normal operating mode BOOT0 is low. This pin is wired to GPIO hardware pin 38 (wPi pin 28 / BCM pin 20). The MCU RESET pin is connected to GPIO hardware pin 40 (wPi pin 29 / BCM pin 21). So a reset to normal operating mode would be:

#!/bin/bash

# All pin numbers with wiringPi number scheme
# Set BOOT0 to 0 just in case it was high before
gpio mode 28 out
gpio write 28 0

# Now reset the MCU; set GPIO 29 high, low, high
gpio mode 29 out
gpio write 29 1 && gpio write 29 0 && gpio write 29 1

# Now the board should be in normal operating mode
exit 0

In contrast to this putting the MCU into flash mode requires setting GPIO pin 38 to high and then resetting the MCU.