Wichtige Info

Die Inhalte, die du hier siehst stelle ich dir ohne Werbeanzeigen und ohne Tracking deiner Daten zur Verfügung. Trotzdem muss ich die Server bezahlen sowie Zeit in Recherche, Umsetzung sowie Mail Support stecken.
Um dies leisten zu können, verlinke ich in einigen Artikeln auf die Plattform Amazon. Alle diese Links nennen sich Afiliate Links. Wenn du dir mit diesem Link etwas kaufst, dann erhalte ich eine kleine Provision. Dies ändert jedoch NICHT den Preis, den du bezahlst!
Falls du mich also unterstützen möchtest, kannst du auf den Link zum Produkt klicken und hilfst mir dabei, dieses Hobby weiter zu betreiben.
Da ich Keine Werbung schalte und keine Spenden sammle, ist dies die einzige Möglichkeit, meine Systeme und mich zu finanzieren. Ich hoffe du kannst das verstehen :)



Use ESP32- ESP IDF as SDK


Introduction

For years, I have been passionate about Smarthome and everything about the smallest helpers in life, which can bring many of their real benefits through digital networking. The emerging from the ESP has only further strengthened this interest, as these small microcontrollers have already brought along the most important interfaces such as I2C, Serial uvm., but also in terms of connectivity, for example by WLAN and Bluetooth.

I've always been on ESP8266 based on the fact that this is very favorable and WiFi has integrated, so I have implemented many projects that still work without problems and I have eventually got the idea to build a kind of wrapper operating system that meets the standards, such as a Captive portal, configuration handling, OTA and more for me. I have also done this including a central administrative interface to control versions and firmware distribution comfortably.

A problem has ESP8266 However, which has always been very important to me and also kept me from monetizing my projects. This problem was encryption at hardware level and susceptibility to physical attacks.

Another, but rather small problem is connectivity. Other than ESP32the ESP8266 no Bluetooth but "only" WiFi, which did not seem wise to me in the long term, as it consumes some energy. For this reason, I have been waiting for a suitable successor for years, which I have now also for about 6 months. The ESP32-C6.

But this also presents me with new challenges, with the first I am working on this contribution today - programming itself.

Main part

What draws ESP32-C6 out?

The relatively young ESP32 C6 differs greatly from its predecessors, because it supports ZigBee, Thread and Matter, which makes it a multitool in Smarthome.

Overall, the ESP can communicate via WiFi 6, ZigBee (802.15.4) and Bluetooth 5 LE. The ESP also offers the 802.15.4 standard incl. Bluetooth the Matter Standard, which will slowly but quite safely arrive in the Smarthome world. All this makes the C6 for me, to the counterpart that the ESP8266 was for the Arduino at that time.
Bastlers can now also use Cutting Edge communication technology for private projects.

Finally, it must also be added that in addition to Secure Boot, the C6 also supports 256 bit AES flash encryption, which makes physical attacks significantly more challenging.

What is the problem with ESP32 C6?

My entire projects have always been based on the Arduino Framework, as it makes the development very simple and intuitive. As long as you do not need the latest features and the entire C/C++ standard, it was not a problem either. I've been waiting for six months and so far there's a first draft to be put in place. ESP32 C6 officially support the Arduino Framework. For this reason, I will probably need to use ESP-IDF, as this usually always supports the latest chips immediately.

What is ESP-IDF?

ESP-IDF is the "official" developer framework for the ESP, provided by Espressif (the manufacturer of ESP).

ESP-IDF is a collection of different tools and documentation to program the ESP. At the end of the day, the Arduino Framework also relies on ESP IDF to program the ESP and forms a wrapper.

ESP IDF in VScode install

I've always been using VScodebecause I can map all my applications directly in the program. For this reason, I would also like to use ESP-IDF in conjunction with VSCode.

Fortunately, there is an extension for VSCode that can take over the entire preparatory work.

To install it, simply search for "Espressif" in the Extensions Editor. Once the extension is installed, the new icon (see in the image with me under the extension sign) is selected on the left and you will be welcomed with the installation interface. Then, simply select the "Express Installation" and the extension will take care of the rest.

The first program... Hello World :)

ESP-IDF is a little different than the Arduino Framework. For this reason, I will look at the structure of the projects and what you can find and configure in them.

The most important file is I think the program code itself. This is located in the "main" folder and in the "hello_world_main.c" file. The structure of this file already looks different from Arduino. The "Start Function" here is called, for example, "app_main(void)" and forms the entry at system start.

The code is unfortunately not very well commented, but is quite understandable. If you've ever worked with C, it shouldn't be a problem to understand the code.

Also interesting are the other files.


Back…