Problem Building Firmware For Spark

I have run into problems with min heating/cooling times as I am using a fan and they are causing large overshoots.

I have changed the values and gone to build the firmware with the instructions on https://github.com/BrewPi/firmware but the build fails with:

make[1]: Entering directory '/home/brewpi/spark-firmware/main’
source path …/…/firmware
using 0.2.7-68-g1bfdb61 as build name
make[2]: Entering directory '/home/brewpi/spark-firmware/wiring’
make[2]: arm-none-eabi-gcc: Command not found
…/build/module.mk:177: recipe for target ‘…/build/target/wiring/arm/src/spark_wiring_wifi.o’ failed
make[2]: *** […/build/target/wiring/arm/src/spark_wiring_wifi.o] Error 127
make[2]: Leaving directory ‘/home/brewpi/spark-firmware/wiring’
…/build/recurse.mk:7: recipe for target ‘wiring’ failed
make[1]: *** [wiring] Error 2
make[1]: Leaving directory '/home/brewpi/spark-firmware/main’
makefile:11: recipe for target ‘run_make’ failed
make: *** [run_make] Error 2

I am not sure where to start to troubleshoot…

This means it cannot find the compiler. You will need to setup your path to include the location of the ARM gcc tools. Once setup, typing

arm-none-eabi-gcc --version

should give you output like

arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 4.8.4 20140725 (release) [ARM/embedded-4_8-branch revision 213147]
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

PS: You’ll want to be careful about changing the minimum cooling time - this is set to preserve the compressor in your fridge.

It would be better that you change the Kp, Ki, and Kd constants to better match your fridge with the fan rather than hacking the code. This will help avoid overshoots.

Thanks for that I now have another error, looks like a missing bracket.

make[1]: Entering directory '/home/brewpi/spark-firmware/main’
source path …/…/firmware
using 0.2.7-68-g1bfdb61 as build name
make[2]: Entering directory ‘/home/brewpi/spark-firmware/wiring’
/home/pi/bin/gcc-arm-embedded/gcc-arm-none-eabi-4_9-2015q1/bin/arm-none-eabi-gcc: 1: /home/pi/bin/gcc-arm-embedded/gcc-arm-none-eabi-4_9-2015q1/bin/arm-none-eabi-gcc: Syntax error: word unexpected (expecting “)”)
…/build/module.mk:177: recipe for target ‘…/build/target/wiring/arm/src/spark_wiring_wifi.o’ failed
make[2]: *** […/build/target/wiring/arm/src/spark_wiring_wifi.o] Error 2
make[2]: Leaving directory ‘/home/brewpi/spark-firmware/wiring’
…/build/recurse.mk:7: recipe for target ‘wiring’ failed
make[1]: *** [wiring] Error 2
make[1]: Leaving directory '/home/brewpi/spark-firmware/main’
makefile:11: recipe for target ‘run_make’ failed
make: *** [run_make] Error 2

I am using a fan with no fridge compressor to damage.

Can you try using 4.8.x version of the compiler?

That’s good to hear. I would really like to have these min heat/cool constants configurable like the other settings. Questionable if this is possible on the arduino, but definitely can be done on the spark. This will also be needed for mashing support. cc: @Elco

I thought the compiler was sorted but running “arm-none-eabi-gcc --version” gets:
-bash: /home/pi/bin/gcc-arm-embedded/gcc-arm-none-eabi-4_9-2015q1/bin/arm-none-eabi-gcc: cannot execute binary file

I have checked the permissions and user and group can execute.

Just tried 4.8 and it produced a similar output:

pi@raspberrypi /home/brewpi/firmware/platform/spark $ make
make[1]: Entering directory '/home/brewpi/spark-firmware/main’
source path …/…/firmware
using 0.2.7-68-g1bfdb61 as build name
make[2]: Entering directory ‘/home/brewpi/spark-firmware/wiring’
/home/pi/bin/gcc-arm-embedded/gcc-arm-none-eabi-4_8-2014q2/bin/arm-none-eabi-gcc: 1: /home/pi/bin/gcc-arm-embedded/gcc-arm-none-eabi-4_8-2014q2/bin/arm-none-eabi-gcc: ELF?4?N: not found
/home/pi/bin/gcc-arm-embedded/gcc-arm-none-eabi-4_8-2014q2/bin/arm-none-eabi-gcc: 2: /home/pi/bin/gcc-arm-embedded/gcc-arm-none-eabi-4_8-2014q2/bin/arm-none-eabi-gcc: Syntax error: word unexpected (expecting “)”)
…/build/module.mk:177: recipe for target ‘…/build/target/wiring/arm/src/spark_wiring_wifi.o’ failed
make[2]: *** […/build/target/wiring/arm/src/spark_wiring_wifi.o] Error 2
make[2]: Leaving directory ‘/home/brewpi/spark-firmware/wiring’
…/build/recurse.mk:7: recipe for target ‘wiring’ failed
make[1]: *** [wiring] Error 2
make[1]: Leaving directory '/home/brewpi/spark-firmware/main’
makefile:11: recipe for target ‘run_make’ failed
make: *** [run_make] Error 2

I am going to look at the compiler because it fails at “arm-none-eabi-gcc --version” with:

-bash: /home/pi/bin/gcc-arm-embedded/gcc-arm-none-eabi-4_9-2015q1/bin/arm-none-eabi-gcc: cannot execute binary file

It must be the way am installing it.
I used the method below and perhaps I have missed a step?

mkdir -p ~/bin/gcc-arm-embedded && cd "$_"
wget https://launchpad.net/gcc-arm-embedded/4.8/4.8-2014-q2-update/+download/gcc-arm-none-eabi-4_8-2014q2-20140609-linux.tar.bz2
tar xjf gcc-arm-none-eabi-*-linux.tar.bz2
export PATH=$PATH:$HOME/bin/gcc-arm-embedded/gcc-arm-none-eabi-4_8-2014q2/bin
echo ‘export PATH=$PATH:$HOME/bin/gcc-arm-embedded/gcc-arm-none-eabi-4_8-2014q2/bin’ >> ~/.bash_profile

Ok so I should have used the Armhf version of arm-none-eabi-gcc which I have now installed after upgrading libmpfr4 to libmpfr4_3.1.2-3.

It nearly compiles now but stops at:
…/…/firmware/platform/spark/modules/Platform.cpp:5:27: fatal error: ymodem/ymodem.h: No such file or directory
#include "ymodem/ymodem.h"
Not sure whether it should be there or got lost in the clone

Pretty close to a compile now having removed the include modem/ymodem.h line it nearly completes but now complains about the size.

/usr/bin/…/lib/gcc/arm-none-eabi/4.8.4/…/…/…/…/arm-none-eabi/bin/ld: …/…/firmware/platform/spark/target/brewpi.elf section .text' will not fit in regionFLASH’
/usr/bin/…/lib/gcc/arm-none-eabi/4.8.4/…/…/…/…/arm-none-eabi/bin/ld: region `FLASH’ overflowed by 25872 bytes
collect2: error: ld returned 1 exit status
…/build/module.mk:143: recipe for target ‘…/…/firmware/platform/spark/target/brewpi.elf’ failed
make[1]: *** […/…/firmware/platform/spark/target/brewpi.elf] Error 1
make[1]: Leaving directory '/home/brewpi/spark-firmware/main’
makefile:11: recipe for target ‘run_make’ failed
make: *** [run_make] Error 2

I have deleted the firmware directory and started from clean and the same result.

Many thanks

Chris

cool. please do a clean build adding SPARK_CLOUD=n clean all to the make command.

1 Like

Ok, Mat that worked.
Thank you very much

Chris

@mdma could you please confirm that the branches to checkout are still the following?

 - spark-firmware repo: git checkout feature/hal
 - firmwarwe repo: git checkout develop

I just ask that as I have compilation errors…

source path ../../firmware
using 0.2.10-0-g2312560 as build name
make[1]: Entering directory `~/prj/brewpi/spark-firmware/main'
In file included from ../../firmware/app/controller/DeviceManager.h:31:0,
                 from ../../firmware/app/controller/PiLink.h:25,
                 from ../../firmware/app/controller/Brewpi.cpp:32:
../../firmware/app/devices/OneWire/OneWire.h:2:20: fatal error: BrewPi.h: No such file or directory
 #include "BrewPi.h"

Error was capitalization of the include, which Windows didn’t mind, but better operating systems do care:

Pull and try again