Using ESP32 with Arduino Framework what version IDF am I using and do I need update?

I do see other posts relating to updating the ESP IDF with Arduino framework, but I have literally installed PIO from new (newbie) days ago.
I am using the ledc peripheral and am wondering why the structure definition in MY ledc driver has less parameters than suggested by looking at other posts regarding the ledc driver.
Specifically there is a [ledc_clk_cfg_t] field mentioned for configuring the clock that I do not have in the ledc_timer_config_t structure in my definition header file.
Any explanations appreciated.

When you read through Releases · platformio/platform-espressif32 · GitHub you’ll find that the last arduino core increment was to 1.0.4, which is the latest stable release (see tags at GitHub - espressif/arduino-esp32: Arduino core for the ESP32).

PlatformIO also shows you this at compilation start

PACKAGES:
 - framework-arduinoespressif32 3.10004.201016 (1.0.4)
 - tool-esptoolpy 1.30000.201119 (3.0.0)
 - toolchain-xtensa32 2.50200.80 (5.2.0)

In the Arduino-ESP32 commit history for the tag 1.0.4, you can also see the underlying ESP-IDF version used for the core.

Which is further confirmed if we just write a little firmware…

#include <Arduino.h>

void setup() {
  Serial.begin(115200);
  Serial.println("ESP-IDF version is: " + String(esp_get_idf_version()));
}

void loop() {}

and that prints

ESP-IDF version is: v3.2.3-14-gd3e562907

So if you look at the latest ESP-IDF docs (for probably 4.2) for the LEDC driver, you won’t see those when you use standard Arduino-ESP32 in the latest stable release, which uses 3.2.3.

That shouldn’t be a problem however, if there isn’t a bug in the LEDC driver version that ships with Arduino-ESP32. The docs for the LEDC driver in ESP-IDF at version 3.2.5 (close, but they didn’t have 3.2.3) is at LED Control — ESP-IDF Programming Guide v3.2.5 documentation.

However, Arduino-ESP32 also has a branch which builds on ESP-IDF v4.0 as a base. And PlatformIO can buld that just fine, as a “ESP-IDF base project with the Arduino core component enabled”. See platform-espressif32/examples/espidf-arduino-blink at develop · platformio/platform-espressif32 · GitHub (especially the platformio.ini and CMakeLists.txt files) for that.

As said, I’d recommend to stick to the driver version as currently included in the latest stable Arduino-ESP32, which PlatformIO also uses, unless you absolutely need a bugfix or feature that may be in the newer LEDC driver version in newer ESP-IDF versions. Maybe the ledc_clk_cfg_t you are refering to was just represented differently in older versions, using another structurue or accessed by another function.

Thank you for that comprehensive reply. I’m not sure what my exact problem with led c is yet. I do see that I get a divide by zero error if I dynamically adjust the timer frequency much below 70hz. However I do have a specific need to go lower and was trying to see if the clock source was being changed automatically as I think is possible looking at how some code selects the timer clock source options in the setup structure ( that parameter not being visible in my version).
I will be experimenting more.