Browse Source

Fails with ESP32 (Standard) and not run with ESP-IDF v5.2 (#542)

* Fails with ESP32 (standard) and ESP-IDF v5.2

With IDF 5.2 master it works with esp32-s3 but fails with esp32 standard, and has two problems:

First is that when compiling it does not find the function: ets_delay_us'.
implicit declaration of function 'ets_delay_us';

Second that it fails to initialize xlock.
camera_xclk: ledc_timer_config failed, rc=103

The solution is to add #define ets_delay_us esp_rom_delay_us when the idf version is greater than 5 and initialize the variable timer_conf.deconfigure = false;

* Build fails with ESP32 (Standard) and does not run with ESP-IDF v5.2

With IDF 5.2 master it works with esp32-s3 but fails with esp32 standard, and has two problems:

First is that when compiling it does not find the function: ets_delay_us'.
implicit declaration of function 'ets_delay_us';

Second that it fails to initialize xlock.
camera_xclk: ledc_timer_config failed, rc=103

The solution is to add #define ets_delay_us esp_rom_delay_us when the idf version is greater than 5 and initialize the variable timer_conf.deconfigure = false;

* Fails with ESP32 (Standard) and not run with ESP-IDF v5.2

With IDF 5.2 master it works with esp32-s3 but fails with esp32 standard, and has two problems:

First is that when compiling it does not find the function: ets_delay_us'. implicit declaration of function 'ets_delay_us';

Second that it fails to initialize xlock.
camera_xclk: ledc_timer_config failed, rc=103

The solution is to add #define ets_delay_us esp_rom_delay_us when the idf version is greater than 5 and initialize the variable timer_conf.deconfigure = false;

---------

Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
pull/553/head v2.0.5
Juan Schiavoni 2 years ago committed by GitHub
parent
commit
c0c17bd3de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      target/esp32/ll_cam.c
  2. 4
      target/xclk.c

4
target/esp32/ll_cam.c

@ -44,6 +44,10 @@ static inline int gpio_ll_get_level(gpio_dev_t *hw, int gpio_num) @@ -44,6 +44,10 @@ static inline int gpio_ll_get_level(gpio_dev_t *hw, int gpio_num)
#define gpio_matrix_in(a,b,c) esp_rom_gpio_connect_in_signal(a,b,c)
#endif
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 2)
#define ets_delay_us esp_rom_delay_us
#endif
static const char *TAG = "esp32 ll_cam";
#define I2S_ISR_ENABLE(i) {I2S0.int_clr.i = 1;I2S0.int_ena.i = 1;}

4
target/xclk.c

@ -23,6 +23,10 @@ esp_err_t xclk_timer_conf(int ledc_timer, int xclk_freq_hz) @@ -23,6 +23,10 @@ esp_err_t xclk_timer_conf(int ledc_timer, int xclk_freq_hz)
timer_conf.freq_hz = xclk_freq_hz;
timer_conf.speed_mode = LEDC_LOW_SPEED_MODE;
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 2, 0)
timer_conf.deconfigure = false;
#endif
#if ESP_IDF_VERSION_MAJOR >= 4
timer_conf.clk_cfg = LEDC_AUTO_CLK;
#endif

Loading…
Cancel
Save