I recently purchased a very inexpensive MMDVM on eBay from a Chinese reseller. It arrived promptly and I attached it to a Raspberry Pi 3 with a fresh Pi-Star image. 20 minutes after I started I had a working hotspot. Now that’s saying something since I still hadn’t really figured out how to make my Yaesu FT1XD do all it’s digital magic yet. Pi-Star is amazingly easy to get up and running.

The ad on eBay for the MMDVM stated “Firmware is pre-loaded and is easily upgraded via software”. It was running V1.4.17 but I noticed that the latest was V1.5.2. So I figured I should get the fresh code and see how that works.

Yeah….turns out “easily upgraded via software” is only true if you know the secret handshake. So that’s what I share with you here.

First off you’ll need to be sure that you’re attaching the MMDVM to the Pi using a full 40 pin GPIO. That is to say that older Pi’s don’t have 40 pins so they will lack the two pins needed to place the MMDVM into the mode necessary for firmware writing. Specifics are found here: http://notebook.hvdn.org/2018/06/mmdvm-jumbospot-board-mods-you-may-need.html

My attempts to upgrade firmware were failing. All of the instructions I found were very similar but all resulted in this:

...
./flash.sh: line 29: [: =: unary operator expected
Downloading latest firmware (stable)...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   643  100   643    0     0   2736      0 --:--:-- --:--:-- --:--:--  2736
100 50900  100 50900    0     0  65006      0 --:--:-- --:--:-- --:--:-- 8283k
Cloning into 'STM32F10X_Lib'...
remote: Enumerating objects: 193, done.
remote: Total 193 (delta 0), reused 0 (delta 0), pack-reused 193
Receiving objects: 100% (193/193), 3.28 MiB | 2.12 MiB/s, done.
Resolving deltas: 100% (71/71), done.
Raspberry Pi 3 detected
stm32flash Arduino_STM32_0.9

http://github.com/rogerclarkmelbourne/arduino_stm32

Using Parser : Raw BINARY
Interface serial_posix: 57600 8E1
Version      : 0x22
Option 1     : 0x00
Option 2     : 0x00
Device ID    : 0x0410 (Medium-density)
- RAM        : 20KiB  (512b reserved by bootloader)
- Flash      : 128KiB (sector size: 4x1024)
- Option RAM : 16b
- System RAM : 2KiB
Write to memory
Erasing memory
Got NACK from device on command 0x43
Can't initiate chip erase!
Failed to erase memory

Resetting device... done.


Flashing your hs_hat modem complete, press any key to reboot your Pi-Star System...

Use SSH to login to the pi-star. Use the rpi-rw command to place the pi-star into read/write mode.

Now execute the following command to unprotect the flash on the MMDVM (this is the secret handshake, the secret sauce):

sudo stm32flash -k /dev/ttyAMA0

You should see something that looks like this:

pi-star@pi-star(rw):~$ stm32flash -k /dev/ttyAMA0 
stm32flash 0.5

http://stm32flash.sourceforge.net/

Interface serial_posix: 57600 8E1
Version      : 0x22
Option 1     : 0x00
Option 2     : 0x00
Device ID    : 0x0410 (STM32F10xxx Medium-density)
- RAM        : 20KiB  (512b reserved by bootloader)
- Flash      : 128KiB (size first sector: 4x1024)
- Option RAM : 16b
- System RAM : 2KiB
Read-UnProtecting flash
Done.

Then execute the command to upgrade the firmware to the latest:

sudo pistar-mmdvmhshatflash hs_hat

You’ll know it’s all good when the output shows success, something like this:


Using Parser : Raw BINARY
Interface serial_posix: 57600 8E1
Version      : 0x22
Option 1     : 0x00
Option 2     : 0x00
Device ID    : 0x0410 (Medium-density)
- RAM        : 20KiB  (512b reserved by bootloader)
- Flash      : 128KiB (sector size: 4x1024)
- Option RAM : 16b
- System RAM : 2KiB
Write to memory
Erasing memory
Wrote and verified address 0x0800c6d4 (100.00%) Done.

Starting execution at address 0x08000000... done.


Flashing your hs_hat modem complete, press any key to reboot your Pi-Star System.