Instal·lar MMDVM a una placa STM32F446 en Linux i Raspbian

Us passo un tutorial que he confeccionat perque podeu instal·lar el codi  MMDVM de G4KLX a una placa STM32F446

Tota aquesta operació es realitza obrint un terminal en el sistema operatiu.

 

Seguiu les següents instruccions:

 

Actualització de llista de paquets:

sudo apt-get update

 

Instal·lació des paquets necessaris:

sudo apt-get install git gcc-arm-none-eabi gdb-arm-none-eabi autoconf libtool pkg-config libusb-1.0-0 libusb-1.0-0-dev

 

Instal·lació del programari openocd utilitzant codi font:

git clone https://github.com/ntfreak/openocd

cd openocd

./bootstrap

./configure

make sudo

make install

cd ..

 

Modificació del fitxer stm32f4discovery.cfg del programari OpenOCD:

sudo nano /usr/local/share/openocd/scripts/board/stm32f4discovery.cfg

 

Substituir la línia:

source [find interface/stlink.cfg]

Amb:

source [find interface/stlink-v2-1.cfg]

 

 

 

Baixar el codi font del MMDVM:

git clone https://github.com/g4klx/MMDVM

cd MMDVM

git clone https://github.com/juribeparada/STM32F4XX_Lib

 

Editar fitxer Config.h:

sudo nano Config.h

Ha de quedar així:

// Allow for the use of high quality external clock oscillators

// The number is the frequency of the oscillator in Hertz.

//

// The frequency of the TCXO must be an integer multiple of 48000.

// Frequencies such as 12.0 Mhz (48000 * 250) and 14.4 Mhz (48000 * 300) are suitable.

// Frequencies such as 10.0 Mhz (48000 * 208.333) or 20 Mhz (48000 * 416.666) are not suitable.

//

// For 12 MHz

#define EXTERNAL_OSC 12000000

// For 12.288 MHz

// #define EXTERNAL_OSC 12288000

// For 14.4 MHz

// #define EXTERNAL_OSC 14400000

// For 19.2 MHz

// #define EXTERNAL_OSC 19200000

 

// Allow the use of the COS line to lockout the modem

// #define USE_COS_AS_LOCKOUT

 

// Use pins to output the current mode

#define ARDUINO_MODE_PINS

 

// For the original Arduino Due pin layout

// #define ARDUINO_DUE_PAPA

 

// For the ZUM V1.0 and V1.0.1 boards pin layout

// #define ARDUINO_DUE_ZUM_V10

 

// For the SQ6POG board

// #define STM32F1_POG

 

// For the SP8NTH board

// #define ARDUINO_DUE_NTH

 

// For ST Nucleo-64 STM32F446RE board

#define STM32F4_NUCLEO_MORPHO_HEADER

// #define STM32F4_NUCLEO_ARDUINO_HEADER

 

// Use separate mode pins to switch external filters/bandwidth for example

// #define STM32F4_NUCLEO_MODE_PINS

 

// Pass RSSI information to the host

#define SEND_RSSI_DATA

 

// Use the modem as a serial repeater for Nextion displays

#define SERIAL_REPEATER

 

// To reduce CPU load, you can remove the DC blocker by commenting out the next line

// #define USE_DCBLOCKER

 

#endif

 

Compilar el codi:

make nucleo

 

Gravar el codi a la placa STM32F446:

sudo make deploy

 

Si no us dona error hauria de sortir alguna cosa semblant a això:

/usr/local/bin/openocd -f /usr/local/share/openocd/scripts/interface/stlink-v2-1.cfg -f /usr/local/share/openocd/scripts/target/stm32f4x.cfg -c “program bin/mmdvm_f4.elf verify reset exit”

Open On-Chip Debugger 0.10.0+dev-00348-g6f700d2b (2018-03-14-01:08)

Licensed under GNU GPL v2

For bug reports, read

              http://openocd.org/doc/doxygen/bugs.html

WARNING: interface/stlink-v2-1.cfg is deprecated, please switch to interface/stlink.cfg

Info : auto-selecting first available session transport “hla_swd”. To override use ‘transport select <transport>’.

Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD

adapter speed: 2000 kHz

adapter_nsrst_delay: 100

none separate

Info : Unable to match requested speed 2000 kHz, using 1800 kHz

Info : Unable to match requested speed 2000 kHz, using 1800 kHz

Info : clock speed 1800 kHz

Info : STLINK v2 JTAG v28 API v2 SWIM v17 VID 0x0483 PID 0x374B

Info : using stlink api v2

Info : Target voltage: 3.236149

Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints

Info : Listening on port 3333 for gdb connections

Info : Unable to match requested speed 2000 kHz, using 1800 kHz

Info : Unable to match requested speed 2000 kHz, using 1800 kHz

adapter speed: 1800 kHz

target halted due to debug-request, current mode: Thread

xPSR: 0x01000000 pc: 0x0800a23c msp: 0x20020000

Info : Unable to match requested speed 8000 kHz, using 4000 kHz

Info : Unable to match requested speed 8000 kHz, using 4000 kHz

adapter speed: 4000 kHz

** Programming Started **

auto erase enabled

Info : device id = 0x10006421

Info : flash size = 512kbytes

target halted due to breakpoint, current mode: Thread

xPSR: 0x61000000 pc: 0x20000046 msp: 0x20020000

wrote 65536 bytes from file bin/mmdvm_f4.elf in 2.423888s (26.404 KiB/s)

** Programming Finished **

** Verify Started **

target halted due to breakpoint, current mode: Thread

xPSR: 0x61000000 pc: 0x2000002e msp: 0x20020000

target halted due to breakpoint, current mode: Thread

xPSR: 0x61000000 pc: 0x2000002e msp: 0x20020000

verified 63368 bytes in 0.818973s (75.561 KiB/s)

** Verified OK **

** Resetting Target **

Info : Unable to match requested speed 2000 kHz, using 1800 kHz

Info : Unable to match requested speed 2000 kHz, using 1800 kHz

adapter speed: 1800 kHz

shutdown command invoked

 

I ja tindreu la placa STM32F446 gravada amb l’últim codi de MMDVM de G4KLX.

Salut!!!

Sergi, EA3HKB.