Hung-Ming Chen's Blog

星期日, 12月 13, 2015

Setup STM32 Development Environment in Linux

Setup STM32 Development Environment in Linux

1. Download Tools 

1.1 Toolchain: GCC ARM Embedded
Website: https://launchpad.net/gcc-arm-embedded
This toolchain for linux is 32bit. We need lib32 packages for ubuntu 64bit
# sudo dpkg --add-architecture i386
# sudo apt-get install lib32ncurses5

1.2 STLink utility
Requirement: automake, libusb-1.0-dev
Install:
  • ./autogen.sh
  • ./configure
  • make; sudo make install
Copy "49-stlinkv2.rules" to /etc/udev/rules.d/ 
Restart udev without reboot
udevadm control --reload-rules ; udevadm trigger
Unplug and plug usb cable to STM32 board. 

1.3 GNU ARM Eclipse plugin
Recommended Eclipse version is 4.4 SR2 (Luna)
Install: Eclipse -> Help -> Install New Software

1.4 OpenOCD
Requirement: libftdi-dev
Install:
  • ./configure --enable-verbose --enable-vernose-jtag-io --enable-ftdi --enable-stlink
  • make; sudo make install

2. Create a New Project

Project -> New -> STM32F4xx C/C++ Project

Set "Flash size" and "External clock" for your board. STM32F429 Discovery has 2MB flash and 8MHz clock. Use "semihosting DEBUG channel"for trace output (or use "None" for smaller code size).



3. Debug Settings

  • add an openocd debug session
  • set openocd executale location
  • set gdb executable location

0 個意見:

張貼留言

訂閱 張貼留言 [Atom]



<< 首頁