Notizbl0g.

h4cking, ham radio, fire fighting and m0re

Compiling MMDVM Firmware on Arduino 1.6.9

Today I wanted to update my MMDVM to the latest firmware as some new features were added during the last commits. Firstly I upgraded the Arduino IDE to 1.6.9 and the board files to SAM 1.6.8. After that the firmware wouldn’t compile anymore. Ah yes, there was something to be manually edited in a platform.txt file.

After searching I found it to be in /home/$user/.arduino15/packages/arduino/hardware/sam/1.6.8/. The diff is here:

$ diff -purN platform.txt.bak platform.txt
--- platform.txt.bak 2016-05-13 08:42:00.993078492 +0200
+++ platform.txt  2016-05-13 08:42:08.744972003 +0200
@@ -78,7 +78,7 @@ archive_file_path={build.path}/{archive_
 recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"
 
 ## Combine gc-sections, archives, and objects
-recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" -mcpu={build.mcu} -mthumb {compiler.c.elf.flags} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--start-group {compiler.combine.flags} {object_files} "{build.variant.path}/{build.variant_system_lib}" "{build.path}/{archive_file}" -Wl,--end-group -lm -gcc
+recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" -mcpu={build.mcu} -mthumb {compiler.c.elf.flags} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--start-group {compiler.combine.flags} {object_files} "{build.variant.path}/{build.variant_system_lib}" "{build.system.path}/CMSIS/CMSIS/Lib/GCC/libarm_cortexM3l_math.a" "{build.path}/{archive_file}" -Wl,--end-group -lm -gcc
 
 ## Create output (.bin file)
 recipe.objcopy.bin.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.bin"

This is now also part of BUILD.md in the official github repo. See [1].

References

[1] https://github.com/g4klx/MMDVM/blob/master/BUILD.txt