I’ve got the “hello world” working on my STM32L Discovery board that I got about 8 months ago. It’s not even the canonical blinking light, but it counts up and you only know that it works by using a debugger! Another site gave me the basic idea, but I needed a few changes to get it working.
- Download the Linaro bare metal ARM toolchain (it’s near the bottom of the page). Extract it somewhere (I put it in /opt).
- Download and build OpenOCD. I’m using version 0.6.0. I used Checkinstallso I had a managed package:
tar -zxvf openocd-0.6.0.tar.gz cd openocd-0.6.0.tar.gz ./bootstrap ./configure --prefix=/usr --enable-jlink --enable-amtjtagaccel --enable-ft2232_libftdi make sudo checkinstall make install
- Now something to compile. I used this:
// By Wolfgang Wieser, heavily based on: // http://fun-tech.se/stm32/OlimexBlinky/mini.php #define STACK_TOP 0x20000800 // just a tiny stack for demo static void nmi_handler(void); static void hardfault_handler(void); int main(void); // Define the…
View original post 788 more words