STM32F4 Discovery Dev Board
From BUILDS
| Revision as of 00:25, 26 May 2012 Cwoodall (Talk | contribs) ← Previous diff |
Revision as of 00:30, 26 May 2012 Cwoodall (Talk | contribs) (→OS X) Next diff → |
||
| Line 37: | Line 37: | ||
| </pre> | </pre> | ||
| - | Now you should have everything to follow [http://cu.rious.org/make/stm32f4-discovery-board-with-linux/ these instructions] from Rious. | + | Now we can actually load up an example program! So lets do that: |
| + | <pre> | ||
| + | $ cd ~/src/stlink/examples/blink | ||
| + | $ make CONFIG_STM32F4_DISCOVERY=1 | ||
| + | </pre> | ||
| + | |||
| + | Then connect to the debugger and try it out… | ||
| + | <pre> | ||
| + | $ arm-none-eabi-gdb | ||
| + | (gdb) target extended localhost:4242 | ||
| + | (gdb) load blink.elf | ||
| + | (gdb) run | ||
| + | </pre> | ||
| + | |||
| + | You should see the Green, Orange, Blue and Red lights blink in some sort of order as well as the light in the top left corner. Great success! | ||
| == Makefile == | == Makefile == | ||
| ...Coming soon... | ...Coming soon... | ||
Revision as of 00:30, 26 May 2012
Contents |
Specs
Open Source Toolchain
Linux
Under linux this is rather straightforward. I was able to compile with toolchain without a hitch using these instructions, under OS X I would imagine its a tad more of a pain in the ass. The programs/scripts being used are the following:
- summon-arm-toolchain : Downloads and compiles the arm-none-eabi toolchain which we will be using. I am not sure if it compiles with the STM32F4's FPU support.
- Texane's stlink : Allows us to program using the stlink on the STM32F4 Discovery board. We program using gdb to load the program into SRAM for now. If you link correctly you can flash too. In the future this should work to program other STM32 chips via the SWD link (if the jumpers are set correctly).
- The official STM32F4 header files and libraries : Not sure how compatible these are with our toolchain, but its probably worth grabbing them.
OS X
Thanks to Alex Whittemore there is some good documentation [here http://www.alexwhittemore.com/open-source-ide-and-toolchain-for-the-stm32f4-discovery-on-mac-osx-lion/] on one method of getting set up with Eclipse. Chris Woodall would prefer to use emacs + a makefile to do his development, so the methodology is a little different.
First, you should make sure you have XCode installed, because that will install gcc and all of the development tools you need for some of the future steps.
Now, lets get macports if you have a Mac and some self respect you should already have macports anyway (or homebrew). Then we will install the arm-none-eabi toolchain, this might take awhile if you have never used macports before, while you are at it you should install git:
$ sudo port install arm-none-eabi-* $ sudo port install git # optional
Now we will use git to grab texane's great stlink program:
$ mkdir ~/src #optional, but my preferred working directory for installations like this $ cd ~/src # optional $ git clone https://github.com/texane/stlink.git $ cd stlink/gdbserver $ make
Now we can actually load up an example program! So lets do that:
$ cd ~/src/stlink/examples/blink $ make CONFIG_STM32F4_DISCOVERY=1
Then connect to the debugger and try it out…
$ arm-none-eabi-gdb (gdb) target extended localhost:4242 (gdb) load blink.elf (gdb) run
You should see the Green, Orange, Blue and Red lights blink in some sort of order as well as the light in the top left corner. Great success!
Makefile
...Coming soon...
