Skip to content

Instantly share code, notes, and snippets.

@jj1bdx
Last active May 22, 2022 08:40
Show Gist options
  • Select an option

  • Save jj1bdx/0eeb447882ccf695b7d9 to your computer and use it in GitHub Desktop.

Select an option

Save jj1bdx/0eeb447882ccf695b7d9 to your computer and use it in GitHub Desktop.
FreeBSD and macOS STM32 embedded development kit configuration

FreeBSD and macOS STM32 development memo

FreeBSD Ports needed

  • devel/gcc-arm-embedded (Add path to /usr/local/gcc-arm-embedded-6-2017-q2-update/bin)
  • devel/stlink
  • comms/dfu-util
  • devel/openocd
  • devel/libftdi (as a dependency)

For macOS: use GNU Arm Embedded Toolchain

macOS HomeBrew kits needed

brew tap nitsky/stm32
# brew install arm-none-eabi-gcc # this one is old
brew install stlink
brew install openocd --enable-ft2232_libftdi
brew install dfu-util

On OpenOCD

OpenOCD is now installed, this software can damage your hardware, enjoy!

User's guide is at:
 http://openocd.sourceforge.net/documentation/online-docs/
Developer's guide is at:
 http://openocd.sourceforge.net/documentation/openocd-reference-manual/

FreeBSD USB NOTE:
 To allow an ordinary user to acces any of the the hotplug USB interface
 add him/her to the operator group  (pw groupmod operator -m username), then
 setup the devfs subsystem by adding these lines to the following files:

 ***/etc/devfs.rules (FreeBSD >= 8):
 [localrules=10]
        add path 'ugen*' mode 0660 group operator
        add path 'usb/*'  mode 0660 group operator
        add path 'usb' mode 0770 group operator

 ***/etc/devfs.rules (FreeBSD <= 7):
 [localrules=10]
        add path 'ugen*' mode 0660 group operator

 ***/etc/rc.conf:
        devfs_system_ruleset="localrules"

Do NOT install following Ports for FreeBSD

The following ports will be installed in /usr/local/bin, but will not pick up the necessary include and library files, so do not use them unless you're absolutely sure aboud what you are doing.

TODO: making something like arm-none-eabi-newlib? (See /devel/psptoolchain-newlib)

  • devel/arm-none-eabi-gcc
  • devel/arm-none-eabi-binutils
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment