USB JTAG dies when I2C is enabled.

upanie@interia.pl
Posts: 1
Joined: Sun Mar 02, 2025 6:41 am

USB JTAG dies when I2C is enabled.

Postby upanie@interia.pl » Sun Mar 02, 2025 7:33 am

Hi Espressifholics!

I'm trying to use a board like in this link: https://www.waveshare.com/wiki/ESP32-S3-Touch-LCD-4.3
It has 2 USB connectors. One of them is connected the ESP32-S3 USB ports directly and I use it for JTAG flashing and debugging. I'm using ESP-IDF with VSCode. Everything works perfectly fine until I try to use LVGL demo https://www.waveshare.com/wiki/ESP32-S3 ... gl_Porting
Right after the LCD panel is configured the USB gets disconnected from my PC and I can no longer use it for flashing or debugging. To flash it again I have to disconnect the USB cable, press and hold the BOOT button and connect the cable back. Or I can use the second USB but that can be used only for flashing - no debugging there.
Anyway, I narrowed down the problem and it looks like the USB connection dies when the I2C0 for touch panel is configured and activated. I tried to find the reason for that but no luck. The GPIOs are not shared. I'm not sure how the IO MUX works but it looks like there is no conflict between I2C0 and USB/JTAG.
Does anyone know what the problem is? Has anyone experienced that and maybe managed to solve it somehow?

Thanks in advance!
Adam

mldev59
Posts: 2
Joined: Mon Jun 16, 2025 2:44 pm

Re: USB JTAG dies when I2C is enabled.

Postby mldev59 » Tue Jun 17, 2025 12:55 pm

Hi ,

same problem here with Waveshare ESP32-S3-Touch-LCD-7.
Any solution for this ?

Martin

mldev59
Posts: 2
Joined: Mon Jun 16, 2025 2:44 pm

Re: USB JTAG dies when I2C is enabled.

Postby mldev59 » Mon Jun 23, 2025 11:53 am

i must change write_buf = 0x2C; to write_buf = 0x0C; and write_buf = 0x2E; to write_buf = 0x0E;

void waveshare_esp32_s3_touch_reset()
{
uint8_t write_buf = 0x01;
i2c_master_write_to_device(I2C_MASTER_NUM, 0x24, &write_buf, 1, I2C_MASTER_TIMEOUT_MS / portTICK_PERIOD_MS);

// Reset the touch screen. It is recommended to reset the touch screen before using it.
write_buf = 0x2C;
i2c_master_write_to_device(I2C_MASTER_NUM, 0x38, &write_buf, 1, I2C_MASTER_TIMEOUT_MS / portTICK_PERIOD_MS);
esp_rom_delay_us(100 * 1000);
gpio_set_level(GPIO_INPUT_IO_4, 0);
esp_rom_delay_us(100 * 1000);
write_buf = 0x2E;
i2c_master_write_to_device(I2C_MASTER_NUM, 0x38, &write_buf, 1, I2C_MASTER_TIMEOUT_MS / portTICK_PERIOD_MS);
esp_rom_delay_us(200 * 1000);
}

Who is online

Users browsing this forum: Bing [Bot], Bytespider, Google [Bot], Qwantbot, YisouSpider and 4 guests