[Pulko Mandy] got his hands on the new STM32 F3 Discovery board. He’s a fan of the open source tools just like we are, so he posted a guide covering the use of an open source toolchain with the F3 hardware.
This board was just announced earlier this month but there is already support for it in OpenOCD. It’s not all that different from the F4 board, which we would think made the process a bit easier. [Pulko] is using the Sourcery CodeBench Lite toolchain, which works for pretty much all of the ARM chips out there. It is GCC based and comes with GDB for debugging (along with all the other tools you would expect). He did created his own Linker script and startup code. These are crucial for ARM so it’s nice that he provided them for us. He finishes up the guide by showing how OpenOCD can be used to flash the code to the chip and how it works with the debugger.
19 thoughts on “STM32 F4 Discovery Tutorial Using Open Source Tools”
The title should say F3 not F4
and I almost digged up my F4… oh well…
It took me less than a few hours (mostly due to pebkac) to build a toolchain from scratch to program a chibios demo into my disco F4. Thanks gentoo for crossdev.
I still have to test debug with texane (I use another tool for flashing, don’t remember name).
Chibios gives already all linker, rtos files and drivers. Ready to code!
Yay, I have one of these and I really don’t want to use a bunch of proprietary tools to develop on it.
Why write your own linker script, when one can use tested linker scripts (and pre-made startup files) from e.g. http://www.onarm.com under permissive license? (not that Attolic crap).
The goal was to understand (and explain) what is going on. I see some people handling linker scripts as ‘black magic’, and relying on toolchain vendor wizards to do it for them. I made a linker script and startup code as simple as possible so everyone can understand what’s going on.
I picked up an older discovery board thinking it was such a steal at $10, but I wasn’t too impressed that I had to register in order to get the dev tools.
Eventually I registered for the tools (twice) and never got the software, so this board sits with my other unused dev boards. Maybe they don’t like Canadians?
What software are you talking about?
Flashing/Debugging: https://github.com/texane/stlink or openOCD
IDE: IBM Eclipse + Zylin CDT
Ya I had the STM8S board, so the 32-bit tools ain’t no good. This was a few years ago that I bought the board and ran into this problem, so maybe there are some open tools nowadays.
My point was that out of the box, the thing was unusable :(
I’ve never used this toolchain before, could someone inform me whether this “Lite” edition has limitations such as maximum binary size? Thanks.
The lite version has no limitations, but it’s just the command line tools. The full version includes the IDE (based on eclipse) and some other things you don’t really need.
the lite version of codesourcery will not do hardware floating point
Is the F3 discovery board available to purchase yet? I can’t find one in the UK, but doesn’t seem to be available in the US either.
Is there a tutorial like this for the F4 board?
It shouldn’t be very hard to make it work on the F4, but don’t have the hardware.
* STM32F4 Discovery is supported out of the box by OpenOCD git tree (I don’t know about the 0.6.0 release, it might have it as well). So, no need to apply patches and get a config file.
* The startup should be identical for any Cortex-M device.
* The linker script needs to be changed. At the top of it you’ll find some lines defining the flash and ram size and address. Just change these to match the memory map of the F4 chip, which you can find in the Reference Manual for it.
Also remember that this is a very minimal approach to the startup, you’ll need to setup most of the hardware from C code (the most important part being the system clock, which isn’t changed by the startup so is likely to be some slow internal RC oscillator default setting).
Hi! You can use my setup for F4, which includes Eclipse project with makefiles.
svn checkout http://andrei-development.googlecode.com/svn/branches/dev andrei-development-read-only
I would like to ask you a couple of questions:
you can simulate a stm32 debug with OpenOCD (without hardware)? if so, how?
I read somewhere that you can not do, for the simulation using qemu, but only for m3 stellaris, and not to those of the ST.
with a debug in ram you have the ability to have multiple breakpoints, but have never been able to debug in ram, even changing the ld script. Can you give me a hint?
It’s the process of working through the various stages of mind over matter principles.
Costs will have to include things like pre-surgical tests, surgeon’s fees and hospital fees.
If parents are capable of putting their own issues aside for the sake of their children, whatever setup the family ends up with after mediation in divorce will work.
I usually do not leave a leave a response, however I browsed a few responses on STM32 F4 Discovery tutorial uszing open source tools | Hackaday.
I actually do have 2 questions foor you if it’s okay.
Could it be only mme or does it look as iif like some
of the rsmarks come across aas if they are left by brain dead folks?
:-P And, if you are writing at other online social sites, I’d like to follow
everything fresh you have to post. Could you make a list oof all of alll your
shared sites like your linkedin profile, Facebook pave or
Please be kind and respectful to help make the comments section excellent. (Comment Policy)