Author Topic: What do you think of this STM32 toolchain - 10 software installations ?  (Read 11385 times)

0 Members and 1 Guest are viewing this topic.

Offline ez24Topic starter

  • Super Contributor
  • ***
  • Posts: 3082
  • Country: us
  • L.D.A.
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.   Eclipse
2.   Ecliipe CDT
3.   GNU ARM
4.   ARM GCC
5.   Build Tools
6.   OpenOCD
7.   STM32CubeMX
8.   ST-LINK Utility
9.   Nucleo Drivers
10. ST-LINK Firmware Upgrade

After 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.pdf

Which are:
 - EWARM
 - MDK-ARM
 - TrueSTUDIO
 - SW4STM32

(reads like a list of bug sprays  :-DD )


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
   

YouTube and Website Electronic Resources ------>  https://www.eevblog.com/forum/other-blog-specific/a/msg1341166/#msg1341166
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11278
  • Country: us
    • Personal site
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.
Alex
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9891
  • Country: us
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.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
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.
================================
https://dannyelectronics.wordpress.com/
 

Offline MT

  • Super Contributor
  • ***
  • Posts: 1616
  • Country: aq
You dont need dummies for nucleo only Emblocks.
 

Offline Sal Ammoniac

  • Super Contributor
  • ***
  • Posts: 1684
  • Country: us
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.
Complexity is the number-one enemy of high-quality code.
 

Offline richardman

  • Frequent Contributor
  • **
  • Posts: 427
  • Country: us
Contacted you via PM.
// richard http://imagecraft.com/
JumpStart C++ for Cortex (compiler/IDE/debugger): the fastest easiest way to get productive on Cortex-M.
Smart.IO: phone App for embedded systems with no app or wireless coding
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
 

Offline MosherIV

  • Super Contributor
  • ***
  • Posts: 1530
  • Country: gb
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 used
Atollic TrueStudio
Freescale CodeWorrier
Hated 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 program |O
Thats why I advise people to aviod Eclipse based solutions.
« Last Edit: July 21, 2016, 06:57:13 am by MosherIV »
 

Offline hans

  • Super Contributor
  • ***
  • Posts: 1643
  • Country: nl
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.
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
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
 

Offline FreddyVictor

  • Regular Contributor
  • *
  • Posts: 164
  • Country: gb
@OP, as already mentioned, you've made life difficult by your choice of tools

already 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 to Nucleo User manual doc:
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) chip
it simply indicates the ST-Link status
 

Offline newbrain

  • Super Contributor
  • ***
  • Posts: 1721
  • Country: se
After 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).
When 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 use visualgdb (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.

Nandemo wa shiranai wa yo, shitteru koto dake.
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
What is the exactly Nucleo board you are talking about, I will make that Led flash
 

Offline blackbird

  • Regular Contributor
  • *
  • Posts: 131
  • Country: nl
  • Ooohhhh, what does this button do???
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. 
« Last Edit: July 21, 2016, 02:41:21 pm by blackbird »
 

Offline jnz

  • Frequent Contributor
  • **
  • Posts: 593
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.
 

Offline blackbird

  • Regular Contributor
  • *
  • Posts: 131
  • Country: nl
  • Ooohhhh, what does this button do???


I sometimes am stunned at the time and patience hobbyists have.

For 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.
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1989
  • Country: dk
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
 

Offline XFDDesign

  • Frequent Contributor
  • **
  • Posts: 442
  • Country: us
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.
 

Offline ez24Topic starter

  • Super Contributor
  • ***
  • Posts: 3082
  • Country: us
  • L.D.A.
One side of me saddens that a (beginners) book tries to drag you through this.

NO !

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.
YouTube and Website Electronic Resources ------>  https://www.eevblog.com/forum/other-blog-specific/a/msg1341166/#msg1341166
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9891
  • Country: us
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.


So 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.
 

Offline ez24Topic starter

  • Super Contributor
  • ***
  • Posts: 3082
  • Country: us
  • L.D.A.
What is the exactly Nucleo board you are talking about, I will make that Led flash

F401RE

with the following changes to blinkled.h

19 #define BLINK_PORT_NUMBER (0)
20 #define BLINK_PIN_NUMBER (5)

Note:  the changes were not at line 19 but I think 21
I played around with the port numbers for awhile with no luck

The 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 way

thanks
YouTube and Website Electronic Resources ------>  https://www.eevblog.com/forum/other-blog-specific/a/msg1341166/#msg1341166
 

Offline ez24Topic starter

  • Super Contributor
  • ***
  • Posts: 3082
  • Country: us
  • L.D.A.
The author suggested that I use

System Workbench for STM32   --> SW4STM32 toolchain
http://www.openstm32.org/System+Workbench+for+STM32

And try to continue with the next chapter.

So that is my next step  :-+

Edit - 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 software  :-DD :-DD :-DD
I better answer the phone from now on - right.
« Last Edit: July 21, 2016, 08:59:16 pm by ez24 »
YouTube and Website Electronic Resources ------>  https://www.eevblog.com/forum/other-blog-specific/a/msg1341166/#msg1341166
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9891
  • Country: us
What is the exactly Nucleo board you are talking about, I will make that Led flash

F401RE

with the following changes to blinkled.h

19 #define BLINK_PORT_NUMBER (0)
20 #define BLINK_PIN_NUMBER (5)

Note:  the changes were not at line 19 but I think 21
I played around with the port numbers for awhile with no luck

The 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 way

thanks

Where 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.
 

Offline ez24Topic starter

  • Super Contributor
  • ***
  • Posts: 3082
  • Country: us
  • L.D.A.
Where 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.
I 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
YouTube and Website Electronic Resources ------>  https://www.eevblog.com/forum/other-blog-specific/a/msg1341166/#msg1341166
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9891
  • Country: us
Where did they come from?
 

Offline ez24Topic starter

  • Super Contributor
  • ***
  • Posts: 3082
  • Country: us
  • L.D.A.
Where did they come from?
Give me awhile to try and figure out where.  I am sure they came from the 10 installations
thanks
YouTube and Website Electronic Resources ------>  https://www.eevblog.com/forum/other-blog-specific/a/msg1341166/#msg1341166
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4204
  • Country: us
Quote
(from a book)
I 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.

 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
Your board is mbed compatible

Just go here

https://www.mbed.com/en/development/hardware/boards/st/nucleo_f401re/

Register your seld and your board and open the blink sample
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
The program will be simple as that

#include "mbed.h"

DigitalOut myled(LED1);

int main() {
    while(1) {
        myled = 1; // LED is ON
        wait(0.2); // 200 ms
        myled = 0; // LED is OFF
        wait(1.0); // 1 sec
    }
}

 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
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 flashing

Tested with 3 different Nucleo boards

L152RE
F411RE
F072Rb

 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3787
  • Country: de
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.

I 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/#msg988123

The 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.


« Last Edit: July 24, 2016, 10:12:28 am by janoc »
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 26993
  • Country: nl
    • NCT Developments
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.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3787
  • Country: de
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.

Your 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.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf