M5GFX icon indicating copy to clipboard operation
M5GFX copied to clipboard

ESP-IDF master compilation crashes on one line

Open adokitkat opened this issue 1 year ago • 3 comments

Hello, I just wanted to report a compilation crash due to this line on ESP-IDF master branch:

https://github.com/m5stack/M5GFX/blob/ff11e09ac0bb5ec29433e81abbdc66c26488ba44/src/lgfx/v1/platforms/esp32/common.cpp#L677

module field was removed from i2c_signal_conn_t struct (missing from IDF v5.4 or v5.5, not sure).

adokitkat avatar Nov 05 '24 02:11 adokitkat

Hello, @adokitkat please try develop branch.

lovyan03 avatar Nov 05 '24 02:11 lovyan03

That is a correct fix for previous targets, thanks!

I also want to say you may encounter a problem in the future because the code will probably not work for newer targets (P4, C61, etc.) as periph_module_reset should not be called outside i2c driver and is deprecated and doesn't do anything on new targets as far as I understand.

We should fix this in the IDF though (new public APIs instead of you having to rely on private ones etc.). If you encounter something like this please open an issue in ESP-IDF repo, thanks.

adokitkat avatar Nov 05 '24 02:11 adokitkat

Hi @lovyan03

For some reason (mostly because of hardware design changes), start from esp32p4, functions like periph_module_disable and periph_module_reset are not available. See: https://github.com/espressif/esp-idf/blob/master/components/esp_hw_support/include/esp_private/periph_ctrl.h#L74-L80

If you do want a way to reset the I2C peripheral, there's a low level function: static inline void i2c_ll_reset_register(int i2c_port).

suda-morris avatar Nov 05 '24 02:11 suda-morris