Skip to content

Waveshare ESP32-P4-NANO dev board MIPI-DSI LCD issue #205

@RobCrown82

Description

@RobCrown82

The sample Arduino projects for the Waveshare ESP32-P4-NANO dev board don't properly initialize the MIPI-DSI LCD display. The display doesn't turn on (no backlight, black screen) so the code always jams in the panel_jd9365_init() function of the esp_lcd_jd9365.c file when it tries to read the LCD ID.

The panel does initialize properly if I load the waveshare sample projects using the ESP-IDF V5.4.1 directly (through VS code). I've examined their esp_lcd_jd9365.c file and there are some i2c commands being sent to the panel in the esp_lcd_new_panel_jd9365() function that are missing in the ESP32_Display_Panel Arduino library. Those commands are in some way responsible for turning on the display. Can you please advise on how to fix this issue in your library.

I've pasted the missing i2c code below.

i2c_config_t conf = {
.mode = I2C_MODE_MASTER,
.sda_io_num = 7,
.sda_pullup_en = GPIO_PULLUP_ENABLE,
.scl_io_num = 8,
.scl_pullup_en = GPIO_PULLUP_ENABLE,
.master.clk_speed = 100000,
};

i2c_bus_handle_t i2c0_bus = i2c_bus_create(I2C_NUM_1, &conf);
i2c_bus_device_handle_t i2c0_device1 = i2c_bus_device_create(i2c0_bus, 0x45, 0);

uint8_t data = 0x11;
i2c_bus_write_bytes(i2c0_device1, 0x95, 1, &data);
data = 0x17;
i2c_bus_write_bytes(i2c0_device1, 0x95, 1, &data);
data = 0x00;
i2c_bus_write_bytes(i2c0_device1, 0x96, 1, &data);
vTaskDelay(pdMS_TO_TICKS(100));
data = 0xFF;
i2c_bus_write_bytes(i2c0_device1, 0x96, 1, &data);

i2c_bus_device_delete(&i2c0_device1);
// i2c_bus_delete(&i2c0_bus);

vTaskDelay(pdMS_TO_TICKS(1000));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions