[SOLVED] ESP32P4 Factory example not working (I2C) problem

esperiment
Posts: 6
Joined: Mon Dec 02, 2024 5:25 pm

[SOLVED] ESP32P4 Factory example not working (I2C) problem

Postby esperiment » Mon Dec 02, 2024 5:56 pm

Hi, recently I got a P4 function board. Unfortunately, the pre-programmed factory example (brookesia) did not work: display rendered fine, but no touch..

Then I updated IDF (I'm on f420609c33 now, with Win11) and tried to compile the examples myself to see if that would help. It didn't :(

When I attach with idf.py monitor I get the following:

Code: Select all

ESP-ROM:esp32p4-eco2-20240710
Build:Jul 10 2024
rst:0x1 (POWERON),boot:0x30f (SPI_FAST_FLASH_BOOT)
SPI mode:DIO, clock div:1
load:0x4ff33ce0,len:0x17a0
load:0x4ff2abd0,len:0xf24
load:0x4ff2cbd0,len:0x3408
entry 0x4ff2abda
I (25) boot: ESP-IDF v5.4-dev-4375-gf420609c33 2nd stage bootloader
I (26) boot: compile time Dec  1 2024 23:53:40
I (26) boot: Multicore bootloader
I (29) boot: chip revision: v1.0
I (30) boot: efuse block revision: v0.1
I (34) qio_mode: Enabling default flash chip QIO
I (38) boot.esp32p4: SPI Speed      : 80MHz
I (42) boot.esp32p4: SPI Mode       : QIO
I (46) boot.esp32p4: SPI Flash Size : 16MB
I (50) boot: Enabling RNG early entropy source...
I (54) boot: Partition Table:
I (57) boot: ## Label            Usage          Type ST Offset   Length
I (63) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (70) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (76) boot:  2 factory          factory app      00 00 00010000 00900000
I (83) boot:  3 storage          Unknown data     01 82 00910000 00400000
I (90) boot: End of partition table
I (92) esp_image: segment 0: paddr=00010020 vaddr=481a0020 size=38cf24h (3723044) map
I (669) esp_image: segment 1: paddr=0039cf4c vaddr=30100000 size=0002ch (    44) load
I (671) esp_image: segment 2: paddr=0039cf80 vaddr=3010002c size=0003ch (    60) load
I (674) esp_image: segment 3: paddr=0039cfc4 vaddr=4ff00000 size=03054h ( 12372) load
I (684) esp_image: segment 4: paddr=003a0020 vaddr=48000020 size=193e70h (1654384) map
I (942) esp_image: segment 5: paddr=00533e98 vaddr=4ff03054 size=17ac4h ( 96964) load
I (961) esp_image: segment 6: paddr=0054b964 vaddr=4ff1ab80 size=036ech ( 14060) load
I (965) esp_image: segment 7: paddr=0054f058 vaddr=50108080 size=0001ch (    28) load
I (972) boot: Loaded app from partition at offset 0x10000
I (972) boot: Disabling RNG early entropy source...
I (986) hex_psram: vendor id    : 0x0d (AP)
I (987) hex_psram: Latency      : 0x01 (Fixed)
I (987) hex_psram: DriveStr.    : 0x00 (25 Ohm)
I (987) hex_psram: dev id       : 0x03 (generation 4)
I (992) hex_psram: density      : 0x07 (256 Mbit)
I (997) hex_psram: good-die     : 0x06 (Pass)
I (1001) hex_psram: SRF          : 0x02 (Slow Refresh)
I (1006) hex_psram: BurstType    : 0x00 ( Wrap)
I (1010) hex_psram: BurstLen     : 0x03 (2048 Byte)
I (1014) hex_psram: BitMode      : 0x01 (X16 Mode)
I (1019) hex_psram: Readlatency  : 0x04 (14 cycles@Fixed)
I (1024) hex_psram: DriveStrength: 0x00 (1/1)
I (1028) MSPI DQS: tuning success, best phase id is 2
I (1206) MSPI DQS: tuning success, best delayline id is 11
I esp_psram: Found 32MB PSRAM device
I esp_psram: Speed: 200MHz
I (1382) mmu_psram: .rodata xip on psram
I (1463) mmu_psram: .text xip on psram
I (1463) hex_psram: psram CS IO is dedicated
I (1463) cpu_start: Multicore app
I (1810) esp_psram: SPI SRAM memory test OK
I (1819) cpu_start: Pro cpu start user code
I (1820) cpu_start: cpu freq: 360000000 Hz
I (1820) app_init: Application information:
I (1820) app_init: Project name:     esp_brookesia_demo
I (1825) app_init: App version:      1.0.0
I (1829) app_init: Compile time:     Dec  1 2024 23:50:54
I (1834) app_init: ELF file SHA256:  5f8b4aaf4...
I (1838) app_init: ESP-IDF:          v5.4-dev-4375-gf420609c33
I (1844) efuse_init: Min chip rev:     v0.1
I (1848) efuse_init: Max chip rev:     v1.99
I (1852) efuse_init: Chip rev:         v1.0
I (1856) heap_init: Initializing. RAM available for dynamic allocation:
I (1862) heap_init: At 4FF23990 len 00017630 (93 KiB): RAM
I (1867) heap_init: At 4FF3AFC0 len 00004BF0 (18 KiB): RAM
I (1872) heap_init: At 4FF40000 len 00040000 (256 KiB): RAM
I (1878) heap_init: At 5010809C len 00007F64 (31 KiB): RTCRAM
I (1883) heap_init: At 30100068 len 00001F98 (7 KiB): TCM
I (1888) esp_psram: Adding pool of 23808K of PSRAM memory to heap allocator
I (1895) spi_flash: detected chip: generic
I (1899) spi_flash: flash io: qio
I (1902) host_init: ESP Hosted : Host chip_ip[18]
I (1938) H_API: ESP-Hosted starting. Hosted_Tasks: prio:23, stack: 5120 RPC_task_stack: 5120
sdio_mempool_create free:24501904 min-free:24501904 lfb-def:24117248 lfb-8bit:24117248

I (1943) gpio: GPIO[18]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (1952) gpio: GPIO[19]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (1960) gpio: GPIO[14]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (1969) gpio: GPIO[15]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (1977) gpio: GPIO[16]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (1985) gpio: GPIO[17]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (1994) H_API: ** add_esp_wifi_remote_channels **
I (1998) transport: Add ESP-Hosted channel IF[1]: S[0] Tx[0x4800d018] Rx[0x4801a6dc]
I (2006) transport: Add ESP-Hosted channel IF[2]: S[0] Tx[0x4800cf5e] Rx[0x4801a6dc]
I (2014) main_task: Started on CPU0
I (2017) main_task: Calling app_main()
I (2103) ESP32_P4_EV: Partition size: total: 3848081, used: 3217067
I (2103) main: SPIFFS mount successfully
W (2103) i2c.master: Please check pull-up resistances whether be connected properly. Otherwise unexpected behavior would happen. For more detailed information, please read docs
W (2117) i2s_common: dma frame num is adjusted to 256 to align the dma buffer with 64, bufsize = 512
W (2126) i2s_common: dma frame num is adjusted to 256 to align the dma buffer with 64, bufsize = 512
I (2139) ES8311: Work in Slave mode
I (2142) gpio: GPIO[53]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (2150) ES8311: Work in Slave mode
I (2153) gpio: GPIO[53]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (2158) I2S_IF: channel mode 0 bits:16/16 channel:2 mask:3
I (2163) I2S_IF: STD Mode 1 bits:16/16 channel:2 sample_rate:16000 mask:3
I (2169) I2S_IF: channel mode 0 bits:16/16 channel:2 mask:3
I (2175) I2S_IF: STD Mode 0 bits:16/16 channel:2 sample_rate:16000 mask:3
I (2196) Adev_Codec: Open codec device OK
I (2196) I2S_IF: channel mode 0 bits:16/16 channel:2 mask:3
I (2196) I2S_IF: STD Mode 0 bits:16/16 channel:2 sample_rate:16000 mask:3
I (2214) Adev_Codec: Open codec device OK
I (2214) LVGL: Starting LVGL task
W (2214) ledc: GPIO 26 is not usable, maybe conflict with others
I (2215) ESP32_P4_EV: MIPI DSI PHY Powered on
I (2221) ESP32_P4_EV: Install MIPI DSI LCD control panel
I (2224) ESP32_P4_EV: Install EK79007 LCD control panel
I (2229) ek79007: version: 1.0.1
I (2232) gpio: GPIO[27]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (2404) ESP32_P4_EV: Display initialized
E (2405) lcd_panel: esp_lcd_panel_swap_xy(50): swap_xy is not supported by this panel
W (2405) GT911: Unable to initialize the I2C address
I (2409) GT911: TouchPad_ID:0x39,0x31,0x31
I (2412) GT911: TouchPad_Config_Version:89
I (2416) ESP32_P4_EV: Setting LCD backlight: 100%
[WARN] [esp_brookesia_core.cpp:46](getDisplaySize): Display is not set, use default display
[INFO] [esp_brookesia_core.cpp:204](beginCore): Library version: 0.4.1
[WARN] [esp_brookesia_phone_manager.cpp:72](begin): No touch device is set, try to use default touch device
[WARN] [esp_brookesia_phone_manager.cpp:76](begin): Using default touch device(@0x0x4878a35c)
I (2518) file_iterator: File : BGM 1.mp3
I (2524) file_iterator: File : BGM 2.mp3
I (2534) file_iterator: File : For Elise.mp3
I (2540) file_iterator: File : Something.mp3
I (2546) file_iterator: File : Waka Waka.mp3
I (2547) EUI_Setting: Load ble_en: 0
I (2547) EUI_Setting: Load brightness: 20
I (2548) EUI_Setting: Load volume: 60
I (2549) EUI_Setting: Load wifi_en: 0
I (2553) bsp_extra_board: Setting volume: 60
I (2557) ESP32_P4_EV: Setting LCD backlight: 20%
I (2563) transport: Attempt connection with slave: retry[0]
I (2566) transport: Reset slave using GPIO[54]
I (2571) os_wrapper_esp: GPIO [54] configured
I (2575) gpio: GPIO[54]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (2609) file_iterator: File : excellent.mp3
I (2609) file_iterator: File : good.mp3
I (2610) file_iterator: File : normal.mp3
I (2610) file_iterator: File : weak.mp3
I (2613) Game2048: Load score: 0
W (2617) esp_video_init: ISP config is null and use default IPA config
E (2622) i2c.master: I2C transaction unexpected nack detected
E (2627) i2c.master: s_i2c_synchronous_transaction(917): I2C transaction failed
E (2634) i2c.master: i2c_master_transmit_receive(1200): I2C transaction failed
E (2641) sccb_i2c: s_sccb_i2c_transmit_receive_reg_a16v8(112): faled to transmit receive
E (2649) sc2336: Get sensor ID failed
E (2652) esp_video_init: failed to detect MIPI-CSI camera
E (2658) Camera: video main init failed with error 0xffffffff
E (2663) app_video: Open video failed
E (2666) Camera: video cam open failed
I (2682) app_camera_pipeline: new elements[0]:0x48b10680, internal:0
I (2682) app_camera_pipeline: new pipeline 0x48cd27e8, elem_num:1
I (2683) app_camera_pipeline: new elements[0]:0x48cd2830, internal:1
I (2689) app_camera_pipeline: new pipeline 0x48cd280c, elem_num:1
I (2696) main_task: Returned from app_main()
E (2714) i2c.master: I2C transaction unexpected nack detected
E (2714) i2c.master: s_i2c_synchronous_transaction(917): I2C transaction failed
E (2715) i2c.master: i2c_master_transmit_receive(1200): I2C transaction failed
E (2722) lcd_panel.io.i2c: panel_io_i2c_rx_buffer(145): i2c transaction failed
E (2729) GT911: esp_lcd_touch_gt911_read_data(220): I2C read error!
E (2796) i2c.master: I2C transaction unexpected nack detected
E (2796) i2c.master: s_i2c_synchronous_transaction(917): I2C transaction failed
E (2797) i2c.master: i2c_master_transmit_receive(1200): I2C transaction failed
E (2804) lcd_panel.io.i2c: panel_io_i2c_rx_buffer(145): i2c transaction failed
E (2811) GT911: esp_lcd_touch_gt911_read_data(220): I2C read error!
E (2838) i2c.master: I2C transaction unexpected nack detected
E (2838) i2c.master: s_i2c_synchronous_transaction(917): I2C transaction failed
E (2839) i2c.master: i2c_master_transmit_receive(1200): I2C transaction failed
E (2846) lcd_panel.io.i2c: panel_io_i2c_rx_buffer(145): i2c transaction failed
E (2853) GT911: esp_lcd_touch_gt911_read_data(220): I2C read error!
E (2869) i2c.master: I2C transaction unexpected nack detected
E (2869) i2c.master: s_i2c_synchronous_transaction(917): I2C transaction failed
E (2872) i2c.master: i2c_master_transmit_receive(1200): I2C transaction failed
E (2878) lcd_panel.io.i2c: panel_io_i2c_rx_buffer(145): i2c transaction failed
E (2885) GT911: esp_lcd_touch_gt911_read_data(220): I2C read error!
E (2896) i2c.master: I2C transaction unexpected nack detected
E (2897) i2c.master: s_i2c_synchronous_transaction(917): I2C transaction failed
E (2904) i2c.master: i2c_master_transmit_receive(1200): I2C transaction failed
E (2911) lcd_panel.io.i2c: panel_io_i2c_rx_buffer(145): i2c transaction failed
E (2918) GT911: esp_lcd_touch_gt911_read_data(220): I2C read error!
E (2929) i2c.master: I2C transaction unexpected nack detected
E (2929) i2c.master: s_i2c_synchronous_transaction(917): I2C transaction failed
E (2936) i2c.master: i2c_master_transmit_receive(1200): I2C transaction failed
E (2943) lcd_panel.io.i2c: panel_io_i2c_rx_buffer(145): i2c transaction failed
E (2950) GT911: esp_lcd_touch_gt911_read_data(220): I2C read error!
E (2961) i2c.master: I2C transaction unexpected nack detected
E (2962) i2c.master: s_i2c_synchronous_transaction(917): I2C transaction failed
E (2969) i2c.master: i2c_master_transmit_receive(1200): I2C transaction failed
E (2976) lcd_panel.io.i2c: panel_io_i2c_rx_buffer(145): i2c transaction failed
E (2983) GT911: esp_lcd_touch_gt911_read_data(220): I2C read error!
E (2994) i2c.master: I2C transaction unexpected nack detected
E (2994) i2c.master: s_i2c_synchronous_transaction(917): I2C transaction failed
E (3001) i2c.master: i2c_master_transmit_receive(1200): I2C transaction failed
E (3008) lcd_panel.io.i2c: panel_io_i2c_rx_buffer(145): i2c transaction failed
E (3015) GT911: esp_lcd_touch_gt911_read_data(220): I2C read error!
E (3026) i2c.master: I2C transaction unexpected nack detected
E (3026) i2c.master: s_i2c_synchronous_transaction(917): I2C transaction failed
E (3033) i2c.master: i2c_master_transmit_receive(1200): I2C transaction failed
E (3040) lcd_panel.io.i2c: panel_io_i2c_rx_buffer(145): i2c transaction failed
E (3047) GT911: esp_lcd_touch_gt911_read_data(220): I2C read error!
E (3058) i2c.master: I2C transaction unexpected nack detected
E (3059) i2c.master: s_i2c_synchronous_transaction(917): I2C transaction failed
E (3066) i2c.master: i2c_master_transmit_receive(1200): I2C transaction failed
E (3073) lcd_panel.io.i2c: panel_io_i2c_rx_buffer(145): i2c transaction failed
E (3080) GT911: esp_lcd_touch_gt911_read_data(220): I2C read error!
E (3091) i2c.master: I2C transaction unexpected nack detected
E (3091) i2c.master: s_i2c_synchronous_transaction(917): I2C transaction failed
E (3098) i2c.master: i2c_master_transmit_receive(1200): I2C transaction failed
E (3105) lcd_panel.io.i2c: panel_io_i2c_rx_buffer(145): i2c transaction failed
E (3112) GT911: esp_lcd_touch_gt911_read_data(220): I2C read error!
E (3123) i2c.master: I2C transaction unexpected nack detected
E (3123) i2c.master: s_i2c_synchronous_transaction(917): I2C transaction failed
E (3131) i2c.master: i2c_master_transmit_receive(1200): I2C transaction failed
E (3137) lcd_panel.io.i2c: panel_io_i2c_rx_buffer(145): i2c transaction failed
E (3144) GT911: esp_lcd_touch_gt911_read_data(220): I2C read error!
E (3155) i2c.master: I2C transaction unexpected nack detected
E (3156) i2c.master: s_i2c_synchronous_transaction(917): I2C transaction failed
E (3163) i2c.master: i2c_master_transmit_receive(1200): I2C transaction failed
E (3170) lcd_panel.io.i2c: panel_io_i2c_rx_buffer(145): i2c transaction failed
The last lines repeat.

This is the same as with the pre-programmed factory example.

Is there something I can try? Thanks!
Last edited by esperiment on Sun Dec 22, 2024 11:33 am, edited 1 time in total.

esperiment
Posts: 6
Joined: Mon Dec 02, 2024 5:25 pm

Re: ESP32P4 Factory example not working (I2C) problem

Postby esperiment » Mon Dec 09, 2024 6:42 pm

Does no one have an idea or suggestion?

esperiment
Posts: 6
Joined: Mon Dec 02, 2024 5:25 pm

Re: ESP32P4 Factory example not working (I2C) problem

Postby esperiment » Fri Dec 13, 2024 6:37 pm

Can maybe someone from Espressif shed some light on this?

As I wrote initially, the factory example did not work properly, i.e. no touch events.
I assume that this is not supposed to happen?

I get that my recompilation attempts are my own responsibility, but I'm not very experienced with the ESP32 series.
If I made a silly mistake, please point it out.

Thanks again.

ESP_Sprite
Posts: 9833
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32P4 Factory example not working (I2C) problem

Postby ESP_Sprite » Sat Dec 14, 2024 9:09 am

I think there's a little 6- or 8-pin header on the back of the LCD board. One of the pins is the reset for the touchscreen. Maybe connect that to +3.3V?

esperiment
Posts: 6
Joined: Mon Dec 02, 2024 5:25 pm

Re: ESP32P4 Factory example not working (I2C) problem

Postby esperiment » Sat Dec 14, 2024 11:42 am

Thanks for the suggestion. I tried, but sadly there were no changes, i.e. display is on but no touch events go through.

There is wiring done according to https://github.com/espressif/esp-dev-ki ... requisites, that is, PWM of the LCD goes to IO26 and RST of the LCD goes to IO27 of the function board.

There is this part in the logs

Code: Select all

[WARN] [esp_brookesia_core.cpp:46](getDisplaySize): Display is not set, use default display
[INFO] [esp_brookesia_core.cpp:204](beginCore): Library version: 0.4.1
[WARN] [esp_brookesia_phone_manager.cpp:72](begin): No touch device is set, try to use default touch device
[WARN] [esp_brookesia_phone_manager.cpp:76](begin): Using default touch device(@0x0x4878a35c)
which looks suspicious.

Above that, there is

Code: Select all

W (2103) i2c.master: Please check pull-up resistances whether be connected properly. Otherwise unexpected behavior would happ
en. For more detailed information, please read docs
Unfortunately, I cannot fully compare my output to the reference output from the above Github link, since that part is cut off.

Any thoughts?

ESP_Sprite
Posts: 9833
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32P4 Factory example not working (I2C) problem

Postby ESP_Sprite » Sun Dec 15, 2024 5:40 am

Maybe you need to configure stuff in menuconfig?

esperiment
Posts: 6
Joined: Mon Dec 02, 2024 5:25 pm

Re: ESP32P4 Factory example not working (I2C) problem

Postby esperiment » Sun Dec 15, 2024 12:51 pm

ESP_Sprite wrote:
Sun Dec 15, 2024 5:40 am
Maybe you need to configure stuff in menuconfig?
Indeed, the reason for my self-compilation failures could be missed configurations. I'll have a look at relevant options.

But this does not explain the initial (i.e. factory programmed) example failure of the I2C/touch events.

Still, I'll check available options in menuconfig and report back.

esperiment
Posts: 6
Joined: Mon Dec 02, 2024 5:25 pm

Re: ESP32P4 Factory example not working (I2C) problem

Postby esperiment » Sun Dec 22, 2024 11:30 am

OK, I searched the issues on Github and found https://github.com/espressif/esp-dev-kits/issues/115

The suggestion was to connect the camera because a component had changed.
With the camera connected the example works now.

Who is online

Users browsing this forum: Google [Bot] and 95 guests