Hi - I'm struggling to understand the conceptual and nomenclatural layers at work in terms of the different chips, platforms, IDEs, devkits, etc.
I understand that there are chips or SoC modules that live on various boards/devkits... The Arduino IDE has some array of libraries that are used when compiling code, and built-in tools to upload that code onto the SoCs.
But I'm fuzzy about all the overlaps and the naming conventions, etc.
E.g. what is the "ESP32 Arduino Core" -- this is apparently code written by Espressif to support ESP32 SoCs, but what does it have to do with Arduino? Is it only applicable to Arduino boards that use ESP32 chips? If I'm using an ESP32 devkit from Espressif (i.e. not Arduino), can I use the Arduino IDE + ESP32 Arduino Core to program it? What are the alternative options?
Is the ESP-IDF essentially the same idea as the ESP32 Arduino Core? A set of libraries to enable coding for the ESP32 family, but for other IDEs? And in that case, could you use that with some other IDE to program either an ESP32 devkit, or an Arduino board that uses an ESP32?
every MCU manufacturer has a toolchain and some software framework for their MCU.
toolchain is compiler, linker and associated tools usually based on GCC.
framework is a software support. at least header files with registers definitions, but most manufactures provide C functions to work with internal peripherals of the MCU.
these frameworks have carious generic or specific names like SDK, HAL, FSP, IDF, ... usually used together with the name of the manufacturer (Espressif IDF, Renesas FSP, ...).
Arduino originally supported only AVR, but over the years it evolved to separate the Arduino build system from specific boards support. now anybody can create a new boards support package (a.k.a. platform) compatible with Arduino build system.
These boards support packages always use the toolchain and framework provided by the manufacturer of the MCU. So Espressiif's Arduino boards package for esp32 uses the Espressif IDF. Some MCU manufacturers create Arduino boards packages, sometimes the boards package is created and maintained by community and of course the Arduino company makes some boards packages for their boards too.
Arduino defines a language, a super-set of C++ which the boards support packages implement over the specific framework so for example analogWrite works the same way for all boards with MCU from different manufacturers. This part is nicknamed 'core'. We don't call it a 'library' to avoid confusion with libraries.
So does the ESP32 Arduino Core only apply to Arduino ESP32 boards, or does it cover any board that has an ESP32 on it (e.g. ESP32-DevKitC from Espressif)? The documentation only specifies compatibility with chips, which implies that any board with an ESP32 would work in the Arduino IDE with this core... is that correct?
Another example: If I wanted to program an Arduino ESP32 board using Eclipse, is it possible? Would the Arduino ESP32 Core be required? I know there is an Eclipse plugin for ESP-IDF, but I'm still not clear whether the Arduino-specific core needs to be involved.
If I am programming an Espressif board (e.g. ESP32-DevKitC) using the ESP-IDF plugin in Eclipse, will I have the "pinMode" and "analogWrite" commands I am used to on Arduino, or are those unique to the Arduino C++ superset? (I don't see them in the documentation.)
What is referred to as "Arduino" actually has three part:
A set of hardware boards manufactured by the Arduino Company (and occasional partners.)
A set of software libraries providing certain standard functionality (digitalWrite(), pinMode(), etc.)
An "Integrated Development Environment" (IDE) that provides an editor, compilers, logic that figures out how to build source code into binaries, a method of uploading the binaries to one of the boards, a library manager for extending software functionality, and a "board manager" for extending functionality to additional hardware.
a "Core" is the combination of compilers and libraries needed to support a particular "set" of boards. For instance, the "Arduino AVR core" supports all of the Arduino-manufactured boards that use an AVR CPU.
Thanks to the "board manager", it is relatively easy to add additional "cores" that support other boards, including boards not manufactured by Arduino and even CPUs that are not used on any Arduino-manufactured boards. Exactly how these "3rd-party" cores work is up to whoever wrote them. The ESP32 cores happen to be built "on top of" the Espressif SDK.
You can have several cores that support the same CPUs. For example, "minicore" from MCUDude supports the same ATmega328p used on the Uno, but also supports additional AVRs and configurations (eg clock rates) that are not supported by the Arduino-provided core.
ESP32 is in a similar state, Arduino sells the "Nano ESP32" and implements an ESP32 Core that supports ONLY that board. Espressif also provides and ESP32 core for the Arduino IDE (which you linked in the OP), and it supports MANY ESP32 boards and modules.
It supports the Arduino libraries and APIs. Or at least most of them, and interacts "correctly" with the Arduino IDE.
"Same idea"? I guess. It provides libraries for making it easier to program the ESP32, but it does NOT support the Arduino APIs and functions.
The pieces that make up "Arduino" can all be replaced with other software. There is nothing very magic about the IDE; the compilers it uses are pretty standard stuff (gcc, g++), as are the upload protocols. So you can (at least theoretically) get the Arduino API Library functions from a "core" and link them in using some other IDE and/or build environment.
So, I'll attempt to answer my own questions, please tell me if I make a mistake:
Yes -- that seems correct, assuming that the core was built to support whatever module is on the board, which seems a relatively safe assumption but in practice it could be possible that Espressif failed to include support for a chip or module in their core. Judging from the docs, it seems like it will Just Work.
The Arduino core is not required. You can use the ESP-IDF plugin in eclipse to program an Arduino ESP32 board. Without the Arduino core, though, you will not have access to pinMode(), etc., and will need to use the API specified by ESP-IDF.
You will not.
New question: I'm considering using vscode + platformIO to program ESP32 boards. As far as I understand so far, that means I'm outside of the Arduino ecosystem, and would not have access to pinMode() and so forth. However all the examples I see do "#include <Arduino.h>" and use pinMode() et al. What exactly is going on there? Is Arduino.h just a way to get the Arduino language extensions into C++ for coding convenience?