Maker.io main logo

Powerful Low-Cost Arduino Alternatives: STM32 Nucleo

2016-06-20 | By Maker.io Staff

ARM mbed

Arduino has been quite dominant in the Maker industry for a long period and there have been a number of competitive boards all offering something different, unique and some clone boards. ST Microelectronics have been somewhat the underdogs in the maker community, however their range of NUCLEO development boards are becoming popular where faster processing and more memory is required.

There are a lot of great features about the NUCLEO boards, firstly they are mbed compatible, making them a great way for beginners to get into the world of ARM development. Second and foremost they are Arduino pin compatible, which gives you full access to all Arduino compatible shields.

Currently there are 3 form factors of the ST NUCLEO range of boards; Nucleo-32, Nucleo-64 and Nucleo-144. Each board offers something different than the next with a total range of 27 NUCLEO variations to choose from.

ST NUCLEO – A Powerful, Low-cost Alternative to the Arduino

Figure 1: STM NUCLEO Range

The whole series of NUCLEO boards is equipped with a STM32 microcontroller based on ARM Cortex-M, adopting a 32-bit RISC architecture. Each board differs for performances, power consumption, clock frequency and flash memory capacity of the STM32 microcontroller.

Let’s take a closer look at the STM32F401, as shown in Figure 2. One of the first features you can noticeably see on the board is the presence of the many contact available, including the female headers for Arduino compatible shields. Externally on the board, there are two double strips of male contacts which are known as “Morpho” pinout headers, as used on other STM dev boards. Some of the morpho pin headers are mapped exactly the same as the Arduino female headers to allow debugging when using shields, the is great feature of the NUCLEO boards.

ST NUCLEO – A Powerful, Low-cost Alternative to the Arduino

Figure 2: NUCLEO F401RE Pinout Diagram

Another unique feature of the board is the ability to snap off the programming and debugging area of the board, which help reduce the board size that actually run the applications. Once you have finished programming your board you can tear-off the debugger and have a very compact microcontroller board. The board then still has the ability to be programmed and debugged by connecting external cables from the debugging PCB board to the NUCLEO board again.

A fairly new feature of the ARM Cortex-M microcontroller family is the Serial Wire Debug protocol, which only required 2 wires instead of the standard 5 wire JTAG that is more commonly found on other boards.

Technical Features

The F401RE is an ARM Cortex-M4 with a 32-bit floating-point that supports a frequency up to 84MHz by configuring the internal register and on a whole has a really low power consumption. The board also has 512Kb of Flash memory for storing the code and 96KB of SRAM for program execution.

The board features a 12-bit ADC converter that can be shared across 16 channels altogether, which is great for analysing sensor data on the board; six 16-bit timers and two 32-bit timers that can be configured in different ways including input capture, output compare and pulse width modulation.

There are a number of different ways to communicate with the board with three I2C pins, three UART interfaces at 10 Mbit/s, four SPI interfaces at 42Mbit/s. The I/O pins are 5V tolerant and will also accept input voltages of 5V TTL signals without damaging any internal circuitry.

As previously mentioned the board comes with a classic JTAG header as well as the new SWD, as featured on the ARM Cortex family. Additionally, the board has a built in RTC with integrated calendar function and a full-speed USB 2.0 port, which can operate both as a client and host port allowing USB peripherals to be connected with ease. Table 1-1 shows a comparison between the Arduino and NUCLEO boards.

Table 1-1: Comparison of NUCLEO and Arduino Boards

 

NUCLEO F401

Arduino UNO

NUCLEO F303

Arduino Nano

Microcontroller

STM32F401 32-bit

ATMega 328 8-bit

STMF303K8 32-bit

ATMega 328 8-bit

Family

ARM Cortex M4

AVR

ARM Cortex M4

AVR

Clock Frequency

84 MHz

16 MHz

72 MHz

16 MHz

Flash memory

512 Kb

32 Kb

64 Kb

32 KB

SRAM

96 Kb

2 Kb

16 Kb

2 Kb

EEPROM memory

-

1 Kb

N/A

1 Kb

PWM

10

6

6

6

Analog inputs

16

6

10

8

Digital pin

47

14

13

14

I2C modules

3

1

1

1

USART modules

3

1

2

1

SPI modules

4

1

1

1

Timer

10

3

5

3

Floating point Unit

One

N/A

One

N/A

Voltage (max)

5V

5V

5V

5V

USB OTG

One

N/A

N/A

N/A

Dimensions

68x80mm

53x68mm

 

45x18mm

Price

$14

$25

$10

$15

Arduino Comparison

There is no doubt that the Arduino UNO is the most popular maker board in the market, however the board has somewhat remained the same for many years with new technology and market changes there is now a high demand for more powerful embedded development boards and the Arduino UNO is somewhat lagging behind in terms of hardware.

Looking at the table side-by-side comparison to the Arduino UNO the NUCLEO boards have far superior performance, quality, inputs/outputs and debugging options available. However, it doesn’t come without some minor flaws. The NUCLEO board doesn’t come with an internal EEPROM memory or even and internal EEPROM within the STM32 to store permanent variables in case of a system reboot, while the Arduino has a built-in EEPROM with the Atmel microcontroller.

In terms of performance the NUCLEO can process more complex algorithms due to the floating-point and also the C compiler will be written with far few instructions which allows quicker execution and significant efficiency within your programs.

Mbed Programming

Programming the NUCLEO boards isn’t as straight forward as using a simple IDE such as the Arduino IDE. Like the Arduino, the programming language is the same, using C, however it is not compiled the same way, so sketches for the Arduino shields may have to be ported with very few minor changes to the program.

A great feature to the 32-bit ARM Cortex family is the ability to use the ARM mbed platform, which allows users to program their NUCLEO boards online through the web.

ST NUCLEO – A Powerful, Low-cost Alternative to the Arduino

Figure 3: ARM mbed cloud platform

The ARM mbed is a free online IDE; it is simple and fast enabling you to edit code and compile your programs directly in the browser. The cloud compiler is a C/C++ development toolchain and allows you to save your code in your private cloud so you can pick up where you left off on any device, anywhere by going to the following link: http://mbed.org/.

When using the IDE, you will find that it is very user friendly just like the Arduino IDE with colourful syntax, references to a number of functions and very fluid. The IDE also integrates the ARM community giving users access to thousands of other open-source projects written by other ARM developers.

When you first connect a NUCLEO device to your computer you will notice that it does open up as a mass storage device. This is due to the ST-LINK/V2 programmer also acts as a virtual mass storage device allowing you to transfer your code directly to the STM32 flash memory. When you compile your code in the cloud it will generate a binary file to be downloaded to your computer; at this point you can just drag this to the mass storage on the NUCLEO board.

By far the most convenient method of programming your NUCLEO board is to use one of STMicroelectronics local compiler and development environment such as EWARM, MDK-ARM and TrueSTUDIO. They allow a more in-depth debugging compared to the cloud mbed platform. You can easily follow the code step-by-step inspecting the memory and register values if necessary for each instruction coded on the board. These programs are not free but but you can download trial version to try out before you consider purchasing.

Summary

The NUCLEO range is a perfect development board to get started with the mbedded world. It is almost half the price of a standard Arduino board with double the performance. It is great value and offers advanced features using the ARM Cortex. Be sure to check the range of NUCLEO boards DigiKey has to offer and let us know your thoughts in the comment box below.

制造商零件编号 NUCLEO-F401RE
NUCLEO-64 STM32F401RE EVAL BRD
STMicroelectronics
制造商零件编号 NUCLEO-F303K8
NUCLEO-32 STM32F303K8 EVAL BRD
STMicroelectronics
Add all DigiKey Parts to Cart
TechForum

Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.

Visit TechForum