You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
I have searched the issue tracker for a similar issue and not found a similar issue.
IDF version.
v5.2-dev-3318-g8fc8f3f479
Operating System used.
Linux
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
None
What is the expected behavior?
I'm using a little OLED display which is controlled via I2C. With ESP-IDF v5.2 a new I2C driver implementation has been added.
I would expect it to boot correctly.
What is the actual behavior?
This exception is raised at boot time IntegerDivideByZero
Steps to reproduce.
This is my code to install the driver:
#defineEXAMPLE_LCD_PIXEL_CLOCK_HZ (100 * 1000)
#defineEXAMPLE_PIN_NUM_SDA 21
#defineEXAMPLE_PIN_NUM_SCL 22
#defineEXAMPLE_PIN_NUM_RST -1
#defineEXAMPLE_I2C_HW_ADDR 0x3C
// The pixel number in horizontal and vertical#ifCONFIG_EXAMPLE_LCD_CONTROLLER_SSD1306#defineEXAMPLE_LCD_H_RES 128
#defineEXAMPLE_LCD_V_RES 64
#elifCONFIG_EXAMPLE_LCD_CONTROLLER_SH1107#defineEXAMPLE_LCD_H_RES 64
#defineEXAMPLE_LCD_V_RES 128
#endif// Bit number used to represent command and parameter#defineEXAMPLE_LCD_CMD_BITS 8
#defineEXAMPLE_LCD_PARAM_BITS 8
externvoidexample_lvgl_demo_ui(lv_disp_t*disp);
/* The LVGL port component calls esp_lcd_panel_draw_bitmap API for send data tothe screen. There must be called lvgl_port_flush_ready(disp) after eachtransaction to display. The best way is to use on_color_trans_done callback fromesp_lcd IO config structure. In IDF 5.1 and higher, it is solved inside LVGLport component. */staticboolnotify_lvgl_flush_ready(esp_lcd_panel_io_handle_tpanel_io,
esp_lcd_panel_io_event_data_t*edata,
void*user_ctx) {
lv_disp_t*disp= (lv_disp_t*)user_ctx;
lvgl_port_flush_ready(disp);
return false;
}
voidapp_main(void) {
ESP_LOGI(TAG, "Initialize I2C bus");
i2c_master_bus_config_ti2c_mst_config= {
.clk_source=I2C_CLK_SRC_DEFAULT,
.i2c_port=-1,
.scl_io_num=22,
.sda_io_num=21,
.glitch_ignore_cnt=7,
.flags.enable_internal_pullup= true,
};
i2c_master_bus_handle_tbus_handle;
ESP_ERROR_CHECK(i2c_new_master_bus(&i2c_mst_config, &bus_handle));
ESP_LOGI(TAG, "Install panel IO");
esp_lcd_panel_io_handle_tio_handle=NULL;
esp_lcd_panel_io_i2c_config_tio_config= {
.dev_addr=EXAMPLE_I2C_HW_ADDR,
.control_phase_bytes=1, // According to SSD1306 datasheet
.lcd_cmd_bits=EXAMPLE_LCD_CMD_BITS, // According to SSD1306 datasheet
.lcd_param_bits=EXAMPLE_LCD_CMD_BITS, // According to SSD1306 datasheet
.dc_bit_offset=6, // According to SSD1306 datasheet
};
ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c(bus_handle, &io_config, &io_handle));
ESP_LOGI(TAG, "Install SSD1306 panel driver");
esp_lcd_panel_handle_tpanel_handle=NULL;
esp_lcd_panel_dev_config_tpanel_config= {
.bits_per_pixel=1,
.reset_gpio_num=EXAMPLE_PIN_NUM_RST,
};
ESP_ERROR_CHECK(
esp_lcd_new_panel_ssd1306(io_handle, &panel_config, &panel_handle));
ESP_ERROR_CHECK(esp_lcd_panel_reset(panel_handle));
ESP_ERROR_CHECK(esp_lcd_panel_init(panel_handle));
ESP_ERROR_CHECK(esp_lcd_panel_disp_on_off(panel_handle, true));
Build or installation Logs.
I (31) boot: ESP-IDF v5.2-dev-3318-g8fc8f3f479-dirty 2nd stage bootloader
I (31) boot: compile time Oct 31 2023 16:56:55
I (33) boot: Multicore bootloader
I (37) boot: chip revision: v1.0
I (41) boot.esp32: SPI Speed : 40MHz
I (46) boot.esp32: SPI Mode : DIO
I (50) boot.esp32: SPI Flash Size : 2MB
I (55) boot: Enabling RNG early entropy source...
I (60) boot: Partition Table:
I (64) boot: ## Label Usage Type ST Offset Length
I (71) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (79) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (86) boot: 2 factory factory app 00 00 00010000 00100000
I (94) boot: End of partition table
I (98) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=0f874h ( 63604) map
I (129) esp_image: segment 1: paddr=0001f89c vaddr=3ffb0000 size=0077ch ( 1916) load
I (130) esp_image: segment 2: paddr=00020020 vaddr=400d0020 size=2d780h (186240) map
I (202) esp_image: segment 3: paddr=0004d7a8 vaddr=3ffb077c size=01a00h ( 6656) load
I (205) esp_image: segment 4: paddr=0004f1b0 vaddr=40080000 size=0c98ch ( 51596) load
I (236) boot: Loaded app from partition at offset 0x10000
I (236) boot: Disabling RNG early entropy source...
I (248) cpu_start: Multicore app
I (256) cpu_start: Pro cpu start user code
I (256) cpu_start: cpu freq: 160000000 Hz
I (256) cpu_start: Application information:
I (259) cpu_start: Project name: i2c_oled
I (264) cpu_start: App version: v5.2-dev-3318-g8fc8f3f479-dirty
I (271) cpu_start: Compile time: Oct 31 2023 16:56:37
I (278) cpu_start: ELF file SHA256: fb744a267...
I (283) cpu_start: ESP-IDF: v5.2-dev-3318-g8fc8f3f479-dirty
I (290) cpu_start: Min chip rev: v0.0
I (295) cpu_start: Max chip rev: v3.99
I (300) cpu_start: Chip rev: v1.0
I (304) heap_init: Initializing. RAM available for dynamic allocation:
I (312) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (318) heap_init: At 3FFBADF8 len 00025208 (148 KiB): DRAM
I (324) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (330) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (337) heap_init: At 4008C98C len 00013674 (77 KiB): IRAM
I (344) spi_flash: detected chip: generic
I (347) spi_flash: flash io: dio
W (351) spi_flash: Detected size(4096k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (365) main_task: Started on CPU0
I (375) main_task: Calling app_main()
I (375) example: Initialize I2C bus
I (375) gpio: GPIO[21]| InputEn: 1| OutputEn: 1| OpenDrain: 1| Pullup: 1| Pulldown: 0| Intr:0
I (385) gpio: GPIO[22]| InputEn: 1| OutputEn: 1| OpenDrain: 1| Pullup: 1| Pulldown: 0| Intr:0
I (395) example: Install panel IO
I (395) example: Install SSD1306 panel driver
Guru Meditation Error: Core 0 panic'ed (IntegerDivideByZero). Exception was unhandled.
Core 0 register dump:
PC : 0x400ef3f7 PS : 0x00060c33 A0 : 0x800ec986 A1 : 0x3ffbce20
0x400ef3f7: i2c_ll_master_cal_bus_clk at /home/cosmin/esp/esp-idf/components/hal/esp32/include/hal/i2c_ll.h:79
(inlined by) i2c_hal_set_bus_timing at /home/cosmin/esp/esp-idf/components/hal/i2c_hal.c:29
A2 : 0x3ffbe204 A3 : 0x00000000 A4 : 0x00000004 A5 : 0x04c4b400
A6 : 0xb33fffff A7 : 0xb33fffff A8 : 0x00000000 A9 : 0x3ffbce10
A10 : 0x00000001 A11 : 0x00000000 A12 : 0x00000000 A13 : 0x00000000
A14 : 0x3ffdfff8 A15 : 0x3ffbe3c0 SAR : 0x00000020 EXCCAUSE: 0x00000006
EXCVADDR: 0x00000000 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0x00000000
0x4000c2e0: memcpy in ROM
0x4000c2f6: memcpy in ROM
Backtrace: 0x400ef3f4:0x3ffbce20 0x400ec983:0x3ffbce60 0x400ecab3:0x3ffbce90 0x400ed3e8:0x3ffbcec0 0x400d66c7:0x3ffbcf20 0x400d6739:0x3ffbcf70 0x400d6556:0x3ffbcf90 0x400d6a32:0x3ffbcfc0 0x400d6e5d:0x3ffbd000 0x400d5d49:0x3ffbd030 0x400fcecb:0x3ffbd0f0 0x400868a1:0x3ffbd120
0x400ef3f4: i2c_hal_set_bus_timing at /home/cosmin/esp/esp-idf/components/hal/i2c_hal.c:28
0x400ec983: s_i2c_transaction_start at /home/cosmin/esp/esp-idf/components/driver/i2c/i2c_master.c:490 (discriminator 2)
0x400ecab3: s_i2c_synchronous_transaction at /home/cosmin/esp/esp-idf/components/driver/i2c/i2c_master.c:772
0x400ed3e8: i2c_master_transmit at /home/cosmin/esp/esp-idf/components/driver/i2c/i2c_master.c:982
0x400d66c7: panel_io_i2c_tx_buffer at /home/cosmin/esp/esp-idf/components/esp_lcd/src/esp_lcd_panel_io_i2c_v2.c:176
0x400d6739: panel_io_i2c_tx_param at /home/cosmin/esp/esp-idf/components/esp_lcd/src/esp_lcd_panel_io_i2c_v2.c:200
0x400d6556: esp_lcd_panel_io_tx_param at /home/cosmin/esp/esp-idf/components/esp_lcd/src/esp_lcd_panel_io.c:23 (discriminator 2)
0x400d6a32: panel_ssd1306_init at /home/cosmin/esp/esp-idf/components/esp_lcd/src/esp_lcd_panel_ssd1306.c:141
0x400d6e5d: esp_lcd_panel_init at /home/cosmin/esp/esp-idf/components/esp_lcd/src/esp_lcd_panel_ops.c:22 (discriminator 2)
0x400d5d49: app_main at /home/cosmin/esp/esp-idf/examples/peripherals/lcd/i2c_oled/main/i2c_oled_example_main.c:101 (discriminator 2)
0x400fcecb: main_task at /home/cosmin/esp/esp-idf/components/freertos/app_startup.c:208 (discriminator 13)
0x400868a1: vPortTaskWrapper at /home/cosmin/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:162
More Information.
No response
The text was updated successfully, but these errors were encountered:
github-actionsbot
changed the title
Panic when installing SSD1306 panel driver with new I2C driver
Panic when installing SSD1306 panel driver with new I2C driver (IDFGH-11469)
Nov 16, 2023
Answers checklist.
IDF version.
v5.2-dev-3318-g8fc8f3f479
Operating System used.
Linux
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
None
What is the expected behavior?
I'm using a little OLED display which is controlled via I2C. With ESP-IDF v5.2 a new I2C driver implementation has been added.
I would expect it to boot correctly.
What is the actual behavior?
This exception is raised at boot time
IntegerDivideByZero
Steps to reproduce.
This is my code to install the driver:
Build or installation Logs.
More Information.
No response
The text was updated successfully, but these errors were encountered: