Products > Embedded Computing

ESP32 - Arduino framework vs ESP32-IDF?

(1/1)

aneevuser:
I'm intending to develop a small project on an ESP32 board, and am planning to use VSCode+PlatformIO, with FreeRTOS.

I seem to have the option of choosing to create a project using the Arduino framework or ESP32-IDF, but it's not clear to me what the pros and cons are here.

For example, if I were to choose the Arduino framework, can I still freely make calls to the underlying ESP32-IDF code base, or are there strange and ill-documented problems that can arise were I to do that?

One point that strikes me: it seems that there are many more online resources for Arduino development (e.g. how does one assign an int. handler, configure an IO pin etc) and more people familiar with it, but I'm worried about being trapped in an Arduino environment when I suddenly find that I need access to ESP32-native features that haven't been translated into Arduino-speak.

Anyone with any useful experience to share?

DavidAlfa:
Try starting a DMA  memory transfer? Setting up the LCD peripheral? Bluetooth? Nope, not in Arduino.
Else than some basic SPI, UART and few other peripherals, Arduino framework lacks a lot of hardware functionality, which IDF has.

Arduino allows basic working in very few steps, which is fine for starting, but you won't get far.
See how, for example, LCDs are usually painfully slow.
Zero hardware-optimized libraries, everything is pretty much generic, software-based, no DMA, no hardware acceleration...

globoy:
You can make IDF calls from within the Arduino environment.  You can use both cores, create FreeRTOS tasks and use the various native libraries.  You do have to worry on occasion if you use both the Arduino compatible calls and a native API for the same peripheral.  I would highly encourage you to look through the Arduino compatibility layer Espressif wrote.  It's fairly straightforward and reasonably done.  You can find it if you drill down into your Arduino installation or just search github for ESP32 Arduino.  Knowing it or at least knowing where to look in it is the best way to answer questions about it and look for interoperability issues.

I've written a fair bit of code using both environments.  Depending on your needs the Arduino environment may be just fine.  Very nice to be able to do things like create a web server with just a few lines of code.   On the other hand you might find you need the native (and more complex) API for higher performance or for some things that aren't implemented in the Arduino API.  If you are planning to share your project with others then using Arduino will make that much easier for them.  I've found that relatively few people who aren't already familiar with the IDF are willing to use it just to compile someone else's project.

Navigation

[0] Message Index

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod