Skip to main content
Graduate
March 25, 2020
Question

Toolchains for STM32

  • March 25, 2020
  • 11 replies
  • 20056 views

Hi. I am a little bit confused.

Why there is so many toolchains for ARM and what are the differences betwen them?

Lastly i heard abot Yagarto, and also these is WinARM, arm-gcc, arm-none-eabi-gcc. Are they all the same? which toolchain should i use?

I also heard about somethink called cygwin, what is that?

    This topic has been closed for replies.

    11 replies

    Visitor II
    March 25, 2020

    > Why there is so many toolchains for ARM

    For the same reason as there are so many different cars, shoes, airlines, and whiskey brands.

    > what are the differences betwen them?

    Some of them are free, others cost some money, some are rip-offs. Some produce faster code, some are more robust, packed with more features, or useless memory and cpu hogs. Some are better for beginners, others are for experts. Some of them are certified for automotive/military/healthcare etc.

    > Lastly i heard abot Yagarto,

    I thought it was abandoned a couple of years ago.

    > which toolchain should i use?

    STM32CubeIDE is free, provides a hassle-free installation, and has almost everything that a beginner would need, i.e. an IDE to write, compile, upload and debug code.

    It has a code generator feature, but do not ever assume that code generated by it, or the barely documented library functions actually work. Stick to the register interface which is extensively documented in the reference manual and the datasheet.

    Explorer
    March 25, 2020

    arm-none-eabi-gcc is a gcc for a ARM architecture, non-OS environment, using ARM's EABI.

    I think arm-gcc is a more generic term.

    Cygwin is a Windows package to emulate the Unix/Linux environment (POSIX).

    I would consider Keil and IAR as well, their toolchainsproduce better code, they are less buggy, and not restricted to one vendor. I think only codesize-restricted versions are free.

    And Crossworks for ARM offers an affordable private license, and a good & stable toolchain for Win, Mac, and Linux hosts.

    Visitor II
    March 25, 2020

    Keil and IAR produce better code because some very effective optimizations in gcc are disabled or made difficult to access in STM32CubeIDE, to hide some obvious bugs in HAL.

    The difference in real life projects, with full optimizations enabled, is barely perceptible.

    Super User
    March 25, 2020

    > some very effective optimizations in gcc are disabled or made difficult to access in STM32CubeIDE, to hide some obvious bugs in HAL.

    Do you have an example?

    sholojdaAuthor
    Graduate
    March 25, 2020

    Thank for anwering.

    I like CubeIIDE but it has an inconvenience (defect). It is on 64-bit windows only and most of time i spend at 32bit windows. 64bit i have on laptop which i do not use so often.

    And what is this cygwin and corss complier? Is it the same as arm-none-eabi-gcc (another name)?

    BTW what is -none- in the toolchain name?

    Super User
    March 25, 2020

    Here is a gcc+ Makefile example: https://gitlab.com/stm32mcu/blinky_makefile

    There is a make.exe for Windows, and a arm-none-eabi-gcc toolchain. Don't know about 32-bit. cygwin is a *nix like enviroment for windows. Check their website for the supported tools. Haven't needed it for a decade.

    If you think of hardware debugging, you want more tools, maybe openOCD, gdb. It will give you a hard time.

    Super User
    March 26, 2020

    > If you think of hardware debugging, you want more tools, maybe openOCD, gdb. It will give you a hard time.

    There's a learning curve for sure, but once you get over it you gain freedom as in not depending on quirks of IDEs.

    VisualGDB (not free but not that prohibitively expensive either) is praised as a debug-only tool (I don't use it but I see its appeal) which allows, well, visual debugging =) while allowing the freedom of using "normal" command-line (mostly GNU) tools and any suitable programmer editor (although being based on Microsoft's VisualStudio, it naturally pushes towards using that as the programming editor, too).

    JW

    sholojdaAuthor
    Graduate
    March 26, 2020

    Do I need cygwin at all?

    Explorer
    March 26, 2020

    Most probably not.

    A proper toolchain/IDE usually comes with all the required binaries.

    Cygwin can provide a Unix-like shell environment for porting *nix packages to Windows, and even a graphical X11 environment.

    Graduate II
    April 1, 2020

    For a serious use EmBitz is also a very good option. It can be used with STM32 or any Cortex-M at all with a configuration similar to this. It's a small and fast Code::Blocks (native code, not Java bloatware) based IDE with GCC toolchain and works with ST-LINK and J-Link debuggers. It has some minor problems, but overall it's a no-nonsense tool that just does what it's supposed to do.

    Graduate
    April 1, 2020

    Also worth a closer look: VisualGDB, a plugin for cross platform development with Visual Studio (Free community edition is enough...). You can find it on www.sysprogs.com

    Super User
    April 2, 2020

    2 experts they will, on average, make 3 proposals.

    But, if you are a beginner, you can hardly fail with the vendor's multi-platform free offer: STM32CubeIDE.

    There is one video "How to use STM32CubeIDE"

    and two docs

    to start with. Avoid "complicated" path names: no spaces, no non-ACSII chars in installation and workspace path.

    Good luck

    KnarfB

    sholojdaAuthor
    Graduate
    April 4, 2020

    I'm aware that I am not native englsh person so maybe i wrote somthing else that i intended i propably I was misunderstood. Plese fore give me.

    But. I think i wrote thet i use CudeIDE but it has same disadvantages like: it works ony on 64bit system, i can not add external tool, it doesn't have simulator - i am used to use such tool even though people advise against using it (in some cases it is heplful).

    I know i am beginner but i have to start with something and asking some other people helps me to understand.

    As i said before there are a lots of informations which are hard to understand for me and that is why as ask, like cygwin. this appears and i can not find what it is. few years later it was necessary to use with ARM but why now it is not? the same as many toolchains yagarto (now i know it is obsolete) none-eabi and eabi

    I would like organize my knowledge i that is why i ask, so for give me my stupid questions. :)

    Super User
    April 4, 2020

    You are right, you wrote about 32-bit, sorry. cycgwin is not a MCU related tool but a helper for running ported Linux tools under Windows. You need it only when you are using a tool which requires it. Such tools may be make or bash or grep or vi or a compiler toolchain.

    I'm not aware of a simulator which simulates the ARM core and also the on-chip peripherals. Better buy a cheap nucleo or discovery board. Its much easier to use and to connect to external hardware or a LA/scope. And, you can debug stepping through the code at source code or assembler level and inspect peripheral registers on most IDEs.

    When downloading gcc, you may use gcc-arm-none-eabi form the ARM site or

    Super User
    April 5, 2020

    If you already know Visual Studio, and it works on your machine - go for VisualGDB and don't hesitate. It will install the toolchain for you.

    Else, prepare for having some hard time.

    -- pa