It's always the same, no matter which eval board you have: STM32 discovery, LPCXpresso, TI Launchpads. They are very cheap, but the recommended IDEs are limited: Their code size is limited, Windows only, or they are bound to a specific Linux distribution.
In my experience the choice depends on your long-term goals:
- Do you want to share code with AVR 8-bit (or PIC32, Renesas RX 32, ...)?
- Is it a mid-term/long-term goal to have a build system based on
make
? - Do you need tab-completion and/or an integrated debugger?
- Do you want to try other eval boards in the future (without being forced to install yet another IDE)?
or do you just want to get this one up and running quickly. In that case I would use one of the recommended IDEs to get an impression.
On the other hand, all 32-bit microcontrollers I have used (Cortex-M0/3/4, PIC32, Renesas RX) can be programmed with gcc
. As far as I know Code Red, Mentor, and MPLABX use gcc
(or a modified gcc
).
So there is always the possibility to use Eclipse
with a Makefile
project, and gcc
.
I have tried it twice, but it did not work well for me, because I share libraries between the different targets, and I found it difficult to pass around the defines in Eclipse.
So my IDE is Makefile
, Emacs
, and gcc
, and I have switched completely to using C++: This might be another advantage of using gcc
.
Both possibilities (Eclipse with Makefile project or just editor with make) are not "off the shelf": They require time, patience, and your favourite Internet search engine.
Update
I am not aware of a complete tutorial on how to setup a GCC + make based environment, so I simply describe the basic steps I did it some years ago (with some changes).
- Get a binary distribution of GCC for ARM from https://launchpad.net/gcc-arm-embedded
The following steps are STM32 specific:
Get one of the discovery boards, for example the STM32 value line Discovery.
Get a flash utility: I am using stlink (
git clone https://github.com/texane/stlink.git
). This includes a GDB backend as well.There are various examples available, search for "stm32vl discovery blink" (I cannot recommend one here, the one I used has vanished)
As an alternative (or follow-up): Get the Peripheral firmware examples
You will find a GNU ld compatible linker script in
Project/Examples/GPIOToggle/TrueSTUDIO/stm32_flash.ld
You will find a GNU as compatible startup in
Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x/startup/TrueSTUDIO/startup_stm32f10x_ld_vl.s
You will find all other required library include files and sources in the .zip archive as well
Look at the GPIOToggle project (
Project/Examples/GPIOToggle
)Write a Makefile to compile, link, and flash