Which ESP IDF to use, Legacy vs new?

TheNewStudent
Posts: 3
Joined: Thu Sep 12, 2019 8:32 am

Which ESP IDF to use, Legacy vs new?

Postby TheNewStudent » Thu Sep 12, 2019 8:59 am

Hi,
I and my friends are getting started with ESP-IDF. We want to get familiar with Embedded C development and ESp32 seemed to be a very good candidate for our later needs. The problem is there are several versions of ESP-IDF and we are especially worried about the Legacy GNU for 32bit and Newer recommended one for 64 bit. Not all of my friends have 64bit Windows and it seems the installation process is also a little different. Also, the getting started page for Legacy version says it will eventually be removed.

So, I wanted to know that, after the installation of legacy version in 32bit systems and newer CMAKE version on is there any difference in the development process of an ESP32 program using Legacy GNU(on a 32-bit system) and CMAKE (on a 64-bit system)?

MingShun
Posts: 3
Joined: Wed Sep 11, 2019 5:16 am

Re: Which ESP IDF to use, Legacy vs new?

Postby MingShun » Fri Sep 13, 2019 3:22 am

In regards to the new CMake system, I was hit with a massive gotcha in that components need to be included:

idf_component_register(SRCS "ulp_example_main.c"
INCLUDE_DIRS ""
REQUIRES soc nvs_flash ulp esp-aws-iot fatfs bt)

I spent hours trying to figure out where to place the components because the compiler kept claiming that it couldn't find them.

You also need to adjust the CMakeLists.txt a lot. Pay attention close attention to how the top level CMakeLists.txt and component folder CMakeLists.txt are laid out.

Past that, it feels a lot more polished than the old GNU Make system.

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: Which ESP IDF to use, Legacy vs new?

Postby ESP_Angus » Fri Sep 13, 2019 4:34 am

Hi NewStudent,
TheNewStudent wrote:
Thu Sep 12, 2019 8:59 am
So, I wanted to know that, after the installation of legacy version in 32bit systems and newer CMAKE version on is there any difference in the development process of an ESP32 program using Legacy GNU(on a 32-bit system) and CMAKE (on a 64-bit system)?
ESP-IDF (all the libraries, programming methods, etc) is the same, but there are two build systems - Legacy GNU Make and CMake.

The differences are only in the build system: for GNU Make you write a Makefile and component.mk files for your project build system, for CMake you write CMakeLists.txt files. And the command you use to build the project is different. If you set up an IDE project, the IDE-specific configuration will be different.

The Windows environments for the two are also different - when using GNU Make on Windows you need to use the "MSYS2" based Unix emulation environment, but for CMake you can use Windows Command Prompt or PowerShell, etc.

Otherwise, they're the same. It's possible to make a project that supports both build systems, for example all the "examples" in ESP-IDF support both build systems.

TheNewStudent
Posts: 3
Joined: Thu Sep 12, 2019 8:32 am

Re: Which ESP IDF to use, Legacy vs new?

Postby TheNewStudent » Sun Sep 15, 2019 3:32 pm

Thank You Very Much for the answers MingShun and ESP_Angus!
I would also like to add that I referred to the book authored by Neil Kolban. I found it very helpful in how the IDF works. Apparently, he is using the Legacy GNU Make which easily works with Eclipse. On the official page regarding building and flashing using Eclipse it is mentioned there is no official support for CMAKE version yet. So, can you suggest any good and free IDE for CMAKE version for beginners? Also, the third party resources are very limited compared to GNU Make, so is advisable for a beginner like me to continue with CMAKE? [by beginner I mean, I have flashed only Hello World and blink examples I still don't know how to build a project from scratch but want to learn in a few days]

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: Which ESP IDF to use, Legacy vs new?

Postby ESP_Angus » Mon Sep 16, 2019 5:24 am

TheNewStudent wrote:
Sun Sep 15, 2019 3:32 pm
So, can you suggest any good and free IDE for CMAKE version for beginners?
We have some IDE support coming before the ESP-IDF v4.0 release (currently the stable release is v3.3 which still uses GNU Make.) But no official IDE support right now.
TheNewStudent wrote:
Sun Sep 15, 2019 3:32 pm
Also, the third party resources are very limited compared to GNU Make, so is advisable for a beginner like me to continue with CMAKE? [by beginner I mean, I have flashed only Hello World and blink examples I still don't know how to build a project from scratch but want to learn in a few days]
I think probably going back to GNU Make for now is a good choice. You can always convert your project to use the CMake build system at some point in the future.

TheNewStudent
Posts: 3
Joined: Thu Sep 12, 2019 8:32 am

Re: Which ESP IDF to use, Legacy vs new?

Postby TheNewStudent » Wed Sep 18, 2019 8:24 am

ESP_Angus wrote:
Mon Sep 16, 2019 5:24 am
TheNewStudent wrote:
Sun Sep 15, 2019 3:32 pm
So, can you suggest any good and free IDE for CMAKE version for beginners?
We have some IDE support coming before the ESP-IDF v4.0 release (currently the stable release is v3.3 which still uses GNU Make.) But no official IDE support right now.


Thanks for the reply again! After some browsing I found some articles mentioning that Eclipse Photon do support CMAKE and we can use it for ESP-IDF builds for the esp32 boards. Any thoughts on that?
TheNewStudent wrote:
Sun Sep 15, 2019 3:32 pm
Also, the third party resources are very limited compared to GNU Make, so is advisable for a beginner like me to continue with CMAKE? [by beginner I mean, I have flashed only Hello World and blink examples I still don't know how to build a project from scratch but want to learn in a few days]
I think probably going back to GNU Make for now is a good choice. You can always convert your project to use the CMake build system at some point in the future.
Glad to hear that! Recently we flashed the blink example using both the GNU Make and CMAKE, we observed the GNU Make to be slower. Is this observation correct? Is building using CMAKE actually faster? [Experiments conducted on Windows machine]

Who is online

Users browsing this forum: Bing [Bot] and 127 guests