So how do you even start working with STM32 without paying an arm and a leg? - Page 1
Forum section: electronics / general

author: technix
author_rank: Super Contributor
timestamp: August 06, 2016, 11:03:22 am
content: Here is the problem: I amtryingto move some of my projects to STM32. But despite my best efforts I can not set up a working development environment.I am NOT willing to touch Keil or IAR as those will cost me an arm, a leg and a kidney, each year. And the free offer with very little optimization and the 32k code size limit makes no sense to me as all dev kits I have found here have at least 64k flash space.So I am kind of stuck with GCC+OpenOCD stack using J-Link but what is the best IDE/toolchain combo? I tried the Eclipse-based SW4STM32 with and without Cube but it never worked for me - does not create projects under Linux and does not compile under Windows. On Linux I also have NetBeans (that have a working toolchain) but how to get STM32 libraries into there? (in fact I am more happy with GCC toolchain as I can swap out GCC itself for clang/LLVM and that compiler, being an open-source 100% drop-in replacement for GCC, have better optimization and faster compilation time than GCC, and shares a good portion of toolchain with it)On Windows, how can I hijack the arm-none-eabi-gcc packed with Atmel Studio for SW4STM32 (so it may build?)My J-Link is known to be good as it can SWD and JTAG program and debug ATSAM3X8E as implemented on Arduino Due.I have three workstations with three different operating systems: one running Linux (Ubuntu 16.04 LTS amd64 with soft real-time kernel,) one running Windows (Windows 10 amd64) and one MacBook Pro running macOS Sierra.

author: Dubbie
author_rank: Unknown
timestamp: August 06, 2016, 11:08:32 am
content: I really like visualGDB. The visual studio ide tools are really great to have and it works pretty seamlessly with all the arm chips I have tried so far.Sent from my phone using Tapatalk

author: JPortici
author_rank: Super Contributor
timestamp: August 06, 2016, 11:11:16 am
content: Trash it and move to NXP LPC

author: technix
author_rank: Super Contributor
timestamp: August 06, 2016, 11:23:45 am
content: Quote from: Dubbie on August 06, 2016, 11:08:32 amThen how do I get the STM32 dev kit to work there?

author: technix
author_rank: Super Contributor
timestamp: August 06, 2016, 11:29:23 am
content: Quote from: JPortici on August 06, 2016, 11:11:16 amThose chips are more pricey than the STM32s. I can get 48-pin STM32F103 for under one dollar each here from Shenzhen.In fact my two dev kits are both fairly cheap. The 48-pin STM32F103C8T one cost me two dollars and the 144-pin STM32F103ZET one cost me $15.

author: janoc
author_rank: Super Contributor
timestamp: August 06, 2016, 11:55:08 am
content: There are several threads on the forum about this, but documentation and examples are only a google away:E.g.:http://fun-tech.se/stm32/index.phphttp://vedder.se/2012/04/setup_arm_toolchain/If you don't want to use the lite Codesourcery toolchain (limited) and don't want to compile your own GCC-based one (not hard, but takes a while), there are plenty of precompiled ones available. E.g. here:https://launchpad.net/gcc-arm-embeddedYou will want a bare metal toolchain - i.e. arm-none-eabi, not arm-linux-eabi or something like that. Don't bother with Clang/llvm - the bare metal ARM toolchains are pretty much non-existent and unsupported. GCC is very much the industry standard.I have also posted how to use OpenOCD + GDB to debug, check my past posts.Re IDE - that depends, most people use Eclipse, the SW4ST is also Eclipse based. The second link above shows how to set Eclipse up as well.I am not sure what you mean by "getting the libraries in there". You just download them, build them using your toolchain (you may have to either add the files to your project, make a library project in Eclipse/Netbeans or prepare your own makefile) and use them as normal. It is normal C programming, nothing special there.I guess your post is more about how to use Netbeans/Eclipse than really ARM programming.

author: janoc
author_rank: Super Contributor
timestamp: August 06, 2016, 11:56:38 am
content: Quote from: JPortici on August 06, 2016, 11:11:16 amVery constructive and to the pointIf he doesn't know how to set up a toolchain and/or debugger, do you think that will be magically resolved by jumping to a different ARM vendor that uses the same tools? Fanboism is really unhelpful.

author: MT
author_rank: Super Contributor
timestamp: August 06, 2016, 12:01:17 pm
content: You download a copy of EMbitz/Blocks, load one of the user examples into your Discovery/Nucleo kit and off you go.

author: voltsandjolts
author_rank: Unknown
timestamp: August 06, 2016, 12:20:25 pm
content: If you stick to STM32L0 and F0 you can get the free unlimited Keil MDK.http://www2.keil.com/stmicroelectronics-stm32/mdk

author: andersm
author_rank: Super Contributor
timestamp: August 06, 2016, 01:10:00 pm
content: Quote from: technix on August 06, 2016, 11:03:22 amUse the ARM-maintainedGNU ARM embedded toolchain. If you really want to use an IDE, then theGNU ARM Eclipseplugin is among the easiest to set up. You can use its "packs" interface for downloading vendor support libraries if you need them. The same setup works on Windows, Linux, and OS X.QuoteWhat is the state of Clang for bare-metal development? Some time ago I saw that someone had managed to compile a hello world for a Cortex-M microcontroller, but their focus is still squarely on code running under a proper OS. Also, in most benchmarks GCC produces slightly better code. IIRC Clang is still a bit faster, but it has slowed down while GCC has sped up. Most of the Clang performance hype is based on Apple's claims, but their benchmarks were comparing their own, severely outdated GCC distribution against then-current versions of Clang.QuoteJust call the compiler binary?

author: rstofer
author_rank: Super Contributor
timestamp: August 06, 2016, 02:05:39 pm
content: Quote from: janoc on August 06, 2016, 11:56:38 amIf the LPC (or STM32 for that matter) happen to be mbed compatible, there is no toolchain to install and no platform specific issues either. Using the web based tools isn't the fastest toolchain but more time is spent typing than compiling by orders of magnitude.In most cases, it is better to create a Makefile based project and just have the IDE invoke 'make'. Whatever and whereever the tools and libraries may be, the Makefile deals with it. Even Microsoft Visual Studio will handle Makefile projects for non-Microsoft toolchains.I think the mbed compatible boards are going to cost a bit more than $2 - by an order of magnitude. Somehow, that has never been my concern. I'm only buying one, it doesn't matter what it costs.

author: zapta
author_rank: Super Contributor
timestamp: August 06, 2016, 03:08:40 pm
content: Quote from: janoc on August 06, 2016, 11:56:38 amLpcxpresso installation is very easy. A single package install that includes the tool chain and ide. Works on Linux, Mac and Windows. When I switched to arm (for hobby) I first tried STM and then moved to NXP because of the free tools.

author: nctnico
author_rank: Super Contributor
timestamp: August 06, 2016, 03:28:30 pm
content: Quote from: technix on August 06, 2016, 11:29:23 amBut look how far going for the cheapest option got you! The easy way out is to find some kind of free IDE + compiler package. LPCexpresso and mbed where already mentioned.

author: OZ1LQB
author_rank: Regular Contributor
timestamp: August 06, 2016, 03:42:28 pm
content: Hi.technix i use atollic it is free and works fine for meboth ide compile and debug

author: Tainer
author_rank: Contributor
timestamp: August 06, 2016, 03:47:08 pm
content: Quote from: technix on August 06, 2016, 11:03:22 amPretty much the same way you link any other libraries. I'm also using netbeans. The only thing I miss is a plugin to display and manipulate port/registers during debug. I switched to libopncm3 some time ago and since then never bothered with Cube and other ST rubbish.

author: veryevil
author_rank: Unknown
timestamp: August 06, 2016, 04:16:01 pm
content: I really rate Atollic as it's free and doesn't have code limit. Also based on eclipse so really easy to use

author: Skashkash
author_rank: Regular Contributor
timestamp: August 06, 2016, 04:24:58 pm
content: Another possible bundled eclipse/gcc/openocd/gdb option might be chibistudio.Sounds a little weird. But it is a complete arm dev setup. Lots of chibios and non stm32 examples are included by default. But you could just ignore all those.And if you ever wanted to experiment with an RTOS chibios has some pretty extensive stm32 support complete with hw drivers.https://sourceforge.net/projects/chibios/files/ChibiStudio/

author: JPortici
author_rank: Super Contributor
timestamp: August 06, 2016, 04:29:00 pm
content: Quote from: janoc on August 06, 2016, 11:56:38 amit is if you stop for a moment and think about it. NXP gives you its IDE which is a self cointaned custom eclipse installation with everything already inside it.so you just download, install and start coding.the HAL is also easier to read use and understand, to me at least, and it is also integrated in the MCU reference manual, unlike ST which has a number of different files scattered across the internet, everyone with unique information that you won't find in the other

author: Kilrah
author_rank: Unknown
timestamp: August 06, 2016, 04:33:44 pm
content: Do we really need an exact repeat of this thread every week?

author: westfw
author_rank: Super Contributor
timestamp: August 06, 2016, 11:00:20 pm
content: This seems like more of a "how do I get all the vendor libraries in appropriate places and come up with a standard scheme for organizing a project?", than the usual "where do I get a free compiler?" or "which IDE is "best?" questions we usually see.And it's complicated, which is a good reason that people spend $10k/year to own a "real" environment. (that's 1/10th the cost of your $100k star programmer, who otherwise might have spent 10% of their time maintaining the environment. (On the flip side, even pro environments are not "free" to maintain.))It might be easiest to install one of the "limited size" tools, and replace whatever component is limiting the size with an OSSW version that doesn't have the limit (gcc-ld?) That probably violates the license agreement, though...

author: ez24
author_rank: Super Contributor
timestamp: August 06, 2016, 11:23:53 pm
content: Quote from: Kilrah on August 06, 2016, 04:33:44 pmI think it would get a better audience if once a day.

author: aandrew
author_rank: Frequent Contributor
timestamp: August 07, 2016, 12:28:16 am
content: Quote from: JPortici on August 06, 2016, 11:11:16 amThis kind of comment is worse than useless. What exactly would an NXP ARM give him that an ST ARM wouldn't? He's asking for development environment help and by and large that is all completely agnostic to the specific "brand" of part used. ARM from NXP or ST or Freescale or Nuvoton or Cypress or *anyone* is pretty much the same when it comes to IDE.That all being off my chest now, I have always preferred the good old command line. vim or Sublime Text for my editor, and gdb (not graphical) for debugging. I've always ended up fighting more with the damned GUI tools than the problem at hand when I've had to use anything Eclipse based, and the various code generators such as Processor (cough)Expert or STM32CubeMX have always been poor at best.

author: nctnico
author_rank: Super Contributor
timestamp: August 07, 2016, 12:41:33 am
content: Quote from: aandrew on August 07, 2016, 12:28:16 amIF (big if ) you know how to setup the compiler, libraries, include files and (if you want) the debugger. At some point you need to know this anyway so it doesn't hurt to learn it from the start. But if you want a have a pre-packaged point&click environment to have a blinky running in 5 minutes then the pre-packaged systems vary between vendors and they all try to make it easy while keeping costs down (which ofcourse doesn't work).

author: zapta
author_rank: Super Contributor
timestamp: August 07, 2016, 01:25:05 am
content: Quote from: nctnico on August 07, 2016, 12:41:33 amEven if you know, releasing an open source project fit example that requires complex setup greatly reduces its accessibility.The difficulty and cost of setting the environment is one of the factors that affects project's value.

author: nctnico
author_rank: Super Contributor
timestamp: August 07, 2016, 02:30:41 am
content: Quote from: zapta on August 07, 2016, 01:25:05 amAs Rstofer wrote several times: A Makefile project is as universal as it gets and many IDEs 'import' these just fine.

author: zapta
author_rank: Super Contributor
timestamp: August 07, 2016, 03:00:28 am
content: Quote from: nctnico on August 07, 2016, 02:30:41 amI should try it one day. What I did in the past is having the ide running my manual make as an external tool.BTW, lpcxpresso also set the make files which allows also to build from command line, 'make all', etc

author: JPortici
author_rank: Super Contributor
timestamp: August 07, 2016, 04:36:18 am
content: Quote from: aandrew on August 07, 2016, 12:28:16 amAgain, NXP gives you a free of charge complete package that you have to download, install and go. which is what the OP probably wanted in the first place, as he is unable to set up a working environment.Maybe this is useless to you but to me it was just another thing that makes me prefer NXP LPC over ST and many others. (others are for example features per smaller package size, price for lower quantities, better documentation, less messier hal.. but damn i am repeating myself, again.)I don't have neither the time or the patience to set up the compiler and IDE and keep everything in balance because it breaks at every damn update

author: ez24
author_rank: Super Contributor
timestamp: August 07, 2016, 06:04:30 am
content: Quote from: blueskull on August 07, 2016, 02:25:16 amImageCraft also comes with a Nucleo board as part of their learning kit. I think the "learning" part is $100 (board, compiler, and book + $50 for their debugger)https://imagecraft.com/Also for the cost of a book and a Nucleo board this book explains how to set up a tool chain that works on all three OS systems, all free tools (but by my count 10 of them)https://leanpub.com/mastering-stm32(the 65% done is misleading - it currently is over 600 pages)But it depends on how much an arm and leg costs.Both authors told me that a STM32 is not suitable for a beginner to MCUs, but since you are not new, one of these might work (if your arm and leg is worth more than $150). Today I decided that one of my fingers was worth $100 and bought a new saw as not to loose one of them. Personally I would put the price of one of my arms and leg at over $1,000. And currently at 30 years, I think the lost of my leg has come to about 300k.So I would say the loss of an arm and leg would be worth 1/2 million, I do not think there are any solutions over 1/2 million. So in summary ALL solutions will not cost more than an arm and leg. I hope you do not amputate yours in the quest of a solution.

author: voltz
author_rank: Frequent Contributor
timestamp: August 07, 2016, 08:39:33 am
content: I went through the same cycle of trial and error to get a working 'free' environment. It is possible!Result was Eclipse STM Workbench. And Cube MX for internal pin arrangements.www.openstm32.orgHowever, its quirky and takes a bit to get CubeMX to actually do what you want. MX will produce startup code into a blank Workbench project but you can guarantee you need to dive in and make changes by hand. But in the end, the process works and you actually get to write 'your' source code and compile with success. No limits on flash sizes at all. And burn straight to Dev board (like a Disco f7).This is where i settled and its working with full debugging. Its possible, but definitely not plug and play.

author: balu
author_rank: Regular Contributor
timestamp: August 07, 2016, 08:52:23 am
content: Hello,I use the IDE TrueStudio from atolic for STM32 software development. You can get a free version of the tool without restrictions about code size. The tool based on Eclipse and can be used together with STM32CubeMX.http://timor.atollic.com/

author: Rolo
author_rank: Regular Contributor
timestamp: August 07, 2016, 10:38:36 am
content: You can take a look at stm32Duino, they are integrating the STM32 into the Arduino environment. Ok, not the best IDE but it gets you going, and you can use your own editor if you like. This does take some learning about bootloaders and STLink programmers but they use the cheap STM32 boards so no big startup costs. It's still work in progress but it works.Forum :=http://www.stm32duino.com/index.phpWiki :http://wiki.stm32duino.com/index.php?title=Main_Page

author: rstofer
author_rank: Super Contributor
timestamp: August 07, 2016, 03:05:32 pm
content: When I develop in a Linux environment where the command line tools are readily available, I often just use gedit for the editor and 'make'. No IDE, just a simple graphic editor and a directory (or directories) full of files.I'm not as fond of the Windows command line. Yes, I know I could set up the Windows command line versions of most tools or I could use Cygwin but for some reason, I don't.And never overlook the power of 'alias'. It can save a LOT of command line typing.

author: nctnico
author_rank: Super Contributor
timestamp: August 07, 2016, 03:32:15 pm
content: Quote from: zapta on August 07, 2016, 03:00:28 amYou don't have to do that. Eclipse for example can deal with make targets directly and even provide environment variables / make options so you can build a project which outputs various binaries from one source by clicking a specific build version. All the errors are also parsed so the source is annotated with the compiler errors (if Eclipse's realtime syntax checking didn't catch them already).

author: zapta
author_rank: Super Contributor
timestamp: August 07, 2016, 06:03:06 pm
content: Quote from: nctnico on August 07, 2016, 03:32:15 pmAre you talking about make files that are generated automatically by eclipse (as lpcxpresso does) or arbitrary manually written make files that are parsed by eclipse?I used the IDE parsing of output errors file and line numbers but I think you are talking here about the IDE actually understanding the make files themselves.

author: nctnico
author_rank: Super Contributor
timestamp: August 07, 2016, 06:10:31 pm
content: No, Eclipse just calls make with the options you provide and then parses whatever the make/compilation process spits out using a so called error parser (ofcourse the error parser used by Eclipse needs to understand the toolchain's output).

author: zapta
author_rank: Super Contributor
timestamp: August 07, 2016, 06:32:25 pm
content: Quote from: nctnico on August 07, 2016, 06:10:31 pmOK, this is the external build mode, nothing to do with makefile, your script can build any way you like, with our without a make file. The IDE just parses the error lines. Done that with slickedit and GCC.

author: richardman
author_rank: Frequent Contributor
timestamp: August 07, 2016, 08:03:54 pm
content: Quote from: blueskull on August 07, 2016, 02:25:16 amNote that non-commercial use license for the compiler/IDE is only $50. -NC debugger (it's optional) is another $50.

author: ez24
author_rank: Super Contributor
timestamp: August 07, 2016, 11:52:42 pm
content: Quote from: richardman on August 07, 2016, 08:03:54 pmDon't forget about your Nucleo and book. As a dumb ass, I have "looked" at a lot of development boards and in my opinion the Nucleo is the best because of : STM32, linker built in and breakable off, Arduino shield compatible, USB (not serial nor parallel), not JTAG, and recently new. You do not need external devices to plug into it to program it. So for an non user, the STM32 looks the best because they have the best development board and dirt cheap (less than an arm and leg)But in my case I am too dumb to use it and there no books or courses designed for it for real beginners. Both books say ok for beginners but both authors confess they mean new to STM32 not MCUs. The OP seems not new to MCUs so my (dumb) suggestion is go with 1. Imagecraft or 2. Mastering STM32 (I made it through Chap 3 by installing 10 programs to blink an LED). But I am looking at some of the suggestions in this topic but I keep going back to No. 1 because of support.It is not clear to me that the OP wants to use an STM32 for commercial use?

author: westfw
author_rank: Super Contributor
timestamp: August 08, 2016, 09:29:28 am
content: You know, the real answer is that if you're STARTING, then you should probably just put up with the free development environments from the specific vendor (or various other places), even if they are code-size or optimization limited. When you actually start to run into the limits of the environment, you can make another decision about whether to pay for the next step up, or go looking for something else. But by then, you won't be so much of a beginner, and you'll have better ideas about what you want or don't need, how the build process works and how vendor libraries get sucked in, and you'll have a least one example of how projects are organized...

author: MosherIV
author_rank: Super Contributor
timestamp: August 08, 2016, 03:34:40 pm
content: QuoteNo necessarily.I agree with westfw. IF they are an ABSOLUTE BEGINNER then it is easier to use the commercial tools because they (mostly) just work with out any fiddling around with setup. That is what an complete newbie needs - something to just get started, not having to learn how to configure the tool, that is a side distraction.When they have learned more about the target (and host system), then they are in a better place to start to figure out how to configure the free stuff.Just my thoughts

author: dannyf
author_rank: Super Contributor
timestamp: August 08, 2016, 03:45:00 pm
content: If the code size limits or optimization limits aren't binding for an application, are they really "limits"?This " I don't want to use X because of limits" thinking is weird to me.

author: dannyf
author_rank: Super Contributor
timestamp: August 08, 2016, 03:52:41 pm
content: Setting up an ide is highly similar, from one to another.So I really don't understand the struggles so many people seem to have.

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: August 08, 2016, 03:53:11 pm
content: I second the posters who recommend Eclipse with the CDT and ARM add-ons. I put together a set of detailed instructions--if anyone's interested, PM me and I'll send you a copy.

author: MosherIV
author_rank: Super Contributor
timestamp: August 08, 2016, 04:16:57 pm
content: QuoteI do not remember that the OP mentioned that they are skilled in engineering. If they are OK at setting up a tool chain, why are they complaining on behalf of beginners?Why spend money on tools?Someone needs to support the software tools industry, even if it is only other professionals.If every body just wants free software, there will be NO software industry. There will be fewer development tools, pushing the boundaries and the world would be a little worse off (in my opinion).Commercial tools are not aimed at everybody, they are marketed for professional use and professional/corporate users in tern support them.They must be better in some way than the free alternative or companies would not spend money on them!If I remember correctly the OP was about why you have to spend so much money in order to get started on STM32.The answer is you do not have to, there are free alternatives.There are expensive paid alternatives.Take your pick.As a professional embedded SW developer, if I am asked to teach someone about say STM32 development, I am not going to start teaching them about free tools that take time to install and configure, I am going to start with the fastest and easiest tool that gets them going. From my point of view that is the commercial IDEs because they just work out of the box.(This is just my opinion - like it or not)Is Atollic free?The last time I checked (which was a long time ago) they too had a size limit for their free version.Incidentally, Atollic is the stupid Eclipse based IDE that got me hating Eclipse. Such a bloody awful debugger.

author: dannyf
author_rank: Super Contributor
timestamp: August 08, 2016, 04:25:57 pm
content: I agree with the above view.One has to figure out what ones goal is. If the goal is to learn about the chips at low cost, start with the free but limited commercial ones: they allow you to focus on the learning chip part.If the goal is about saving money, go after the free tools.I make a living off of my tools and I simply cannot afford to have them not working for me.On the flip side, if you have lots of time dicking around, try those free tools.

author: Kilrah
author_rank: Unknown
timestamp: August 08, 2016, 05:11:44 pm
content: Quote from: MosherIV on August 08, 2016, 04:16:57 pmAtollic is free without limits (only advanced features way beyond "beginner" scope e.g. code analysis, advanced debugging require upgrade), comes with tons of examples for many boards, and you can get one running with debug in a couple of minutes and a few clicks...

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: August 08, 2016, 05:43:37 pm
content: Quote from: Kilrah on August 08, 2016, 05:11:44 pmAtollic may be free, but it's as slow as molasses in January and very frustrating to use for debugging. I used to think that Eclipse itself (which Atollic is based on) was slow, but that's not the case. It was only after building my own Eclipse-based development environment starting with the bare-bones Eclipse that I found that it's really fast at debugging. What I don't understand is how a company selling a commercial tool based on Eclipse could have effed it up so badly. And Atollic isn't the only one--I've used several other commercial Eclipse-based tools that remind me of sloths.

author: Kilrah
author_rank: Unknown
timestamp: August 08, 2016, 05:58:54 pm
content: Again that's out of scope, a beginner doesn't need the best, fastest and most convenient tools, he needs some that allow him to get to do something pretty easily, and a chance to try out the various tools that exist, figure out what they do and how they work. It fits that bill pretty well.Same as on the hardware side a beginner is advised to get a basic pretty cheap scope that may not be the fastest, best nor do everything but will do the job of teaching him how it works and do allow him to work on a few projects, not a high end $15k beast.The most confusing bit about "how to start on ARM" isn't the lack of easy nor free tools, it's people who keep making it impossible for people to find a starting point by endlessly debating tons of detailsnone of which actually matter in the poor beginner's situation.

author: andersm
author_rank: Super Contributor
timestamp: August 08, 2016, 06:10:09 pm
content: Quote from: MosherIV on August 08, 2016, 04:16:57 pmARM is one of the major funders of the GCC port, so you're supporting its development every time you buy an ARM device.

author: MosherIV
author_rank: Super Contributor
timestamp: August 08, 2016, 07:22:58 pm
content: QuoteHave you tried to raise a bug or support issue with ARM ?One of the most insiduous issues facing the software industry is the apparent lack of value associated with software. The fact that it is non physical and easy to copy makes it all too easy to dismiss its value. The large amount of free software helps to diminish the value of maintaining teams of people developing and maintaining software. ARM's primary focus is on selling cpu cores via licensing NOT developing software. They do it as a necessary support in order to maintain sales.

author: andersm
author_rank: Super Contributor
timestamp: August 08, 2016, 07:38:56 pm
content: Quote from: MosherIV on August 08, 2016, 07:22:58 pmNo, but I have filed several bug reports with the GCC project, where it's seen by the people doing the actual development work.QuotePrecisely. ARM have realized their products are useless without software to run on them, which is why they're investing so much in tool support.

author: BurnedResistor
author_rank: Regular Contributor
timestamp: August 08, 2016, 09:38:27 pm
content: If you are gonna go the Eclipse ARM GNU/OpenOCD route, by the far the best guide for getting up and running I have come across was this:https://leanpub.com/mastering-stm32The free sample includes a complete tutorial on how to setup the toolchain start to finish.I highly recommend you go an buy the book however.It walks you through using more advanced features like semihosting,explains the stm32cube HAL,explains how to integrate the cube mx software with the whole toolchain,etcIt is a really great resource, plus if you google the authors name you will find his website where there is similar info on the topic!It might be strange to buy an unfinished book, but you receive any new chapters as they come out. Besides what is there is already easily worth the twenty bucks the thing is gonna cost you.Anyway, I highly recommend it

author: ez24
author_rank: Super Contributor
timestamp: August 08, 2016, 09:42:07 pm
content: Quote from: BurnedResistor on August 08, 2016, 09:38:27 pmMe too

author: Kilrah
author_rank: Unknown
timestamp: August 08, 2016, 11:15:48 pm
content: Quote from: MosherIV on August 08, 2016, 07:22:58 pmYou've managed to say in the same paragraph that software's lack of apparent value makes it hard to fund, and prove the opposite by giving an example of a company whose core business isn't software but who can both recognise its value and fund its development. Congrats...

author: OZ1LQB
author_rank: Regular Contributor
timestamp: August 08, 2016, 11:20:15 pm
content: Hi..As others have said get the Mastering STM32 book..i have only had it for a day and it have helped me understand a few thingsi had problems understanding before i got it. is well worth its price

author: nctnico
author_rank: Super Contributor
timestamp: August 09, 2016, 10:22:01 am
content: Quote from: Kilrah on August 08, 2016, 11:15:48 pmI could not have put it better.Open source software isn't free but a collaborated effort to create a piece of software the individual parties cannot fund alone. In case of GCC ARM builds on the foundations made by others so they don't have to start from scratch.

author: jnshadow
author_rank: Newbie
timestamp: August 11, 2016, 12:26:37 pm
content: Ok, so back to the OP -- I too advocate using Eclipse for hobbyist stuff; if you are working a startup or plan to eventually sell what you build, then you can gain efficiencies from the infrastructure of product testing, standardized training, software configuration management, etc. from the for-fee pro development tool kits.It is the same as building a shed -- it's one thing to do it on a weekend with your tools one time; it's a whole different thing to do it professionally over and over again at multiple sites and different weather conditions to put food on the table for your family.

author: nctnico
author_rank: Super Contributor
timestamp: August 11, 2016, 06:30:02 pm
content: @jnshadow: you clearly overlooked the fact the Eclipse has been made to do just that: large scale software development. The regular IDEs fall very short when it comes to actually managing code (versioning system integration for example).

author: Rithers
author_rank: Newbie
timestamp: August 12, 2016, 10:46:05 pm
content: https://leanpub.com/mastering-stm32wow what a great book. The ocean of information out there (the documents on ST's website alone!) makes it very difficult to get started,what a pleasure to have something laid out step-by-step in such great detail.for those willing to switch boards for ARM, Ive been taking the "Embedded Systems: Shape the world" course:https://www.edx.org/course/embedded-systems-shape-world-utaustinx-ut-6-03xWhich uses the T.I. Launchpad TM4C123 and Keil uVision for their labs. A time commitment for sure, but they go into all the details.As a result of that course I am most "at home" working with a Texas Instruments chip, however ST's bells&whistles, coupled with their verysexy graphic design team, keep me going back for more in spite of their wormhole of documentation./etienne

author: westfw
author_rank: Super Contributor
timestamp: August 13, 2016, 12:45:45 am
content: QuoteYes - it's a good course. They do fairly generic bare-metal ARM programming, rather than relying on vendor libraries, so it's worth looking at even if you have little interest in TI MCUs.

author: jnshadow
author_rank: Newbie
timestamp: August 13, 2016, 01:12:09 am
content: @nctnico -- agree, Eclipse has gotten very capable over time.

author: parasole
author_rank: Contributor
timestamp: August 14, 2016, 10:20:54 am
content: Quote from: ez24 on August 08, 2016, 09:42:07 pmConfirm, I did setup the tool-chain in half an hour by following the book, it is awesome!

author: dannyf
author_rank: Super Contributor
timestamp: August 14, 2016, 01:08:27 pm
content: I wrote a series of "getting started on ..." blog posts and quite a few touch on the Cortex-M chips across a wide spectrum of vendors and toolchains.Most of those take 10 - 20 steps to finish, some far less.Setting up a project in an IDE is a simple task and surprisingly similar across tool chains. It always amazes me that people could struggle on something like that.

author: ez24
author_rank: Super Contributor
timestamp: August 14, 2016, 06:39:54 pm
content: Quote from: parasole on August 14, 2016, 10:20:54 amIt took me a week(too many dead brain cells) and the wrong LED blinked, the power LED (suppose to be impossible)

author: janoc
author_rank: Super Contributor
timestamp: August 14, 2016, 09:21:44 pm
content: Quote from: ez24 on August 14, 2016, 06:39:54 pmAre you sure you didn't look at the ST-Link LEDs? Those do blink when the device is communicating with OpenOCD (for example).Otherwise, one can certainly make the power LED blink too with a bit of hardware prep - by shorting the power supply with an MCU pin. That will trigger reset and thus make it "blink". Not a recommended way to implement a blinky LED, though!

author: krish2487
author_rank: Frequent Contributor
timestamp: August 15, 2016, 10:29:01 am
content: @opAs someone who was in your shoes a couple of months ago, I totally sympathise with you.Just my 2cents, try platformio. It pretty much takes the pain out of setting up any toolchain. Works off gcc and has support for mbed, CMSIS, SPL and opencm3. Oh and has support for a variety of boards and manufacturers.I d suggest you go with openCM3 for the library support. Pretty easy to use for a beginner. It pretty much plug and play. and quite a lot of examples floating around.PS: I am not affiliated to platformio in anyway. Just had a good experience and trying to share them with the people here. :-)

author: Scrts
author_rank: Frequent Contributor
timestamp: August 15, 2016, 07:25:28 pm
content: Did anyone try this:http://www.openstm32.org?

author: janoc
author_rank: Super Contributor
timestamp: August 17, 2016, 06:02:06 pm
content: Quote from: krish2487 on August 15, 2016, 10:29:01 amDoes Platformio support libopencm3 now? I didn't the last I have checked (but they supported ChibiOS). I don't like their "automagic" SCons based build system though - it makes it messy to integrate external libs or tools.Otherwise, libopencm3 is very good, indeed. Just be careful about some limitations - e.g. no I2C support on F0 series (there is a pending patch), some hw support is incomplete, etc. Also the documentation could be better - you often have to "reverse engineer" how to do certain things from the examples and tests, there is very little documentation. However, it is a good starting point - e.g. bringing up an USB device from scratch using libopencm3 has been the least painful I have seen so far and that even doesn't use an RTOS. It just worked. And code size tends to be a lot smaller than STDPeriph or HAL.

author: janoc
author_rank: Super Contributor
timestamp: August 17, 2016, 06:16:17 pm
content: Quote from: Scrts on August 15, 2016, 07:25:28 pmThat is ST's site for their System Workbench (SWSTM32). It is basically Eclipse + plugins to support ARM and ST's micros, using GCC as compiler, targeting their Cube/HAL ecosystem. It works, but it isn't really any different from using Eclipse + GNU Arm plugins and GCC.

author: mpavlov
author_rank: Contributor
timestamp: August 18, 2016, 06:50:57 pm
content: Two free IDEsI have tried bothhttp://www.emblocks.org/Very easy to start, support ST-Link and J-Linkhttp://www.coocox.org/you have to install gcc toolchain for yourselfbut works fine also

author: dannyf
author_rank: Super Contributor
timestamp: August 18, 2016, 08:38:56 pm
content: Emblocks and coide (1.x) are my favorite ides.

author: Miyuki
author_rank: Frequent Contributor
timestamp: August 18, 2016, 09:27:51 pm
content: Hi I want to askHave someone experience with built in bootloader over UART and use with simple USB to 3.3V UART adapter ?Does it work fine? Have it any limitations ?

author: dannyf
author_rank: Super Contributor
timestamp: August 18, 2016, 09:54:00 pm
content: I have used with stm32f0. Fairly straight forward but does need a little bit of manual intervention for the boot pin and reset pin. If you go through the ghetto thread you may find more detailsA better approach is to find one with USB bootloader's. Nucleo and some NXP boards support that. I used a lpcxprrsso 1769 board to experiment back when it was introduced.So the message is 1. It works 2. Not the best or the most convenient solution.

author: Miyuki
author_rank: Frequent Contributor
timestamp: August 19, 2016, 10:19:55 am
content: I want it to flash own board without other interface I think I can live without debug interface

author: krish2487
author_rank: Frequent Contributor
timestamp: August 21, 2016, 11:47:47 am
content: I am sorry for delay in response, thank you for the heads up regarding the incomplete libraries. :-)It does support openCM3 now, and they have recently introduced platformio 3 which adds support for unit testing :-)However, try as I might, I am unable to get it to work.. :-(. Maybe one of these days when I am sufficiently free though...You are right though, I did have to reverse engineer some examples to start coding and understanding them.The team is fairly prompt in responding to the queries posted on the forum and helpful.Quote from: janoc on August 18, 2016, 04:02:06 AM

author: Klaas
author_rank: Newbie
timestamp: October 16, 2016, 06:40:20 pm
content: EmBitz is the only free IDE which supports live variables and out-of-the-box experience with STM32. It's much faster than any Eclipse based IDE.Nice article on this forum:https://www.eevblog.com/forum/microcontrollers/inexpensive-arm-development-tools/Download:http://www.emblocks.org/web/downloads-main

author: rstofer
author_rank: Super Contributor
timestamp: October 16, 2016, 09:33:40 pm
content: I bought the book "Mastering STM32" and set up the toolchain using the instructions given. In the end, this would include Eclipse Neon gcc-arm and OpenOCD. I also have STM32 ST-Link and ST32F Cube. Excellent instructions!i would rather have the projects folder outside the C:\STM32Toolchain directory but there is no compelling reason.Here's what I enjoy: Yes I can build STM32F projects immediately after installing the toolchain. Then I can install enough of cygwin64 to get the x86 version of gcc as well as gfortran. If I wanted to, I could also work with python and java in the same environment. In the end, ALL of my code development uses the same IDE. All of my projects are in the same directory tree and I don't have to go hunting for stuff. In years gone by, I used Eclipse to write code for AVRs but the new version, Neon, is FAR superior to what it used to be. The plug-ins really work!It escapes me how an IDE can be considered 'slow'. Yes, Eclipse takes a bit to load, all java programs are slow loaders. But once it is loaded (what, ten seconds, once a day?), the rest of the time it spends waiting on a slow typist. In terms of compile speed and that kind of thing, well, that's up to the toolchain, not the IDE.I also like the fact that Eclipse builds the Makefiles and handles the dependencies. In terms of Fortran, I just code and go, the IDE and toolchain take care of all of the details.One IDE for everything!This is an old thread, I am pretty sure I discussed the Mastering ST32 book above somewhere. TL;DR

author: nctnico
author_rank: Super Contributor
timestamp: October 16, 2016, 09:39:07 pm
content: I tried Eclipse Neon but on Linux is causes screen artefacts and it won't build existing projects properly on Windows so I'll wait for the next version.

author: rstofer
author_rank: Super Contributor
timestamp: October 16, 2016, 10:19:18 pm
content: Quote from: nctnico on October 16, 2016, 09:39:07 pmIn case I bring over some older Makefile projects, what exactly goes wrong with Windows projects? The biggest problem I have had is when the toolchain or libraries are moved.I have only been using Neon for a few weeks but, so far, I like it a lot.What I don't want to do is have several IDEs. I am still using Visual Studio and, since it will build Makefile projects, I could just stay there. But it's even slower to load than Neon!Under Linux, I don't tend to use an IDE. I use gedit to create the source and 'make' to build the output. I haven't tried this with mbed like boards but it worked well when working with older ARMs (LPC2148, LPC2106) and the AVRs. But that's because there were download programs callable from the Makefile. I haven't looked into this lately.

author: janoc
author_rank: Super Contributor
timestamp: October 16, 2016, 11:42:45 pm
content: Quote from: nctnico on October 16, 2016, 09:39:07 pmFor me Neon works fine in Linux. Graphics driver issues? I have an Nvidia GPU, so no problem, but I can imagine Intel/AMD users may not be that lucky.I had Eclipse also sometimes conflict with the desktop effects (compositor) - if you have transparent/wobbly windows on, try to disable compositing. That often cures these issues.

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: October 17, 2016, 04:23:35 pm
content: Neon works okay in Windows, but I've reverted back to Mars because EmbSysRegView doesn't work in Neon.

author: antonc
author_rank: Newbie
timestamp: October 17, 2016, 05:14:18 pm
content: Personally I started with a Nucleo dev board to get the hang of the hardware, then snapped off the ST-link bit, and now use that as a programmer/debugger with my own boards. (Yes, I'm a cheap bastard).After too many years of stuffing around with Linux, I now use Mac OS (Yosemite, after El Capitan broke everything USB), and OpenOCD for debugging. No IDE, 'cause I'm also an old school command line type of person, so Makefiles, Xcode (for the editor only) and a number of scripts. Oh, and I'm using ChibiOS, primarily for the hardware abstraction layer. Makes life soooo much easier. [Woops. Edit. forgot the other stuff] GCC toolchain.

author: technix
author_rank: Super Contributor
timestamp: October 17, 2016, 05:59:46 pm
content: Quote from: antonc on October 17, 2016, 05:14:18 pmI never bothered to set up the toolchain on macOS (I am running Sierra - I pay Apple 100 bucks a year for Apple Developer Program, and to me that was money well spent as I do have a few iOS apps hanging on the App Store) but from what I know the default toolchain came with Xcode can build code for Cortex-M (Apple themselves are using NXP LPC1800 after all.) My MacBook Pro is suffering from extremely limited RAM space.

author: ralphrmartin
author_rank: Frequent Contributor
timestamp: October 17, 2016, 08:17:20 pm
content: mbed + GCC

author: martinayotte
author_rank: Regular Contributor
timestamp: October 18, 2016, 04:15:46 pm
content: http://www.stm32duino.com/

author: rob42
author_rank: Newbie
timestamp: November 02, 2016, 10:40:45 am
content: I use standard Eclipse with CDT plugin and official ARM-GCC toolchain for STM32, and AVR-GCC for AVR, all under Linux.No hardware debugging (just pin/LED toggle, LCD/LED indicator or USART logging depending on available hardware).Flashing via stm32flash/avrdude.Everything works ok, all hardware costs me 3$ for USB-RS232 + USBASP, and 5$ for STM32F030 dev.board + Arduino-Nano/Mini.