Skip to content

Compile STM32 on OSX, flash with JLink - guide #9

@rosek86

Description

@rosek86

Maybe this will be helpful for someone, this is how I've compiled STM32 firmware on OSX.

update submodules

git submodule update --init

bootstrap-mac.sh

Create a bootstrap-mac.sh file in firmware/stm32 and copy script content attached below.

Bootstrap

cd firmware/stm32
source ./bootstrap-mac.sh

Build

cd libopencm3
make
cd ..
make

Flash using JLink

JLinkExe -Device STM32F103C8 -Speed 4000 -If SWD -Autoconnect 1
loadbin stm32adf435xfw.bin 0x08000000
r
g

bootstrap-mac.sh

#!/bin/bash

if [ ! -d gcc-arm-none-eabi-8-2019-q3-update ]; then
  wget https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/8-2019q3/RC1.1/gcc-arm-none-eabi-8-2019-q3-update-mac.tar.bz2
  tar -xjf gcc-arm-none-eabi-8-2019-q3-update-mac.tar.bz2
  rm -f gcc-arm-none-eabi-8-2019-q3-update-mac.tar.bz2
fi

export PATH="$PATH:$(pwd)/gcc-arm-none-eabi-8-2019-q3-update/bin/"

echo "OK"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions