Mac Tutorial: How to compile and upload the firmware of MIs eurorack modules


#61

Hi

I’m having problems with compiling the “elements” code. Peaks and Braids runs Ok, but with elements (and also clouds) i having trouble.

Maybe someone can give me a hint.
Thanks.

stmlib/makefile.inc:297: build/elements/depends.mk: No such file or directory
/Users/XXXXXX/arm-cs-tools/bin/arm-none-eabi-g++ -MM -g -O2 -Wall -Werror -fasm -finline -finline-functions-called-once -fdata-sections -ffunction-sections -fno-unroll-loops -fshort-enums -fno-move-loop-invariants -I. -DGCC_ARMCM4 -DSTM32F4XX -DNO_APPLICATION -DF_CPU=168000000L -DF_CRYSTAL=8000000L -DUSE_STDPERIPH_DRIVER -DSYSCLK_FREQ_168MHz=168000000L -Istmlib/third_party/STM -Istmlib/third_party/STM/CMSIS/CM3_f4xx -Istmlib/third_party/STM/CMSIS/CM3_f4xx/startup/gcc -Istmlib/third_party/STM/STM32F4xx_StdPeriph_Driver/inc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb-interwork -fno-exceptions -fno-rtti elements/cv_scaler.cc -MF build/elements/cv_scaler.d -MT build/elements/cv_scaler.o
elements/cv_scaler.cc:33:28: fatal error: stmlib/dsp/dsp.h: No such file or directory
#include “stmlib/dsp/dsp.h”
^
compilation terminated.

PS: also Streams is looking good


#62

git submodule update?


#63

if i run “git submodule update” in the main Folder, nothing happens


#64

how did you get stmlib in the first place?


#65

I don’t know if I understand you right, but the first time i clone the hole repository as described and build the SW. For Braids and Peaks it works without any issues.


#66

To build the code you need the “eurorack” git repository, but also the stmlib module. I’m asking how you got the stmlib submodule in the first place, because it looks like you’re trying to compile with an outdated version of it.


#67

unfortunately it still does’t work. I delete my whole repository and clone again the eurorack folder.

the old failure disappear, but i get a new one

“stmlib/makefile.inc:303: build/elements/depends.mk: No such file or directory”


#68

have you run gitsubmodule init && git submodule update?


#69

yes, but after this i get a longer error message.

it starts with: /usr/local/arm-4.8.3/bin/arm-none-eabi-g++
but i don’t have this path on my mac. my toolchain is located under:
/Users/maruskorb/arm-cs-tools/
this is also the path i entered in the stmlib/makefile.inc

is it necessary to update the whole toolchain?

sorry to waste your time with dump questions :slight_smile:

here is the whole message, starting with gitsubmodule init && git submodule update

Marcuss-Mini:eurorack marcuskorb$ git submodule init && git submodule
4f12c403e5101319aa25f3198ef9f63045cfb484 avr_audio_bootloader (heads/master)
b6e1319c9f7a96e5c3758fa67fa605d40874c821 avrlib (b6e1319)
5c28367e91dfb036593e876c886241cf81f60a2d avrlibx (heads/master)
60ea2866cfef3e82921f62d04bed7539febaf459 stm_audio_bootloader (60ea286)
0e34d101964889d14a36d7a61a83e3ec4e49d6bc stmlib (heads/master)

Marcuss-Mini:eurorack marcuskorb$ make -f elements/makefile hex
stmlib/makefile.inc:303: build/elements/depends.mk: No such file or directory
/usr/local/arm-4.8.3/bin/arm-none-eabi-g++ -MM -g -O2 -Wall -Werror -Wno-unused-local-typedefs -fasm -finline -finline-functions-called-once -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -I. -DGCC_ARMCM4 -DSTM32F4XX -DAPPLICATION -DF_CPU=168000000L -DF_CRYSTAL=8000000L -DUSE_STDPERIPH_DRIVER -DSYSCLK_FREQ_168MHz=168000000L -Istmlib/third_party/STM -Istmlib/third_party/STM/CMSIS/CM3_f4xx -Istmlib/third_party/STM/CMSIS/CM3_f4xx/startup/gcc -Istmlib/third_party/STM/STM32F4xx_StdPeriph_Driver/inc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb-interwork -funroll-loops -fno-exceptions -fno-rtti elements/cv_scaler.cc -MF build/elements/cv_scaler.d -MT build/elements/cv_scaler.o
make: /usr/local/arm-4.8.3/bin/arm-none-eabi-g++: No such file or directory
make: ***** [build/elements/cv_scaler.d] Error 1


#70

its going forward. After changing the toolchain path of the elements makefile.mk to
TOOLCHAIN_PATH ?= /Users/marcuskorb/arm-cs-tools/ (same like in the stmlib makefile) it starts.
But unluckily after a while an other problem occurs:

/Users/marcuskorb/arm-cs-tools/lib/gcc/arm-none-eabi/4.8.3/…/…/…/…/arm-none-eabi/bin/ld: error: build/elements/cv_scaler.o uses VFP register arguments, build/elements/elements.elf does not
/Users/marcuskorb/arm-cs-tools/lib/gcc/arm-none-eabi/4.8.3/…/…/…/…/arm-none-eabi/bin/ld: failed to merge target specific data of file build/elements/cv_scaler.o
/Users/marcuskorb/arm-cs-tools/lib/gcc/arm-none-eabi/4.8.3/…/…/…/…/arm-none-eabi/bin/ld: error: build/elements/elements.o uses VFP register arguments, build/elements/elements.elf does not
/Users/marcuskorb/arm-cs-tools/lib/gcc/arm-none-eabi/4.8.3/…/…/…/…/arm-none-eabi/bin/ld: failed to merge target specific data of file build/elements/elements.o
/Users/marcuskorb/arm-cs-tools/lib/gcc/arm-none-eabi/4.8.3/…/…/…/…/arm-none-eabi/bin/ld: error: build/elements/resources.o uses VFP register arguments, build/elements/elements.elf does not
/Users/marcuskorb/arm-cs-tools/lib/gcc/arm-none-eabi/4.8.3/…/…/…/…/arm-none-eabi/bin/ld: failed to merge target specific data of file build/elements/resources.o
/Users/marcuskorb/arm-cs-tools/lib/gcc/arm-none-eabi/4.8.3/…/…/…/…/arm-none-eabi/bin/ld: error: build/elements/ui.o uses VFP register arguments, build/elements/elements.elf does not
/Users/marcuskorb/arm-cs-tools/lib/gcc/arm-none-eabi/4.8.3/…/…/…/…/arm-none-eabi/bin/ld: failed to merge target specific data of file build/elements/ui.o

collect2: error: ld returned 1 exit status
make: ***** [build/elements/elements.elf] Error 1

any ideas? I’m a little bit frustrated :frowning:

Gruß Marcus


#71

You should only edit the toolchain path in makefile.inc in the stmlib dir. I think you’ll need to edit it to use the later compiler for Clouds and Elements, which use the STM32F4.


#72

I got this far:

4. Open “eurorack/stmlib/makefile.inc” and edit the value TOOLCHAIN_PATH to /Users/§username§/arm-cs-tools/

I’ve downloaded the project files but the /stmlib/ directory is empty. Should the Project Files have been in a particular place before staring the process?

Thanks in advance for any help!


#73

koerby -> you’re using the wrong compiler version, the one you’re using doesn’t support floating point instructions. Correct version.

makers -> the recommended way to grab the source is through git clone on the command line.

Downloading the .zip as explained in the tutorial is a bad idea because it doesn’t grab the other dependencies


#74

Yep, sorry for the mistake. I Somehow forgot that downloading the zip isn’t grabbing the dependencies. I always clone via terminal. I updated the tutorial.


#75

fyi/fwiw: not sure why, but ‘git submodule update stmlib’ wouldn’t work for me.

i had to update a few files manually before it (clouds) would compile fine (stmlib/dsp/dsp.h, stmlib/dsp/filter.h and stm_audio_bootloader/qpsk/packet_decoder.cc).


#76

it’s working. Thank you pichenettes


#77

Followed the guide, got pretty far and was able to get the test note .wav file to work. However, I am having trouble compiling the code and below is the error I am getting. When the command is run, a ‘build’ folder is created in the ‘eurorack’ folder and in that there is an empty ‘braids_bootloader’ folder…no .mk files created. I already did ‘git submodule init && git submodule update’ as well. Not the smartest person when it comes to this stuff but am eager to learn…any help is appreciated.

Homes-Mac-Pro:eurorack Ryan$ make -f braids/bootloader/makefile hex
stmlib/makefile.inc:303: build/braids_bootloader/depends.mk: No such file or directory
/Users/Ryan/arm-cs-tools/bin/arm-none-eabi-g++ -MM -g -O2 -Wall -Werror -Wno-unused-local-typedefs -fasm -finline -finline-functions-called-once -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -I. -DGCC_ARMCM3 -DSTM32F10X_MD -DNO_APPLICATION -DF_CPU=72000000L -DF_CRYSTAL=8000000L -DUSE_STDPERIPH_DRIVER -DSYSCLK_FREQ_72MHz=72000000L -Istmlib/third_party/STM -Istmlib/third_party/STM/CMSIS/CM3_f10x -Istmlib/third_party/STM/CMSIS/CM3_f10x/startup/gcc -Istmlib/third_party/STM/STM32F10x_StdPeriph_Driver/inc -mcpu=cortex-m3 -mthumb -fno-unroll-loops -fno-exceptions -fno-rtti braids/bootloader/bootloader.cc -MF build/braids_bootloader/bootloader.d -MT build/braids_bootloader/bootloader.o
make: /Users/Ryan/arm-cs-tools/bin/arm-none-eabi-g++: No such file or directory
make: ***** [build/braids_bootloader/bootloader.d] Error 1


#78

Have you installed gcc for ARM? If so, where?


#79

I got it from xcode’s optional command line tools download, and then I used jsnyder’s tool chain.

Homes-Mac-Pro:~ Ryan$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.0.0
Thread model: posix


#80

You need to set TOOLCHAIN_PATH in stmlib/makefile.inc to wherever the ARM gcc compiler installed by the JSynder package lives. It looks like it isn’t at /Users/Ryan/arm-cs-tools/

clang, the Apple C/C++ compiler will compile the Braids code fine, but only to run on an Intel chip, and it will produce a test WAV file fine, but the compiled code created by it will not run on the ARM Cortex M3 chip in your Braids. That’s why you need the ARM EABI version of the gcc compiler in the Snyder toolchain package, which emits code compiled for the ARM chip family.