Partie logicielle - Firmware du HotSpot
Compiling and MMDVM firmware loading
The STM32F103 board will receive the firmware. The installation must be able to be done with Windows, but some sudden complications for the installation of the drivers, I propose you to compile and load the firmware from your Raspberry Pi. Switch on the Raspberry Pi, connect it to the power supply and to the network (initially RJ45)
The firmware to load is MMDVM HS which is dedicated to HotSpot
We load from the console opened remotely on the Raspberry Pi (I use Putty. exe as explained in Raspberry Pi documentation).
Log in to your Raspberry Pi.
Download MMDVM HS
First of all, let’s install some prerequisites.
- An update of installation resources
sudo apt-get update
Get:1 http://mirrordirector.raspbian.org jessie InRelease [14.9 kB] Get:2 http://archive.raspberrypi.org jessie InRelease [22.9 kB] Get:3 http://mirrordirector.raspbian.org jessie/main armhf Packages [9,535 kB] ... ... Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en Fetched 9,702 kB in 1min 24s (115 kB/s) Reading package lists... Done
- And module installations
sudo apt-get install gcc-arm-none-eabi gdb-arm-none-eabi libstdc++-arm-none-eabi-newlib libnewlib-arm-none-eabi
Confirm by Yes
Reading package lists... Done Building dependency tree Reading state information... Done gcc-arm-none-eabi is already the newest version. libnewlib-arm-none-eabi is already the newest version. libnewlib-arm-none-eabi set to manually installed. libstdc++-arm-none-eabi-newlib is already the newest version. libstdc++-arm-none-eabi-newlib set to manually installed. The following NEW packages will be installed: gdb-arm-none-eabi 0 upgraded, 1 newly installed, 0 to remove and 84 not upgraded. Need to get 1,621 kB of archives. After this operation, 5,075 kB of additional disk space will be used. Do you want to continue? [Y/n] Get:1 http://mirrordirector.raspbian.org/raspbian/ jessie/main gdb-arm-none-eabi armhf 7.7.1+dfsg-3+6 [1,621 kB] Fetched 1,621 kB in 20s (80.7 kB/s) Selecting previously unselected package gdb-arm-none-eabi. (Reading database ... 34460 files and directories currently installed.) Preparing to unpack .../gdb-arm-none-eabi_7.7.1+dfsg-3+6_armhf.deb ... Unpacking gdb-arm-none-eabi (7.7.1+dfsg-3+6) ... Processing triggers for man-db (126.96.36.199-5) ... Setting up gdb-arm-none-eabi (7.7.1+dfsg-3+6) ...
- And installation of git to download directly the GitHub ressources
sudo apt install git
- In /opt directory
- Downloading HS MMDVM
sudo git clone https://github.com/juribeparada/MMDVM_HS
- Download the STM32F103 library
cd MMDVM_HS/ sudo git clone https://github.com/juribeparada/STM32F10X_Lib
Firmware compilation and loading
First of all, let’s make sure that the configuration file validates all the functions necessary for the HotSpot.
sudo nano /opt/MMDVM_HS/Config.h
The default configuration normally corresponds to our needs. Here is the expected file.
#if !defined(CONFIG_H) #define CONFIG_H // Select one board (STM32F103 based boards) // 1) ZUMspot USB and ZUMspot RPi: // #define PI_HAT_7021_REV_03 // 2) ZUMspot Libre Kit or board with modified RF7021SE and Blue Pill STM32F103: #define ADF7021_CARRIER_BOARD // Enable ADF7021 support: #define ENABLE_ADF7021 // Enable full duplex support with dual ADF7021: // #define DUPLEX // TCXO of the ADF7021 // For 14.7456 MHz: #define ADF7021_14_7456 // For 12.2880 MHz: // #define ADF7021_12_2880 // Host communication selection: // #define STM32_USART1_HOST #define STM32_USB_HOST // Enable mode detection: #define ENABLE_SCAN_MODE // Send RSSI value: // #define SEND_RSSI_DATA // Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi): #define SERIAL_REPEATER // Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled): // #define SERIAL_REPEATER_USART1 // Enable P25 Wide modulation: // #define ENABLE_P25_WIDE // Disable mode LEDs blink during scan mode: // #define QUIET_MODE_LEDS #endif
Let’s now start compiling MMDVM HS with bootloader ( bl option)
cd /opt/MMDVM_HS sudo make clean sudo make bl
The compilation must end by indicating that the files outp.hex et outp.bin have been generated.
To load the firmware, we use an RS232 TTL USB TTL adapter. When plugged into a USB port on the Raspberry Pi, a /dev/ttyUSB0 port must appear (ls /dev/tty* ).
To load the firmware and bootloader on the STM32F103, we need to move one of the two jumpers (the BOOT0, positioned at the top, on side of pins B11, B10, B1) to position 1 (to the right).
Start the loading command.
sudo make serial-bl devser=/dev/ttyUSB0
Let’s return the jumper BOOT0 to position 0 (the two jumpers are in position 0, on the left). Restart the STM32F103 with a short press of the RESET button (close to the jumpers). The red LED of the STM32 starts flashing (rapidly then slowly).
If you want to update the firmware at another time, you will no longer need the USB interface or to set jumper BOOT0 to 1. Indeed, since the bootloader is already in place, the update is done directly via the USB link from the STM32F103 to the Raspberry Pi, the one that we will be in use for HotSpot normal operation. This is the serial port /dev/ACM0
In this case, to make the update, here are the commands, BOOT0 to 0 and via USB connection.
cd /opt/MMDVM_HS sudo make clean sudo make bl sudo make dfu devser=/dev/ttyACM0
Now the firmware is loaded. Let’s take care of the configuration of the Raspberry Pi on which we install the MMDVMHost software. Let’s look at the MMDVMHost stage now, we will soon be on the air and the network.