fix(esp32_p4_function_ev_board): make touch init non-fatal in bsp_display_start_with_config#786
Draft
vikramdattu wants to merge 1 commit into
Draft
Conversation
bsp_display_start_with_config() currently early-returns NULL if bsp_display_indev_init() fails to initialize the GT911 touch controller. On board variants that ship the EK79007 / ILI9881C display without a wired touch controller (or where the GT911 I2C probe fails for any other reason), this causes the entire display path to be reported as broken even though LVGL + LCD + brightness have already been brought up successfully — bsp_display_lcd_init() registers the display with LVGL before touch init runs. Demote the touch-init failure to a warning and return the LCD display. Applications that need touch can still check disp_indev / the returned lv_indev_t * and bail if it's NULL; applications that only need the display (e.g. a camera preview) get to keep using it. Bumps BSP version 5.2.3 -> 5.2.4.
056224d to
aeb1b55
Compare
espzav
reviewed
May 25, 2026
| * and the I2C probe will fail in that case. Treat this as a warning | ||
| * rather than tearing down the whole display path — applications that | ||
| * only need the display (e.g. video preview) can still use it. */ | ||
| disp_indev = bsp_display_indev_init(disp); |
Collaborator
There was a problem hiding this comment.
Hi, thank you for this proposal. I am not sure if this is right. When you will use this BSP inside real project, you cannot detect touch failure.
I think, there will be better to use KConfig option to disable initialization input device.
Contributor
Author
There was a problem hiding this comment.
I have seen this bit me on EV Function board V1.2. And hence the proposal. I think even in doubtful cases where failure is captured OR not, it is still better to log the error and continue treating it benign.
Can add a Kconfig option to treat this a error return OR keep-going if you like. Serves both, you either deny moving forward or just keep going with just the display.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
bsp_display_start_with_config()currently early-returnsNULLifbsp_display_indev_init()fails to initialize the GT911 touch controller:On board variants that ship the EK79007 / ILI9881C display without a wired GT911, or where the GT911 I2C probe fails for any other reason (bus contention, bad reset timing, etc.), this reports the entire display path as broken even though LVGL + LCD + brightness have already been brought up successfully.
bsp_display_lcd_init()registers the display with LVGL before touch init runs, so the LCD is fully usable; only touch input is missing.In practice, applications that consume this BSP for a camera preview / video player path have no way to opt out of the touch requirement — they get an
ESP_ERR_INVALID_STATEfrombsp_touch_new()and lose the entire display.Fix
Demote the touch-init failure to a warning and return the LCD display. Callers that need touch can check the returned
lv_indev_t *(or the file-staticdisp_indev) and bail; callers that only need the display keep working.Tested
ESP_ERROR_CHECK failed: esp_err_t 0x103 (ESP_ERR_INVALID_STATE)frombsp_display_indev_init. WithCONFIG_BSP_ERROR_CHECK=nthe abort goes away butbsp_display_start_with_configstill returns NULL → caller can't use the display. With this patch the function returns the LCD display and the app can render normally.Bumps
bsp/esp32_p4_function_ev_board5.2.3 → 5.2.4.