What do you think of this STM32 toolchain - 10 software installations ? - Page 1
Forum section: electronics / general

author: ez24
author_rank: Super Contributor
timestamp: July 21, 2016, 12:05:23 am
content: Here is the toolchain that I am (was) trying to get an STM32F401 Nucleo board to blink LED2 in order of installation (from a book):1. Eclipse2. Ecliipe CDT3. GNU ARM4. ARM GCC5. Build Tools6. OpenOCD7. STM32CubeMX8. ST-LINK Utility9. Nucleo Drivers10. ST-LINK Firmware UpgradeAfter several attempts over weeks, I got pass Step 10 and was able to Build Project the blink demo without errors and the wrong LED blinked. It was suppose to be LED2 but LED1 blinked (the ports in the code are correct per the book). So I am at an end with this toolchain. It is just too complicated. (LED2 blinked before I tried and not since then)Are there any low cost (~$100 or less) Windows based solutions (IDE) for a beginner to learn the Nucleo? If not the Nucleo, what are some other boards that have tools for beginners? In the meantime I will study Dave's video and forum comments on the Discovery. But I want to exhaust all attempts to use the Nucleo. I really like the design of the Nucleo (Arduino shield connectors).Also in the meantime I am studying the IDEs recommended by ST for the Nucleo: (my guess not for beginners)http://www.st.com/content/ccc/resource/technical/document/user_manual/1b/03/1b/b4/88/20/4e/cd/DM00105928.pdf/files/DM00105928.pdf/jcr:content/translations/en.DM00105928.pdfWhich are:- EWARM- MDK-ARM- TrueSTUDIO- SW4STM32(reads like a list of bug sprays)But there is no "Dummies for Nucleo". What I need is "learning" tutorials that come with the IDE or available somewhere. I cannot just jump in and go.thanks

author: ataradov
author_rank: Super Contributor
timestamp: July 21, 2016, 12:11:38 am
content: Your toolchain did the job, you have LED blinking. The fact that the wrong one is blinking is a problem with the program, not the toolchain.The same program compiled with anything else will behave the same exact way.

author: rstofer
author_rank: Super Contributor
timestamp: July 21, 2016, 12:24:56 am
content: You have the right toolchain and TrueStudio appears to be the proper selection although I don't know that it matters. In any event, what you have mirrors what I am using and it works fine.If your board is mbed compatible, you can use the online compiler via mbed.org. Sign up and go for it. This assumes that your board is in this list:https://www.mbed.com/en/development/hardware/boards/If so, there is (was?) a small html file on the board that would help you set up an account based on ownership of the board. It usually shows up as a .htm file when your board is connected to your PC and looks like a disk drive.As mentioned, the fact that you have one LED blinking means that everything is working except for a misunderstanding re: which GPIO connects to which LED. Check out the schematics - they are the only definitive source of information.

author: dannyf
author_rank: Super Contributor
timestamp: July 21, 2016, 12:29:37 am
content: I wrote quite a few "getting started on ..." series of posts, some for STM32 chips on my blog.You are making your life unnecessarily complicated.

author: MT
author_rank: Super Contributor
timestamp: July 21, 2016, 12:46:14 am
content: You dont need dummies for nucleo onlyEmblocks.

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: July 21, 2016, 01:05:26 am
content: Here's my advice. Keep items 1-5 in your list. Replace #6 with a Segger J-Link. Dump items 7-10.The Eclipse/CDT/J-link tool chain is all you need to so serious, professional-level development work on ARM processors. It's all free except for the J-Link, and that's only $60 if you are not doing commercial work.

author: richardman
author_rank: Frequent Contributor
timestamp: July 21, 2016, 01:46:59 am
content: Contacted you via PM.

author: ebclr
author_rank: Super Contributor
timestamp: July 21, 2016, 04:06:03 am
content: For guys with lazy research skillsTry energia and TIVAhttp://www.ti.com/ww/en/launchpad/launchpads-connected-ek-tm4c123gxl.html#tabshttp://www.ti.com/ww/en/launchpad/software.html#tabs

author: MosherIV
author_rank: Super Contributor
timestamp: July 21, 2016, 06:52:02 am
content: Pretty much most professionals I have talked always go for IAR, it just WORKS no matter which debugger, that is supported, is used ie ST-link or J-link.There is a free version for evaluation which is size (32K) limited.I am planning on giving em:blocks a go when I hit he 32K limit with IAR for home projects.As a professional programmer I have usedAtollic TrueStudioFreescale CodeWorrierHated them all ! They were slow, cumbersome and when debugging would randomly lock up while single stepping, giving me no confidence in whether it was the microcontroller or the debug programThats why I advise people to aviod Eclipse based solutions.

author: hans
author_rank: Super Contributor
timestamp: July 21, 2016, 07:49:29 am
content: In contrary what TS may think, said list of toolchains are by far the easier way to start embedded development. Especially if you're an experienced embedded programmer/guru, setting up your own toolchain, dependencies, drivers, build/link scripts, Eclipse configuration, etc. is very cumbersome like you experienced. Personally I wouldn't even think about doing such a thing on Windows, I rather spin up a (X)Ubuntu VM and enjoy "apt-get install" commands for probably 60% of said tools (plus some tools on the list can also be diminished).One side of me saddens that a (beginners) book tries to drag you through this. If anything for a beginner, toolchains should just work so you can dive into coding and build your needs from there. Look at why Arduino is so successful; albeit their toolchain lacks functionality for the seasoned programmer.The moral side of the story though is probably that a book doesn't want to "advertise" the use of commercial software, and perhaps want to keep options open to Mac and Linux users.

author: ebclr
author_rank: Super Contributor
timestamp: July 21, 2016, 08:08:18 am
content: You can develop without installing nothing, itá avaILABLE several "cloud based" develOpment tools, like mbed and Ti Composer or energia , and all work's pretty well

author: FreddyVictor
author_rank: Regular Contributor
timestamp: July 21, 2016, 09:28:41 am
content: @OP, as already mentioned, you've made life difficult by your choice of toolsalready mentioned by MT (and by me on other threads) Em:Blocks (or Em:Bitz as it has changed into)there will always be a few curved balls getting it up and running tho'FYI: according toNucleo User manualdoc:Three LEDs– USB communication (LD1), user LED (LD2), power LED (LD3)so you cannot actually flash LD1 as that is connected to the ST-Link uC (STM32F103) chipit simply indicates the ST-Link status

author: newbrain
author_rank: Super Contributor
timestamp: July 21, 2016, 09:34:26 am
content: Quote from: ez24 on July 21, 2016, 12:05:23 amWhen you say that LD1 is blinking, do you mean the red/green one (according to Nucleo's schematics)?In that case your code is not working (that led is only a USB comm indicator), either due to a SW error or because it was not (correctly) downloaded to the board. LD1 should actually stop blinking once the code is loaded (not 100%, it will go on blinking when debugging, for example)You should check both your code (against the Nucleo Manual) and the OpenOCD (and gdb?) logs.I would say the closest thing to a Nucleo for Dummies is the mbed environment (similar to Arduino...), albeit I have not used since a long time. It was easy to set up a board (the one you have BTW) and do "blinky"/serial stuff.For tutorials the only real options is to use your google-fu, there are quite a lot of examples on the web.Since it seems you are using the HAL, a good source of code is Cube SW itself (the libs, not the MX code generator): there are example and demos to study and understand.Understanding the architecture and peripherals, even when using an abstraction layer, cannot do away with studying the MCU documentation (for STM32s that would be: Datasheet, Reference, Errata, possibly also Programmers' manual), a nice bedside reading...SW4STM32 is more or less the same toolchain you installed (Eclipse, GCC, OpenOCD), but pre-packaged, IME it worked OK and it's free, the other ones are a bit out of reach for an hobbyist in their unlimited versions.If you really want to spend money in the $100 range, I usevisualgdb(there's a 30 days trial), it's a very good integration of GCC, OpenOCD and other SW with Visual Studio (which is free for the Community edition), it supports most HW debuggers, most Cortex M ARMs and some other MCUs (there are other version for other platforms, though).I started originally with CoIde, but I had frequent crashes and no support for more recent MCUs, moved onto SW4STM32, but now I settled mostly on VisualGDB.

author: ebclr
author_rank: Super Contributor
timestamp: July 21, 2016, 09:47:11 am
content: What is the exactly Nucleo board you are talking about, I will make that Led flash

author: blackbird
author_rank: Regular Contributor
timestamp: July 21, 2016, 02:39:03 pm
content: Ez24, you could skip most of the steps you took by installing SW4STM32. This is a complete software development suite based on Eclipse for the STM32 series. Made by Ac6 and distributed via ST.I've used IAR and Keil but now I'm switched to SW4STM32 in combination with STM32CubeMX (for when I need it).I could recommend this, you can install it on Windows, Linux and even MacOSX.One big advantage, you are not limited to the 32kb code size, a limit present in IAR and Keil when using the free license.

author: jnz
author_rank: Frequent Contributor
timestamp: July 21, 2016, 05:50:00 pm
content: I enjoy that Keil MDK has made it so I can just sit down on any of my machines and get work done, so I can ship product.I sometimes am stunned at the time and patience hobbyists have.

author: blackbird
author_rank: Regular Contributor
timestamp: July 21, 2016, 06:09:08 pm
content: Quote from: jnz on July 21, 2016, 05:50:00 pmFor hobbyists it is not always affordable to buy a license for products like IAR. Especially when you want to go beyond the 32kb limit. Besides this, IAR and Keil are Windows-only suites and a lot of hobbyists use Linux.

author: bingo600
author_rank: Super Contributor
timestamp: July 21, 2016, 07:10:22 pm
content: I installed Eclipse Mars & the SW4STM plugin , worked 100% , even debugging with the cheap st-link clone.It install all needed stuff , compiler etc.For a first timer , i might suggest the full sw4stm where everything is bundled in a package (even the eclipse)/Bingo

author: XFDDesign
author_rank: Frequent Contributor
timestamp: July 21, 2016, 07:33:56 pm
content: On the plus side, that you could get that mess of a toolchain working, you can now do other people's taxes and manage IRS audits with almost boring ease.

author: ez24
author_rank: Super Contributor
timestamp: July 21, 2016, 07:49:15 pm
content: Quote from: hans on July 21, 2016, 07:49:29 amNO !Sorry I did not make it clear - the book is not a beginners book. The author made that very clear from the beginning. The reason I bought the book was it was not expensive, it was PDF (so easy to make notes), and used free software. I knew before I started that free would probably be hard. You get what you pay for. It is a good book, the problem is me. I got through 10 installations with only one minor problem that was not my fault. I think this pretty good.

author: rstofer
author_rank: Super Contributor
timestamp: July 21, 2016, 08:05:25 pm
content: Quote from: MosherIV on July 21, 2016, 06:52:02 amSo I sat down this morning to catch up with mbed.org's EthernetIinterface. The new stack (newer than the stack I used 5 years ago) is somehow woven around RTOS but I haven't checked it all out yet. Nevertheless, that stack works fine and I have plans for the RTOS.But a minimum TCP server connection uses up about 60k of code. So, right out of the gate, if IAR even had a free, full, Ethernet stack and RTOS, I am over the code limit. And I haven't even started!Being retired and all, FREE works better for me! I had no problem at all installing the Eclipse/CDT/GNUARM toolchain. Everything fits together nicely. But since I am playing with the mbed board, I'm using the online toolchain today.

author: ez24
author_rank: Super Contributor
timestamp: July 21, 2016, 08:13:44 pm
content: Quote from: ebclr on July 21, 2016, 09:47:11 amF401REwith the following changes to blinkled.h19 #define BLINK_PORT_NUMBER (0)20 #define BLINK_PIN_NUMBER (5)Note: the changes were not at line 19 but I think 21I played around with the port numbers for awhile with no luckThe board comes with LED2 blinking (this is documented on the package). Now LED2 does not light up at all. LED1 I think is the COM port LED. It comes on in RED when plugged in, when I run the sample, LED1 blinks LED3 comes on in RED and stays that waythanks

author: ez24
author_rank: Super Contributor
timestamp: July 21, 2016, 08:50:30 pm
content: The author suggested that I useSystem Workbench for STM32 --> SW4STM32 toolchainhttp://www.openstm32.org/System+Workbench+for+STM32And try to continue with the next chapter.So that is my next stepEdit - Does anyone know why such a registration requirement. I had to enter my address and phone number. Are they going to sell it to support the site? Or call me and tell me how to install the softwareI better answer the phone from now on - right.

author: rstofer
author_rank: Super Contributor
timestamp: July 21, 2016, 09:24:33 pm
content: Quote from: ez24 on July 21, 2016, 08:13:44 pmWhere did your code come from? If it's not too long, post it! You have the proper port and pin (PA5) but I can't replicate your problem if I don't have the code or some way to recreate the code.If you used STM32CubeMX to create the code, just show your added code.

author: ez24
author_rank: Super Contributor
timestamp: July 21, 2016, 11:19:40 pm
content: Quote from: rstofer on July 21, 2016, 09:24:33 pmI am not 100% sure on what I am doing. I am trying to learn. Do you mean main.c or blinked.h ?It was the first sample program. These are the only files I came into contact with. Does this help?thanks

author: rstofer
author_rank: Super Contributor
timestamp: July 22, 2016, 12:15:54 am
content: Where did they come from?

author: ez24
author_rank: Super Contributor
timestamp: July 22, 2016, 01:23:59 am
content: Quote from: rstofer on July 22, 2016, 12:15:54 amGive me awhile to try and figure out where. I am sure they came from the 10 installationsthanks

author: westfw
author_rank: Super Contributor
timestamp: July 23, 2016, 06:00:17 am
content: QuoteI think the main problem is that there is a lot of churn in development environment - if it takes ten separate downloads to get going, someone will notice, and perhaps make it easier. But that makes older documentation inaccurate. For example, the preferred procedures for installing 3rd party Arduino libraries is on at least their third version, and you can find lots of web-based instructions (and even actual libraries) that just don't work any more.Keeping up with such changes is HARD, and it's even more difficult if you're talking about "book format" rather than online content.

author: ebclr
author_rank: Super Contributor
timestamp: July 24, 2016, 04:54:05 am
content: Your board is mbed compatibleJust go herehttps://www.mbed.com/en/development/hardware/boards/st/nucleo_f401re/Register your seld and your board and open the blink sample

author: ebclr
author_rank: Super Contributor
timestamp: July 24, 2016, 05:19:14 am
content: The program will be simple as that#include "mbed.h"DigitalOut myled(LED1);int main() {while(1) {myled = 1; // LED is ONwait(0.2); // 200 msmyled = 0; // LED is OFFwait(1.0); // 1 sec}}

author: ebclr
author_rank: Super Contributor
timestamp: July 24, 2016, 09:43:25 am
content: After that unplug and re-plug your board. A new drive like "a pen drive" will appear on your windows system just drag and drop on this drive the bin file that is downloaded automatically when you compile on mbed( The driver label will be nucleo ) and is done green Led LD2 flashingTested with 3 different Nucleo boardsL152REF411REF072Rb

author: janoc
author_rank: Super Contributor
timestamp: July 24, 2016, 10:07:37 am
content: Quote from: Sal Ammoniac on July 21, 2016, 01:05:26 amI do wonder why the Segger? Nothing against it, but the Nucleos come with a built-in ST Link debugger that works just fine. Well, maybe except for the programming via mass storage - that is a hit & miss gimmick for mBed crowd, but there is no need to use that. It can be even used to debug/program offboard targets in a pinch too.The Nucleos work with either STLink or OpenOCD bridge software. I have posted the instructions (for a different Nucleo, but they all work pretty much the same) here:https://www.eevblog.com/forum/microcontrollers/arm-starting-platform/msg988123/#msg988123The tutorials how to set all this up are all over the internet, it just takes a short googling. If you are using the GNU ARM plugin for Eclipse, it will even do most of that setup for you.I would rather spend the $60 on something more useful, like a cheap logic analyzer, for example.

author: nctnico
author_rank: Super Contributor
timestamp: July 24, 2016, 01:23:21 pm
content: Having read the Segger versus other debuggers and my own experience with on-target debugger I'd say it would be well worth the money to get a good & stable debugging tool. My experience in the past decades has turned me away from using on-target (JTAG) debugging because it never worked reliable for me and I ended up wasting more time trying to get the debugging environment to work than just fixing the bug using other methods.

author: janoc
author_rank: Super Contributor
timestamp: July 28, 2016, 01:10:12 pm
content: Quote from: nctnico on July 24, 2016, 01:23:21 pmYour argument is okay for the generic case, but here we are talking specifically the ST's Nucleo devboards. With the external Segger dongle you are going to have to modify the board, because they don't have an SWD/JTAG header brought out - the lines are connected to the on-board debugger. So you are basically only adding extra complexity to your problem for no reason.ST Link is a proven system, it is a generic SWD/JTAG debugger that also comes as a separate dongle, if you prefer. ST adds it to all of their Nucleo and Discovery devboards so that you can just plug an USB cable in and don't need anything extra.