Why recommend STM32 Nucleo instead of Arduino for beginners in microcontroller learning?
For those who are aiming to become embedded engineers, I will introduce the recommended and best way to start learning in earnest, considering what kind of educational materials will help you acquire truly useful skills efficiently and in a short period of time.
Here I will compare the Arduino, which is all the rage in electronics construction, with Mbed, ARM's open source development environment, and the STM32CubeIDE development environment customized to use the Nucleo MCU board we will introduce here.
Table of contents
About Arduino
Although the details of Arduino are beyond the scope of this article, it is a MCU-based system that has become very popular in the field of electronic construction. Arduino is ideal for hobbyist use, and there is a wealth of information available on the Internet and in books, making it easy for beginners to get started with MCU-based electronic construction.
The advantage is that one can easily program a MCU for electronic construction without any specialized knowledge of engineering. The basic concept is similar to programming products such as Lego's Mindstorms, which is a bit more playful. Programming is done in the dedicated Arduino language, which is similar to the C programming language.
A similar product is the Raspberry Pi series, but this is not covered here because it is a rather small PC with a full range of communication functions that also includes an OS, rather than being used for electronic construction.
In Arduino, the interface between the MCU and the hardware is hidden and encapsulated, so the user does not need to be very aware of the hardware to create a system. In other words, it is like connecting ready-made parts like Lego Mindstorms and developing applications with minimal programming knowledge. While even elementary school students can program by combining visual blocks, etc., Arduino is basically the same, with the difference that it uses a dedicated programming language.
The Arduino is ideal for a casual hobbyist start, and its sensors and other peripherals and information make it ideal for crafting with little ideas. However, while it can be programmed without knowing the specifications of the MCU, it is not useful for those who want to learn about the hardware and the MCU itself, which are important for system design.
Even if you are able to create various applications on the Arduino, unless you have created them yourself from the ground up, you will not understand the concept of embedded systems and will not be able to use them in practice.
For example, Arduino can easily communicate with a PC using a ready-made function for serial communication. In other words, the problem is that it is too easy. If you are an engineer, you should at least know how it works.
Arduino is designed for hobbyist use in electronic construction, and even if an aspiring embedded engineer is able to use Arduino, he or she will not be able to acquire any useful skills. It is not for hobby use, but it may be good for programming engineers who do not have basic knowledge of engineering to use Arduino as an opportunity to get acquainted with things.
About Mbed
Mbed is an open development environment proposed by ARM, which is suitable for professional developers and planners who are familiar with ARM microcontrollers, and also good for those who want to use ARM MCUs for electronic construction, especially for IoT applications.
In other words, Mbed seems to be suitable for professionals who can easily and advantageously develop various types of MCU prototypes, hobby electronics, and student development sites. It may be difficult for MCU beginners.
The development environment of this system is on the cloud, so it can be transferred from any terminal with a USB cable. The greatest feature of ARM MCUs is that they can be used universally beyond the boundaries of manufacturers. To this end, the interface of the hardware part, like that of Arduino, is concealed in an abstract manner so that users can concentrate on programming applications.
The biggest advantage is that you can concentrate on application development without knowing the details of each manufacturer's MCU specifications, and you can shorten the development period because prototyping, etc., can be done easily. It sounds like a lot of good things, but what do they really mean?
The Mbed system is a powerful tool for professional engineers with hardware knowledge and experience in MCU development to use to shorten development time.
The Mbed system, which transcends the boundaries between manufacturers, shortens the time it takes to check the specifications of each MCU for each new development, allowing the developer to concentrate on the important task of programming the application. However, as with Arduino, there is a downside to easy development.
I think it is easy to use only for hobby electronics work, because you can develop in an environment that abstracts the hardware part of a high-performance ARM MCU, although this is only for beginners.
However, it is clear that people who want to become embedded engineers will not be able to adapt to this environment out of the blue, and they will eventually hit a wall and lose their way.
If a person who has worked only with software can easily operate MCU without understanding hardware, this is not a problem for hobby use, but you cannot say that you have acquired embedded skills halfway through the program.
For electronic work in hobby use, it is enough if you can adapt information found on the Internet and make it work without understanding the content, but it is better to think of this as a different dimension from the final product using MCU. If you want to become an embedded engineer, you should acquire basic hardware knowledge and the skills to read MCU specifications, and be able to design and develop products as in the past.
Mbed is not suitable for learning embedded MCUs because the interface between the hardware and the MCU can be abstracted and programmed without awareness. It is better to use the abstracted interface only after you know the MCU to some extent. This is not a problem for hobby use, but product development requires a balance of knowledge and experience.
If you work for a major manufacturer and divide your work into specialized fields, you may be able to make it work without knowing what's inside, but if you work independently as a sideline or freelancer, this is even more important. It is impossible to create a product without knowing the hardware, and there is a concern that beginners may misunderstand this if they suddenly adopt Mbed for its convenience alone.
Another thing is that to use Mbed, you need a dedicated board that supports it. It cannot be used with a bare ARM MCU and must be used for system evaluation with a dedicated Mbed board at any level.
MCU development environment STM32CubeIDE with SPL proposed on this site
For those who want to start learning about embedded systems using MCUs through electronic work but are not sure what to choose because Arduino is not practical and Mbed is too abstract and difficult to learn, I recommend the system that this site is composed of.
The system on this site incorporates SPL into STM32CubeIDE, a comprehensive development environment provided by the manufacturer (free of charge, no functionality limitations). SPL is called Standard Peripheral Library, which is a conventional library used to use STM32 microcontrollers, and is currently used for new microcontrollers as opposed to HAL library. The library is coded in such a way that developers can simply specify parameters in an easy-to-understand manner.
The development of MCUs can be done using only coded libraries, whereas in the past, programming was done by manipulating registers while deciphering hundreds of pages of instruction manuals for each MCU. The SPL is a simple and informative library that codifies the contents of the registers described in the instruction manual in an easy-to-understand manner, making it ideal for beginners who are just starting to learn.
In contrast, the HAL library currently recommended by the manufacturer is similar to the SPL, but it is quite abstract and has redundant parts that are difficult to understand when trying to examine the contents a little. However, after you have become somewhat familiar with the STM32 MCU through learning with the SPL, it is easy to handle HAL, which is basically similar. I think it will be easier to move on to the next step after you have established a solid foundation with SPL, rather than suddenly starting with something abstract.
While manufacturers encourage tools that are more convenient and that facilitate development, we believe that HAL should be actively adopted by veterans with some foundation in the field.
Advantages of using this MCU and development environment
- It is easy to start learning about ARM core STM32 microcontrollers.
- The Nucleo-F103RB used as a teaching board is inexpensive and easy to acquire.
- The Nucleo board includes ST-LINK, a tool for program transfer, so all you need is a USB cable and a PC.
- The board used for educational materials is compatible with Arduino, so it is easy to use the assets for Arduino and develop them in various ways through electronic construction.
- The STM32CubeIDE with SPL for learning on this site also includes FreeRTOS as an OS, so you can develop quite advanced applications.
- MCU development environment is configured simply for learning purposes, so it is easy to build and start learning immediately.
Disadvantage
- Currently, Japanese language support is not complete. When using applications created in other environments, the characters are garbled. We hope this will be resolved soon.
- Currently, only the STM32F1 series is supported. However, this is sufficient for learning purposes, and after some familiarity with the SPL, it is easy to port it to the F4 series with Cortex-M4 core, or even to develop it into a HAL driver, so there is no need to worry.
To make a product, you must first know "Hardware"
Common to both Arduino and Mbed development environments is the abstraction of the hardware interface for easy microcontroller development. This allows developers to concentrate on the development of the application itself without having to deal with hardware specifications.
As IoT has become more widespread, and the proportion of software in applications has increased, this trend has become more pronounced. It is as if a paradigm shift has shifted manufacturing from a hardware-oriented approach to a software-oriented approach.
However, nothing has fundamentally changed in the actual manufacturing development field. The only thing that has changed is the addition of microcontrollers to conventional products, and more recently, the addition of IoT. The fact that the basis of manufacturing is hardware will not change in the future.
Rather, the software (programming) part may be replaced by AI in the future.
The tendency for users to be able to handle objects without knowledge of the objects due to the abstraction of everything is not a new trend.
There is no problem from the standpoint of the user of a product or goods, but it is fundamentally problematic to mistakenly assume from the standpoint of the creator that it is now possible to develop without knowing things.
This tendency is based on the business model of the manufacturers and the image created by people in the media who have no experience in development.
Arduino was originally designed for hobbyist electronics work. Mbed is positioned as a development support tool for professionals with some familiarity with it, or for hobbyists like Arduino.
In short, if you want to become a manufacturing engineer, you must make it clear that you cannot create things without knowing the fundamentals of things, and if you do not have a thorough study and experience, you will become a pseudo-engineer who can really only understand software.
I often see such people in the field, but I am not comfortable entrusting design and development to such people. We must not forget that development that handles hardware is a category of manufacturing technology, and programming, which is software, is only one of the ways to make use of technology.
Among various microcomputer development environments, including the Arduino, which is very popular for electronic construction, this site introduces a development system using the Nucleo board, which is ideal for learning.
■ The development environment is free, provided by the manufacturer,no restrictions, making it simple and easy to get started.(STM32CubeIDE with SPL + FreeRTOS)
■ Many tools (compatible with Arduino) and a lot of information to create applications such as electronic construction
■ Learning to be aware of the interface between hardware and microcontroller (most important)
■ More versatility compared to Arduino and Mbed systems, so more practical skills are gained.
When you start embedded systems using MCUs, your choice of microcontroller development environment will depend on whether you want to use MCUs only for hobby purposes or for designing and developing embedded products using MCUs. Considering your future prospects, the development environment introduced on this site is the best choice because it is easy to learn from the basics.