Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Program stops responding after I2C errors #35

Closed
camielverdult opened this issue Feb 15, 2021 · 2 comments · Fixed by #36
Closed

Program stops responding after I2C errors #35

camielverdult opened this issue Feb 15, 2021 · 2 comments · Fixed by #36
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@camielverdult
Copy link

camielverdult commented Feb 15, 2021

The firmware crashes/hangs after spitting out ~2 minutes of i2c: i2c_set_pin(825): scl and sda gpio numbers are the same. I suspect this has to do with this. I do not know where to implement this, otherwise I would. More log:

I (1598) sccb: pin_sda 26 pin_scl 27

E (1598) i2c: i2c_param_config(644): i2c clock choice is invalid, please check flag and frequency
E (2618) i2c: i2c_set_pin(825): scl and sda gpio numbers are the same
E (3618) i2c: i2c_set_pin(825): scl and sda gpio numbers are the same

@bkeevil bkeevil added bug Something isn't working help wanted Extra attention is needed labels Feb 23, 2021
@BugerDread
Copy link
Contributor

you need to add "conf.clk_flags = 0;" into components/esp32-camera/driver/sccb.c line 58, the whole init function will look like:

int SCCB_Init(int pin_sda, int pin_scl)
{
    ESP_LOGI(TAG, "pin_sda %d pin_scl %d\n", pin_sda, pin_scl);
#ifdef CONFIG_SCCB_HARDWARE_I2C
    //log_i("SCCB_Init start");
    i2c_config_t conf;
    conf.mode = I2C_MODE_MASTER;
    conf.sda_io_num = pin_sda;
    conf.sda_pullup_en = GPIO_PULLUP_ENABLE;
    conf.scl_io_num = pin_scl;
    conf.scl_pullup_en = GPIO_PULLUP_ENABLE;
    conf.master.clk_speed = SCCB_FREQ;
    conf.clk_flags = 0;

    i2c_param_config(SCCB_I2C_PORT, &conf);
    i2c_driver_install(SCCB_I2C_PORT, conf.mode, 0, 0, 0);
#else
    twi_init(pin_sda, pin_scl);
#endif
    return 0;
}

@BugerDread
Copy link
Contributor

or simply update the camera driver, is fixed in master, they zeroed-out the config using memset first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants