STM32Cube IDE vs Arduino IDE
- 5 replies
- 5839 views
Hi,
I have used different micro-controller boards for many years, Arduino, STM32 and ESP32. I have always used Arduino IDE for all my developments. Recently I have downloaded STM32Cube IDE to see how it works compared to Arduino IDE. I started porting different programs and they went pretty well.
In the past I have developed a program to test the speed of different micro-controller boards. The program starts with a larger prime number and checks if its a prime or not. then it does it over and over to see how many times it can checks in 60 seconds. Though it does only arithmetician integer operation, it gives me an idea how fast a board is.
So I ported the code from Arduino IDE to STM32Cube IDE, and compared the results for a blue pill STM32 board (STM32F103C8T6 ). I got very different results. Code compiled in Arduino IDE goes through many more loops than the Cube IDE. If I start with a prime number 1990661, with Arduino IDE code can check 589632 times if its a prime or not. For the same code on the same board flashed through STM32Cube IDE only can check 169176 times. This is about 3.5 times slower. I get similar speed difference when I start with a different prime number.
I have attached both Arduino and Cube IDE code and few picture for reference. Is there anything I am doing wrong that is causing STM32Cube IDE to run slower? I am new to Cube IDE and do not know much. Any help will be appreciated.

