esp32-cam-demo icon indicating copy to clipboard operation
esp32-cam-demo copied to clipboard

Latest esp-idf master breaks working camera code that uses the ledc submodule

Open igrr opened this issue 6 years ago • 7 comments

From @buckybots on June 6, 2018 1:44

By reverting esp-idf back to earlier commit, the error does not happen.

The earlier commit where the code was working is : $ git show commit 7d13e3fa6af8c500ac207b2734c2611cf2f24e34 (HEAD) Merge: 22ae5adb 37b98f73 Author: Angus Gratton [email protected] Date: Wed Feb 14 09:45:09 2018 +0800

Bringing esp-idf up to date with: Git checkout master Git pull Git submodule update --init $ git status On branch master Your branch is up to date with 'origin/master'. nothing to commit, working tree clean $ git show commit b2ff235bd003bf3dcb114ff7efe3e0c605c4dd9f (HEAD -> master, origin/master, origin/HEAD) Merge: 8a4c9d7d a8504b96 Author: Angus Gratton [email protected] Date: Tue Jun 5 11:51:35 2018 +0800

Now flashing code with latest esp-idf causes the following errors: (The code uses igrr’s camera code, and appears to be breaking when using the ledc code to create the XCLK PWM output.

Here is info from monitoring the output :

Flashing binaries to serial port COM3 (app at offset 0x10000)... esptool.py v2.3.1 Connecting.... Chip is ESP32D0WDQ6 (revision 1) Features: WiFi, BT, Dual Core ……. D (1202) intr_alloc: Connected src 22 to int 13 (cpu 0) D (1202) camera: Enabling XCLK output E (1202) ledc: ledc_set_duty_with_hpoint(383): hpoint argument is invalid D (1207) ledc: LEDC_PWM CHANNEL 0|GPIO 19|Duty 0001|Time 0 D (1213) camera: Initializing SSCB D (1217) camera: Resetting camera D (1240) camera: Searching for camera address E (1376) test.c: Camera probe failed with error 0x20001

Copied from original issue: espressif/esp-idf#2032

igrr avatar Jun 06 '18 16:06 igrr

Moved here because this is a bug in this project, not IDF. camera_enable_out_clock function should zero-initialize ledc_timer_config_t and ledc_channel_config_t structures.

igrr avatar Jun 06 '18 16:06 igrr

Any suggestions on how this can be solved?

vivian-ng avatar Jul 02 '18 23:07 vivian-ng

I added ch_conf.hpoint = 0; just before err = ledc_channel_config(&ch_conf); in esp_err_t camera_enable_out_clock(camera_config_t* config) found in xclk.c and was able to get the program to run.

vivian-ng avatar Jul 03 '18 04:07 vivian-ng

I have the same issue and it looks like the code is already there. Any other suggestions?

ModMike avatar Sep 06 '18 15:09 ModMike

@vivian-ng I am able to get it to compile if I comment out ch_conf.hpoint = 0; Will this have any negative consequences, like the issue I am having here:

img_1531

ModMike avatar Sep 06 '18 15:09 ModMike

What is hpoint?

janoist1 avatar Sep 19 '18 13:09 janoist1

E (6979) ledc: ledc_set_duty_with_hpoint(383): hpoint argument is invalid

anyone can help me to solve this problem?

I tried to set ch_conf.hpoint = 0; before err = ledc_channel_config(&ch_conf);

but it didn't work

Gabones avatar May 25 '19 04:05 Gabones