Welcome back to my project.
This is Eric. When we start developing with ESP32, we have
two options. They are Arduino Framework, which is the easiest
to access and uses the most libraries, and ESP-IDF Framework which is officially
supported by Espressif. In fact, the relationship between this two is that Arduino framework wraps ESP-IDF in the
form of a wrapper. It mainly simplifies the task and makes it
follow Arduino's basic flow like setup, and loop function flow. Of course, it has pros and cons. First, for beginners or simple hobby projects,
it works perfectly well. It's easy to get started and lowers barriers
to entry for using the microcontroller. And Arduino library is really diverse. Of course, you can use Arduino library with
ESP-IDF, but some libraries don't work at all. But if you're serious about embedded development
or want to develop more extensive esp32 applications, I think it is more reasonable to use IDF. The new features are always released as IDF-based
first. If your project is based on Arduino, you will
have to wait until it is ported to Arduino to apply it to use it. Also, If you need anything specific to ESP32
that Arduino libraries can't do, you can always use IDF directly. Being able to work directly with IDF means
you can actually understand the errors that occur when calling IDF functions. You can call IDF functions on the arduino-esp32,
but when debugging something, it's much easier to use IDF directly, familiar with the api
references, and work directly with the source code than having to translate
everything via wrapper functions. In addition, beyond the basic setup and loop
functions of the Arduino Framework, FreeRTOS-focused projects
have component design patterns that allow functionality to be divided into
smaller compartments, making large-scale projects much easier to
organize. Actually, there is no right answer to this. You can use it according to the project you
want to do. Just wanted to mention that if you decide
to use ESP32 in your project, you need to seriously consider both options. In today's video, I prepared two versions
of the same code. I'm trying to find out what different results
are obtained when using IDF Framework and Arduino Framework. Calculations, drawing screen,
Is there really a clear difference? I'm really curious. Let's test it. The device to be used in the first test is
ESP32-S3-DevKitC-1. This product has Flash 8MB and PSRAM 8MB. It's a very basic device, but I think it's
a great device. If you're a starter, this device will be a
good choice. I found this code on Code Project and the link can be found
in the video description below. This is a benchmark to check the performance
of Floating Point and Integer Arithmetic. Even if the MCU has a floating point unit,
this kind of calculation is never easy. Also, since each calculation is performed
1 million times, it makes a lot of stress on the core. Let's start with Arduino IDE. Everything is default, only check CPU clock
speed. It's set to 240 MHz. Let's build right away and check the result. oh, it's running much slower than expected. Let me speed up this. It's being calculated at a very, very slow
rate. I did the same test on Arduino Portenta H7
before. If you compare it to the one on the right,
you can see how slow it is. This test is not compared to Portenta H7,
so let's skip this part. The important thing is
the performance difference when calculating the same code
based on ESP-IDF build. This time it is ESP-IDF. After the build, start the same test. CPU clock speed is the same 240Mhz. Also, the ESP version is 4.4.3. Seems it takes a lot of time. Let's compare the results right away. All calculations are done. The one on the left is built by Arduino Framework, and the one on the right is built by
ESP-IDF Framework. In conclusion, ESP-IDF does not compute significantly
faster. Both are calculated at similar operation rates. I was expecting a very distinct difference,
but I couldn't confirm it with this test. What I'm going to test this time is the graphic
drawing speed. Two identical devices have been prepared. They are WT32-SC01 Plus with ESP32-S3. The display module is ST7796, which is connected
with an 8-bit parallel. Also, they use both Loveyan GFX for the graphic
library. All settings are the same here, only the framework
is different. The results are very interesting. Arduino Framework is showing better performance. I think I need to do more analysis on this
to find the reason. At this point, I'm not sure why ESP-IDF has
a slower performance. At least I expected ESP-IDF to show faster
or similar performance. But it wasn't. In the tests I've done so far, ESP-IDF hasn't
been significantly faster. It is true that IDF makes ESP32 more fully
usable. But in terms of performance, it's not that
overwhelming. In the end, I think the best way to proceed
with a project is to do it the way you feel most comfortable. I will make a new video if there is an update. That's it for today. Thank you for watching. See you on the next project.