Very rough notes on modifying peaks using a 2025 era apple os.
brew tap ArmMbed/homebrew-formulae
brew install cmake dfu-util arm-none-eabi-gcc
brew install arm-none-eabi-gcc
brew tap osx-cross/arm
brew install arm-gcc-bin
# Get the firmware:
git clone --recurse-submodules https://github.com/pichenettes/eurorack.git mutable_instruments_eurorack
cd mutable_instruments_eurorack/peaks
cd ..
git submodule update --init --recursive
cd peaks
ln -s ../stmlib stmlib
cd ..
git clone https://github.com/timchurches/Mutated-Mutables/
git submodule update --init --recursive
cd peaks
ln -s ../stmlib stmlib
# i think this may have failed so I copied it from the original repo
rsync -a ../mutable_instruments_eurorack/stmlib .
rsync -a ../stmlib .
# update the makefile
# you must edit the make file to point to the toolchain in /opt
TOOLCHAIN_PATH ?= /opt/homebrew/
edit the peaks/makefile
F_CRYSTAL = 8000000L
F_CPU = 72000000L
SYSCLOCK = SYSCLK_FREQ_72MHz
FAMILY = f10x
DENSITY = md
MEMORY_MODE = flash
# USB = enabled
APPLICATION = TRUE
BOOTLOADER = peaks_bootloader
# Preferred upload command
UPLOAD_COMMAND = upload_combo_jtag
# Packages to build
TARGET = peaks
PACKAGES = peaks \
peaks/drivers \
peaks/drums \
peaks/modulations \
peaks/number_station \
peaks/pulse_processor \
stmlib/utils \
stmlib/system
RESOURCES = peaks/resources
TOOLCHAIN_PATH ?= /opt/homebrew/
EXTRA_INCLUDES = -I/opt/homebrew/Cellar/arm-gcc-bin@10/10.3-2021.10_1/arm-none-eabi/include \
-I/opt/homebrew/Cellar/arm-gcc-bin@10/10.3-2021.10_1/lib/arm-none-eabi/include \
-I/opt/homebrew/Cellar/arm-gcc-bin@10/10.3-2021.10_1/arm-none-eabi/include/c++/10.3.1 \
-I/opt/homebrew/Cellar/arm-gcc-bin@10/10.3-2021.10_1/arm-none-eabi/include/c++/10.3.1/arm-none-eabi
# Add these library paths
EXTRA_LIBS = -L/opt/homebrew/Cellar/arm-gcc-bin@10/10.3-2021.10_1/arm-none-eabi/lib \
-L/opt/homebrew/Cellar/arm-gcc-bin@10/10.3-2021.10_1/lib/gcc/arm-none-eabi/10.3.1
# Add the path where crt0.o resides
EXTRA_LDFLAGS = -L/opt/homebrew/Cellar/arm-gcc-bin@10/10.3-2021.10_1/arm-none-eabi/lib/thumb/v7-m/nofp
include stmlib/makefile.inc
# Rule for building the firmware update file
wav: $(TARGET_BIN)
python stm_audio_bootloader/fsk/encoder.py \
-s 48000 -b 16 -n 8 -z 4 -p 256 \
$(TARGET_BIN)
and the stmlib/makefile.inc
# add the line
# $(EXTRA_INCLUDES) \
#
INCFLAGS = \
-I. \
$(EXTRA_INCLUDES) \
-D$(ARCH_DEFINE) \
-D$(MODEL_DEFINE) \
$(APPLICATION_DEFINE) \
$(PROJECT_CONFIGURATION) \
-DF_CPU=$(F_CPU) \
-DF_CRYSTAL=$(F_CRYSTAL) \
-DHSE_VALUE=$(F_CRYSTAL) \
-DUSE_STDPERIPH_DRIVER \
-D$(SYSCLOCK)=$(F_CPU)
and
LDFLAGS = \
-Wl,-Map=$(BUILD_DIR)$(TARGET).map \
-Wl,--gc-sections \
-T $(LINKER_SCRIPT) \
$(ARCHFLAGS) \
$(INCFLAGS) \
$(EXTRA_LDFLAGS) \
$(EXTRA_LIBS) \
-L$(STM32_PATH)
LDFLAGS += --specs=nosys.specs --specs=nano.specs