- OSX
- STLink v2
-
If you don't use homebrew, blindly type this into your terminal -
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" brew doctor brew install wget
-
Install the gcc-arm-none-eabi toolchain to your home directory
wget "https://launchpad.net/gcc-arm-embedded/4.8/4.8-2014-q2-update/+download/gcc-arm-none-eabi-4_8-2014q2-20140609-mac.tar.bz2" tar -xvf gcc-arm-none-eabi* mv gcc-arm-none-eabi-4_8-* ~/gcc-arm-none-eabi
-
Install Eclipse C/C++
-
Via Eclipse->Help->Install New Software, add these sources and install everthing -
- Eclipse CDT - http://download.eclipse.org/tools/cdt/releases/kepler
- Zylin CDT - http://opensource.zylin.com/zylincdt
- GNU ARM Plugin - http://gnuarmeclipse.sourceforge.net/updates
-
Install OpenOCD with support for stlink
brew install openocd --enable_ft2232_libftdi --enable_stlink --with-libftdi --with-libusb
Follow this blog post setup your Eclipse installation, but using the information below.
###openocd config script###
source [find interface/stlink-v2.cfg]
source [find target/stm32f1x_stlink.cfg]
reset_config trst_only srst_nogate
##gdb script##
init
target remote localhost:3333
mon reset halt
mon wait_halt
mon poll
mon flash probe 0
mon flash protect 0 0 PAGECOUNT off
mon reset halt
mon stm32f1x mass_erase 0
mon flash write_image erase <FIRMWARE>.elf
mon flash protect 0 0 PAGECOUNT on
disconnect
target remote localhost:3333
mon reset halt
Replace PAGECOUNT with (FLASH_SIZE / PAGE_SIZE)
run
thbreak main
continue