Comparing STM32 and RP2350 Performance

From Stm32World Wiki
(Redirected from Comparing STM32 and RP2350)
Jump to navigation Jump to search

The RP2350 is unusual: it has two Arm Cortex-M33 cores and two Hazard3 RISC-V cores, and the bootrom starts whichever pair matches the image in flash. That makes it possible to compare the two architectures on the exact same silicon, and to put both against well known STM32 parts.

All RP2350 numbers on this page were measured on a Streamline RP2354 MCU board, flashed and monitored through a Streamline Connect running Hybridlink firmware. Every benchmark runs on both cores at the same time. Each core reports its own result (the two cores always agree to within 0.1%), and the tables show both the per core figure and the both cores total, which is the sum of the two. The source for all benchmarks is in the rpfun repository (see #Source code).

Compilers used: Arm GNU Toolchain 15.2 (Arm) and the Raspberry Pi RISC-V toolchain RISCV_PICO_2_3_1_0 / GCC 16.1 (RISC-V), Pico SDK 2.3.1, -O3.

Video

We've made a video about these results. Watch it here:

CoreMark

EEMBC CoreMark is the most widely published MCU benchmark, so it is the best one for comparing against STM32. The RP2350 runs are standard 2K performance runs, each about 14-16 seconds, and both report "Correct operation validated".

MCU Core Clock CoreMark CoreMark/MHz Source
Arduino Uno ATmega328P (8-bit AVR) 16 MHz – – Cannot run the standard test, see below[1]
Arduino Mega 2560 ATmega2560 (8-bit AVR) 16 MHz 7 0.44 Arduino IDE[2][3]
Arduino Uno WiFi Rev 2 ATmega4809 (8-bit AVR) 16 MHz 8.2 0.51 Arduino IDE[4]
STM32F103 Cortex-M3 72 MHz ~81-96 ~1.1-1.3 Community runs (ST does not publish CoreMark for F1)[3][5]
STM32F405/407 Cortex-M4F 168 MHz 566 3.37 ST[6]
ESP32 Xtensa LX6, 1 core 240 MHz 498 2.08 Community run[3]
ESP32, both cores 2 × Xtensa LX6 240 MHz 991 4.13 Community run[3]
ESP32-S3 (Arduino Nano ESP32) Xtensa LX7, 1 core 240 MHz 451 1.88 Arduino IDE[4]
STM32H562 Cortex-M33 250 MHz 1023 4.09 ST datasheet, Arm Compiler 6.16[7][8]
STM32H723 Cortex-M7 550 MHz 2778 5.05 ST[9] (one user reached 2136 with GCC[10])
RP2350 Arm Cortex-M33 150 MHz 380 2.53 Measured, per core
RP2350 RISC-V Hazard3 150 MHz 441 2.94 Measured, per core
RP2350 Arm, both cores 2 × Cortex-M33 150 MHz 760 5.06 Measured, sum of both cores
RP2350 RISC-V, both cores 2 × Hazard3 150 MHz 883 5.88 Measured, sum of both cores
RP2350 Arm, both cores 2 × Cortex-M33 540 MHz (overclocked) 2735 5.06 Measured, sum of both cores
RP2350 RISC-V, both cores 2 × Hazard3 540 MHz (overclocked) 3164 5.86 Measured, sum of both cores

The RP2350 at stock and overclocked speeds:

Core 150 MHz / 1.10 V 320 MHz / 1.30 V 540 MHz / 1.60 V
Per core Both cores Per core Both cores Per core Both cores
Arm Cortex-M33 380 760 811 1622 1367 2735
Hazard3 RISC-V 441 883 942 1884 1582 3164

Things to keep in mind when reading the table:

  • The classic Arduino Uno (ATmega328P) cannot run a conformant CoreMark: the standard run needs about 2265 bytes of RAM and the chip has 2048. A reduced 1200-byte run scores 39.4, but that is not comparable with any normal CoreMark figure[1]. The 8-bit rows therefore use the ATmega2560 and ATmega4809.
  • The very first Arduino boards (the original Arduino with the ATmega8, the Diecimila with the ATmega168 and the Duemilanove with the ATmega328) all use the same 8-bit AVR core at 16 MHz as the Uno, so the Uno figures in the Dhrystone and Whetstone tables apply to them too, as far as their RAM allows the benchmark to run.
  • The STM32 figures are vendor best case, typically built with Arm Compiler or IAR and tuned flags. The RP2350 figures are stock GCC -O3. CoreMark results vary a lot with compiler and settings, which ST itself points out[8].
  • The STM32H562 has the same Cortex-M33 core as the Arm side of the RP2350, yet ST gets 4.09 CoreMark/MHz versus 2.53 here. Most of that difference is compiler (Arm Compiler vs GCC) and memory: the H562 runs from 0 wait state internal flash, the RP2350 runs from external QSPI flash through a 16 kB XIP cache.
  • Even at the stock 150 MHz a single RP2350 core is roughly 4× an STM32F103. Both cores together beat an STM32F405 running at 168 MHz.
  • Overclocked to 540 MHz, both Arm cores together (2735) are level with ST's best case figure for the STM32H723 (2778), and both RISC-V cores together (3164) beat it. Per core the Cortex-M7 in the H723 is of course still much faster.
  • On the RP2350 the Hazard3 RISC-V core is about 16% faster than the Cortex-M33 in this integer benchmark.
  • Compiler flags matter a lot. The Hazard3 README reports 4.15 CoreMark/MHz for the RP2350 RISC-V core using GCC 15 with heavily tuned flags (-funroll-all-loops, aggressive inlining and more), against 2.94 CoreMark/MHz here with plain -O3. Likewise a bare metal GCC run of the STM32F407 in MCU_Benchmarks gets 378 CoreMark, where ST quotes 566.

Dhrystone

Dhrystone 2.1, reported in DMIPS (1757 Dhrystones per second = 1 DMIPS). Dhrystone is old and easy for compilers to "optimise", so it is mostly useful for comparing within the same toolchain, but it is still the figure most vendors quote.

MCU Core Clock DMIPS DMIPS/MHz Source
Arduino Uno ATmega328P (8-bit AVR) 16 MHz 9.8 0.61 Arduino IDE[4]
Arduino Uno WiFi Rev 2 ATmega4809 (8-bit AVR) 16 MHz 10.4 0.65 Arduino IDE[4]
Arduino Mega (2009) ATmega1280 (8-bit AVR) 16 MHz 7.2 0.45 Arduino IDE, 2015[11]
STM32F103 Cortex-M3 72 MHz 49 0.68 Arduino IDE (Arduino_STM32), 2015[11]
STM32F103 Cortex-M3 72 MHz 90 1.25 ST[12]
STM32F405/407 Cortex-M4F 168 MHz 210 1.25 ST[6]
STM32H562 Cortex-M33 250 MHz 375 1.50 ST[7]
STM32H723 Cortex-M7 550 MHz 1177 2.14 ST[9]
ESP32 Xtensa LX6, 1 core 240 MHz 176 0.73 Arduino IDE[4]
ESP32 Xtensa LX6, 1 core 240 MHz 356 1.48 ESP-IDF, -O2[13]
ESP32-S3 Xtensa LX7, 1 core 240 MHz 356 1.48 ESP-IDF, -O2[13]
RP2350 Arm Cortex-M33 150 MHz 225 1.50 Measured, per core
RP2350 RISC-V Hazard3 150 MHz 270 1.80 Measured, per core
RP2350 Arm, both cores 2 × Cortex-M33 150 MHz 451 3.00 Measured, sum of both cores
RP2350 RISC-V, both cores 2 × Hazard3 150 MHz 541 3.61 Measured, sum of both cores
RP2350 Arm, both cores 2 × Cortex-M33 540 MHz (overclocked) 1615 2.99 Measured, sum of both cores
RP2350 RISC-V, both cores 2 × Hazard3 540 MHz (overclocked) 1979 3.66 Measured, sum of both cores
  • The 8-bit Uno and Mega have too little RAM for the standard Dhrystone, so the Arduino versions are cut down to fit. The Uno and Mega figures come from different ports and compiler versions, which is why the older Mega scores lower.
  • The same ESP32 gives 176 DMIPS from the Arduino IDE and 356 DMIPS from ESP-IDF with -O2, which shows how much the build matters. The ESP-IDF benchmark times in coarse steps, so its figures are rounded.
  • The RP2350 Arm core matches the STM32H562, which has the same Cortex-M33 core, at exactly 1.50 DMIPS/MHz.

The RP2350 at stock and overclocked speeds, with both cores running at the same time:

Core 150 MHz / 1.10 V 320 MHz / 1.30 V 540 MHz / 1.60 V
Per core Both cores Per core Both cores Per core Both cores
Arm Cortex-M33 225 451 481 962 807 1615
Hazard3 RISC-V 270 541 576 1152 989 1979

The results (here and for CoreMark) scale almost perfectly with clock speed. The two cores always score the same as each other, so the both-cores total is essentially twice the per-core figure. Above 320 MHz the flash has to be switched to the slow serial command XIP mode, but because the benchmark lives in the XIP cache this makes no measurable difference.

Whetstone (floating point)

Whetstone, reported in MWIPS (millions of Whetstone instructions per second). Good published Whetstone figures for MCUs are much harder to find than CoreMark or Dhrystone: vendors don't quote it, and most community runs don't say whether they used float or double. Treat the external figures as rough.

MCU Core Clock MWIPS MWIPS/MHz Source
Arduino Duemilanove (2009) ATmega328 (8-bit AVR), no FPU 16 MHz 1.22 0.076 Arduino IDE, 2015[11]
STM32F103 Cortex-M3, no FPU 72 MHz 5.08 0.071 Arduino IDE (Arduino_STM32), double precision, 2015[11]
RP2040 (Raspberry Pi Pico) Cortex-M0+, no FPU 125 MHz 16.6 0.13 Arduino IDE[4]
ATSAMD51 (Wio Terminal) Cortex-M4F 120 MHz 50.0 0.42 Arduino IDE[4]
NXP i.MX RT1062 (Teensy 4.0) Cortex-M7 600 MHz 1695 2.82 Arduino IDE[4]
ESP32 Xtensa LX6, 1 core 240 MHz 134 0.56 Arduino IDE[4]
ESP32-S3 Xtensa LX7, 1 core 240 MHz 50 0.21 ESP-IDF, -O2[13]
RP2350 Arm (float) Cortex-M33 150 MHz 320 2.13 Measured, per core
RP2350 Arm (double) Cortex-M33 150 MHz 138 0.92 Measured, per core
RP2350 RISC-V (float) Hazard3, no FPU 150 MHz 35 0.23 Measured, per core
RP2350 RISC-V (double) Hazard3, no FPU 150 MHz 15 0.10 Measured, per core
RP2350 Arm, both cores (float) 2 × Cortex-M33 150 MHz 641 4.27 Measured, sum of both cores
RP2350 Arm, both cores (float) 2 × Cortex-M33 540 MHz (overclocked) 2277 4.22 Measured, sum of both cores
  • The only usable STM32 Whetstone figure we found is the 2015 STM32F103 run, which has no FPU. There is none for the STM32F4 or H7; the Teensy 4.0 (Cortex-M7, like the STM32H7) is the closest stand-in.
  • The Duemilanove and STM32F103 runs report "double precision", but on 8-bit AVR double is the same 32-bit type as float, so the Duemilanove is really doing single precision.
  • Some other 8-bit Arduino Whetstone sketches report about 8 MWIPS on an Uno, Leonardo or Mega, which is implausibly high for a 16 MHz AVR doing software floating point (the author notes it should be nearer 1.2, which matches the Duemilanove result above)[14], so they are left out.
  • The two ESP32 rows come from different Whetstone ports and clearly don't agree, another sign of how much the port and build matter.

The RP2350 in single and double precision, at stock and overclocked speeds, with both cores running at the same time:

Core Precision 150 MHz / 1.10 V 320 MHz / 1.30 V 540 MHz / 1.60 V
Per core Both cores Per core Both cores Per core Both cores
Arm Cortex-M33 float 320 641 675 1350 1139 2277
Hazard3 RISC-V float 35 70 75 149 127 255
Arm Cortex-M33 double 138 277 295 589 497 994
Hazard3 RISC-V double 15 31 33 65 55 110

This is where the architectures really differ. The Cortex-M33 cores have a single precision FPU (plus the RP2350 double precision coprocessor), while the Hazard3 cores have no FPU at all and do floating point in software. The Pico SDK ships hand optimised Hazard3 routines for single precision add, subtract and multiply (about 37% faster than plain libgcc in this test), but division, the math library and all double precision come from the generic libraries. The result is roughly a 9× advantage for Arm in floating point.

Whetstone without the FPU

To see how much of that gap is the FPU and how much is the core itself, the Arm build was also compiled fully soft-float: -mcpu=cortex-m33+nofp -march=armv8-m.main+dsp -mfloat-abi=soft together with PICO_DEFAULT_FLOAT_IMPL=compiler and PICO_DEFAULT_DOUBLE_IMPL=compiler. That takes the FPU, the double precision coprocessor and the SDK's optimised float routines out of the picture, and a disassembly of the binary confirms there are no FPU instructions left. For comparison the RISC-V build was run both with the SDK default and with the same plain libgcc routines. All runs at 150 MHz with both cores running; the figures are per core (the two cores agree within 0.3%).

Core Floating point float (MWIPS) double (MWIPS)
Arm Cortex-M33 FPU + SDK routines (default) 320.5 138.2
Arm Cortex-M33 No FPU, plain libgcc 32.7 18.4
Hazard3 RISC-V SDK Hazard3 routines (default) 34.9 15.2
Hazard3 RISC-V Plain libgcc 25.8 15.2
  • Without the FPU the Cortex-M33 drops about 10× in single precision (320 → 32.7) and 7.5× in double (138 → 18.4). Double precision suffers too, because the SDK's double routines use the FPU and the double coprocessor.
  • On equal terms, with both cores using plain libgcc, Arm is about 27% faster in single precision and 21% faster in double.
  • With the SDK's hand optimised Hazard3 routines, RISC-V single precision (34.9) actually edges out the soft-float Arm build (32.7).
  • RISC-V double precision is the same with both settings, since there are no optimised Hazard3 double routines.

So the big floating point gap between the two architectures is almost entirely the FPU; the cores themselves are fairly evenly matched.

Summary

  • Integer code (CoreMark, Dhrystone): the RISC-V cores are 16-20% faster than the Arm cores at the same clock.
  • Floating point code (Whetstone): the Arm cores are about 9× faster.
  • Per core at stock clock the RP2350 sits between an STM32F1 and an STM32F4. Both cores at stock clock beat an STM32F4. Both cores overclocked to 540 MHz reach STM32H723 level in CoreMark (2735 Arm, 3164 RISC-V vs 2778).

Source code

All benchmarks are in the rpfun repository for the RPPicoWorld YouTube channel. Each pair differs only in PICO_PLATFORM and the toolchain:

All projects default to the stock 150 MHz / 1.10 V. To overclock, configure with for example -DSYS_CLOCK_KHZ=320000 -DCORE_VOLTAGE=VREG_VOLTAGE_1_30 or -DSYS_CLOCK_KHZ=540000 -DCORE_VOLTAGE=VREG_VOLTAGE_1_60. The repository README explains how to flash Arm and RISC-V images back to back with a CMSIS-DAP probe without falling back to BOOTSEL.

Other benchmark comparisons

Tables elsewhere that compare a wider range of MCUs. They use different compilers, flags and frameworks (often Arduino), so compare CoreMark/MHz and treat the numbers as indicative only.

Source Benchmarks MCUs covered
ckArduino: Benchmarks (German) Dhrystone, Whetstone, CoreMark ATmega328P and ATmega4809, Microchip SAMD21, SAMD51 and SAM3X8E, Nordic nRF52840, RP2040, RP2350 (Arm and RISC-V), STM32 (F103 Bluepill, L412, H747), NXP i.MX RT1062 (Teensy 4.0), ESP8266, ESP32, ESP32-S2, ESP32-C3 and ESP32-S3
EEMBC: CoreMark scores CoreMark (official) Scores submitted by vendors and licensees, including TI, NXP, Microchip/Atmel and ST
PaulStoffregen/CoreMark CoreMark Arduino boards: AVR (Mega, Nano Every), SAMD21, SAMD51, SAM3X8E (Due), Teensy 3.x (NXP Kinetis) and 4.0 (NXP i.MX RT), ESP32
kreier: CoreMark CoreMark From 8-bit Arduino to desktop CPUs, including ESP32, STM32 and RP2040
sugnA82-au/MCU_Benchmarks CoreMark (bare metal) RP2040, STM32F407, ATmega328P, CH32V003
nopnop2002/esp-idf-benchmark Dhrystone, Whetstone ESP8266 and the ESP32 family (ESP32, S2, S3, C2, C3, C5, C6, H2) under ESP-IDF
hexrx: ESP32 chips performance comparison CoreMark ESP32 family, from Espressif datasheet figures
Hazard3 README CoreMark The RP2350 RISC-V core, with the exact compiler flags used

For TI parts the vendor pages are the best source, for example the CC2652R (Cortex-M4F) lists 148 CoreMark at 48 MHz.

References

Miscellaneous links