Sourcegate

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.

  1. Download the Linaro bare metal ARM toolchain (it’s near the bottom of the page).  Extract it somewhere (I put it in /opt).
  2. 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
  3. 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

Advertisements

About minghuasweblog

a long time coder
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s