GithubHelp home page GithubHelp logo

esp-bsp's Introduction

pre-commit

ESP-BSP: Espressif's Board Support Packages

Board support packages for development boards using Espressif's SoCs, written in C.

Supported boards

Board name SoC Features Photo
ESP-WROVER-KIT ESP32 LCD display, uSD card slot
ESP-BOX ESP32-S3 LCD display with touch, audio codec + power amplifier,
accelerometer and gyroscope
ESP-BOX-Lite ESP32-S3 LCD display, audio codec + power amplifier
ESP32-Azure IoT Kit ESP32 OLED display, uSD card slot, accelerometer,
magnetometer, humidity, pressure, light
and temperature sensors
ESP32-S2-Kaluga Kit ESP32-S2 LCD display, audio codec + power amplifier,
smart LED and camera
ESP32-S3-USB-OTG ESP32-S3 LCD display, uSD card slot, USB-OTG
ESP32-S3-EYE ESP32-S3 LCD display, camera, uSD card slot, microphone and accelerometer
ESP32-S3-LCD-EV-Board ESP32-S3 LCD display with touch, audio codec + power amplifier
ESP32-S3-LCD-EV-Board-2 ESP32-S3 LCD display with touch, audio codec + power amplifier
ESP32-S3-Korvo-2 ESP32-S3 LCD display, camera, uSD card slot, microphone, audio codec + power amplifier
ESP32-LyraT ESP32 uSD card slot, microphone, audio codec + power amplifier
ESP32-C3-LCDKit ESP32-C3 LCD display with encoder, IR, PDM audio
ESP-BOX-3 ESP32-S3 LCD display with touch, audio codec + power amplifier,
accelerometer and gyroscope
ESP32-S3-KORVO-1 ESP32-S3 uSD card slot, microphone, audio codec + power amplifier, RGB led strip
M5Stack CoreS3 ESP32-S3 LCD display with touch, uSD card slot, microphone, audio codec

LCD displays and TOUCH

LVGL port LCD drivers

The BSP repository includes a lot of LCD and Touch driver components. The list of available and planned LCDs is here.

We offer seamless integration of LVGL graphical library into esp-idf applications in LVGL port component.

Moreover, LVGL port includes recommendations and tips for increasing graphical performance.

How to use

Examples

Best way to start with ESP-BSP is trying one of the examples on your board. Every example contains README.md with a list of supported boards. Here is the summary of the available examples:

Example Supported boards Try with ESP Launchpad
audio ESP32-S3-Korvo-2 Flash audio
display WROVER-KIT Flash display
display_camera Kaluga-kit Flash display_camera
display_audio_photo ESP-BOX Flash display_audio_photo
display_rotation ESP-BOX Flash display_rotation
display_lvgl_demos ESP32-S3-LCD-EV-Board Flash display_lvgl_demos
display_sensors Azure-IoT-kit Flash display_sensors
mqtt_example Azure-IoT-kit -

BSP headers and options

  • bsp/name-of-the-bsp.h: Main include file of the BSP with public API
  • bsp/esp-bsp.h: Convenience include file with the same name for all BPSs
  • bsp/display.h and bsp/touch.h: Only for BSPs with LCD or touch controller. Contain low level initialization functions for usage without LVGL graphical library
    • By default, BSPs with display are shipped with LVGL, if you are interested in BSP without LVGL you can use BSP versions with noglib suffix (eg. esp32_s3_eye_noglib).

NOTE: There can be only one BSP in a single esp-idf project.

In a custom project

Packages from this repository are uploaded to the IDF component registry. You can add them to your project via idf.py add-dependency, e.g.

    idf.py add-dependency esp_wrover_kit==1.0.0

Recommendation for custom projects

When you want to use a BSP in a real project, it is highly recommended to disable configuration option CONFIG_BSP_ERROR_CHECK in menuconfig. You should check all returned error codes from all BSP functions you call. Otherwise, if the option CONFIG_BSP_ERROR_CHECK is enabled, any error encountered in a BSP will abort the program.

Migration to ESP-IDF v5.0

ESP-IDF v5.0 brings a lot of new features, but, as the bump in major version suggests, also a lot of breaking changes.

ESP-BSP is kept up-to-date with the latest ESP-IDF version, but some breaking changes in ESP-BSP API are inevitable. Usually, BSPs compatible with IDF v5.0 are version 2. If you want to use BSP with IDF v4.4 you can still use version 1 of the particular BSP. If you are interested in BSP examples for IDF v4.4, you can git checkout tag examples_v4.4.

More information about ESP-IDF breaking changes can be found in the official migration guide.

Compiling project for multiple BSPs

⚠️ Experimental feature: This feature is under development!

A single project can be run on multiple different development boards, if the boards contain the features required by the project (such as audio, display, camera...). For this purpose, idf.py is extended by examples/bsp_ext.py which allows you to build an example for your specific BSP. Example command for display e.g.:

idf.py -D SDKCONFIG_DEFAULTS=sdkconfig.bsp.esp_wrover_kit build

In case you want to build locally for multiple boards at the same time, it is useful to have separate build directories for each BSP configuration. In order to achieve this, you can extend the above command like this:

idf.py -B build/wrover_kit -D SDKCONFIG_DEFAULTS=sdkconfig.bsp.esp_wrover_kit build

Note: This feature is not yet integrated to idf.py by default. If you want to use it, you must set your environmental variable IDF_EXTRA_ACTIONS_PATH to path to esp-bsp/examples/bsp_ext.py.

Contributing to ESP-BSP

Please check CONTRIBUTING.md if you'd like to contribute to ESP-BSP.

Also check BSP Development Guide to find out more about BSP API and architecture.

Additional information

More information about idf-component-manager can be found in Espressif API guide or PyPi registry.

You can find more information about idf.py extensions here.

Copyrights and License

All original source code in this repository is Copyright (c) Espressif Systems (Shanghai) Co. Ltd., and is licensed under the Apache 2.0 license.

esp-bsp's People

Contributors

atanisoft avatar bubblesnake avatar cdollar393 avatar dazza0 avatar dreamchaser-luzeyu avatar espressif2022 avatar espzav avatar frozen-burrito avatar georgik avatar hephaisto avatar igrr avatar indastri avatar ivanroberto avatar kumekay avatar l-kaya avatar lzw655 avatar o-marshmallow avatar pborcin avatar peter-marcisovsky avatar suda-morris avatar sudeep-mohanty avatar suglider avatar tore-espressif avatar tronical avatar vojtechbartoska avatar wujiangang avatar xdanielpaul avatar yhanchristian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esp-bsp's Issues

esp_lcd_touch_tt21100: crash on touch with CONFIG_LOG_MAXIMUM_LEVEL_DEBUG=y (BSP-346)

We're experiencing a crash on touch when we build with CONFIG_LOG_MAXIMUM_LEVEL_DEBUG=y.

  espressif/esp_lcd_touch_tt21100:
    component_hash: 27d0ec1226e2ce81ad6a170b27530dbcf959cd1fb9abe1ba207509a8a2f2ed22
    source:
      service_url: https://api.components.espressif.com/
      type: service
    version: 1.0.7~1
abort() was called at PC 0x4037b4bf on core 0
0x4037b4bf: lock_acquire_generic at /opt/esp/idf/components/newlib/locks.c:139



Backtrace: 0x4037a1be:0x3fceb830 0x40384095:0x3fceb850 0x4038c1b2:0x3fceb870 0x4037b4bf:0x3fceb8e0 0x4037b687:0x3fceb910 0x42131645:0x3fceb940 0x42131d9d:0x3fceb960 0x42131e19:0x3fceb990 0x4212cc1f:0x3fceb9c0 0x4212cbf1:0x3fceba20 0x42124f07:0x3fceba40 0x4214b61d:0x3fceba60 0x4206f3c5:0x3fcebac0 0x4206fe96:0x3fcebb10 0x4206f7d5:0x3fcebb30 0x4207e296:0x3fcebb60 0x420722d4:0x3fcebb80 0x4207fa3f:0x3fcebbd0 0x4206fe04:0x3fcebc00
0x4037a1be: panic_abort at /opt/esp/idf/components/esp_system/panic.c:408

0x40384095: esp_system_abort at /opt/esp/idf/components/esp_system/esp_system.c:137

0x4038c1b2: abort at /opt/esp/idf/components/newlib/abort.c:46

0x4037b4bf: lock_acquire_generic at /opt/esp/idf/components/newlib/locks.c:139

0x4037b687: _lock_acquire_recursive at /opt/esp/idf/components/newlib/locks.c:167 (discriminator 3)
 (inlined by) __retarget_lock_acquire_recursive at /opt/esp/idf/components/newlib/locks.c:323 (discriminator 3)

0x42131645: __env_lock at /builds/idf/crosstool-NG/.build/xtensa-esp32s3-elf/src/newlib/newlib/libc/stdlib/envlock.c:43

0x42131d9d: _findenv_r at /builds/idf/crosstool-NG/.build/xtensa-esp32s3-elf/src/newlib/newlib/libc/stdlib/getenv_r.c:85

0x42131e19: _getenv_r at /builds/idf/crosstool-NG/.build/xtensa-esp32s3-elf/src/newlib/newlib/libc/stdlib/getenv_r.c:126

0x4212cc1f: _tzset_unlocked_r at /builds/idf/crosstool-NG/.build/xtensa-esp32s3-elf/src/newlib/newlib/libc/time/tzset_r.c:28

0x4212cbf1: _tzset_unlocked at /builds/idf/crosstool-NG/.build/xtensa-esp32s3-elf/src/newlib/newlib/libc/time/tzset.c:115

0x42124f07: localtime_r at /builds/idf/crosstool-NG/.build/xtensa-esp32s3-elf/src/newlib/newlib/libc/time/lcltime_r.c:34 (discriminator 8)

0x4214b61d: esp_log_system_timestamp at /opt/esp/idf/components/log/log_freertos.c:84

0x4206f3c5: esp_lcd_touch_tt21100_read_data at /willow/managed_components/espressif__esp_lcd_touch_tt21100/esp_lcd_touch_tt21100.c:215

0x4206fe96: esp_lcd_touch_read_data at /willow/managed_components/espressif__esp_lcd_touch/esp_lcd_touch.c:36

0x4206f7d5: lvgl_port_touchpad_read at /willow/managed_components/espressif__esp_lvgl_port/esp_lvgl_port.c:658

0x4207e296: _lv_indev_read at /willow/managed_components/lvgl__lvgl/src/hal/lv_hal_indev.c:186

0x420722d4: lv_indev_read_timer_cb at /willow/managed_components/lvgl__lvgl/src/core/lv_indev.c:83

0x4207fa3f: lv_timer_exec at /willow/managed_components/lvgl__lvgl/src/misc/lv_timer.c:313
 (inlined by) lv_timer_handler at /willow/managed_components/lvgl__lvgl/src/misc/lv_timer.c:109

0x4206fe04: lvgl_port_task at /willow/managed_components/espressif__esp_lvgl_port/esp_lvgl_port.c:535

Fix format warnings (BSP-175)

esp-idf is changin defintion of uint32_t from unsigned int to unsigned long.
Now we need to use PRIx32 specifier from inttypes.h instead of d or u, during print.

TODO:

  • Remove -Wno-format compiler option
  • Fix all format warings

Support for ST7701S display driver (IDFGH-10449) (BSP-330)

Is your feature request related to a problem?

Nowadays, it has become increasingly popular to include a touch display for various projects. This allows consumer/user to control and monitor the device much more easily.

I think it would be very beneficial to support as many of the popular displays as possible to give developers freedom to choose display for their particular application.

Currently, I do not think esp-idf support any of the LCD round displays.

Describe the solution you'd like.

We have recently gone through some issues to get the 1.9" touch display from LilyGo to work properly.

I think it would also be very cool to get the 2.1" Round display from LilyGo to work on esp-idf:
https://www.lilygo.cc/products/t-rgb?variant=42503165673653

This display is based on ST7701S TFT LCD display and CST820 touch chip.

Describe alternatives you've considered.

Using different displays such as ST7789/ILI9341 but these driver chips does not seem to support round displays.

Additional context.

Please consider this. I think it will be very useful for esp community :)

bsp/esp-bsp.h: No such file or directory (BSP-292)

Trying to use driver to run on esp32 in esp-idf env in platformio. I've added in libs folders from your repository and trying to run example code. When I build it i got error when including "bsp/esp-bsp.h", but there is no such folder in your project. How can I fix it

examples position for esp-bsp (BSP-385)

Hi everyone,

I'm "porting" the bsp to the esp-eye (the older one) and have a quick question.
So far I'm using an application inside the example folder of the component to test it (esp-bsp/esp_eye/examples), as it's usually done (I guess at least). These bsp s don't have an example folder inside but a common one at the same level esp-bsp/examples.

So if I'd submit a PR, should I also add an example in the esp-bsp/examples or can I keep the esp-bsp/esp_eye/examples? Because the esp-eye doesn't have a display, hence the display+camera example wouldn't fit.

Thanks!

component esp_lvgl_port (BSP-279)

hello @espzav
The component has been modified recently, and a navigation button has been added here, but I see that the registered event is LV_INDEV_TYPE_ENCODER.
I want to know, is the design here according to the requirements of ESP32-S3-BOX-Lite?
Because I want to add an enode knob event, so I want to confirm here.

A little question about esp_lcd_touch components (BSP-212)

@espzav Hi Vilem, I have a little confused with the 120th line below. I think it should be like *swap = tp->config.flags.swap_xy;. And there are also two more functions (esp_lcd_touch_get_mirror_x/y) like that.

esp_err_t esp_lcd_touch_get_swap_xy(esp_lcd_touch_handle_t tp, bool *swap)
{
assert(tp != NULL);
/* Is swap supported by HW? */
if (tp->get_swap_xy) {
return tp->get_swap_xy(tp, swap);
} else {
return tp->config.flags.swap_xy;
}
return ESP_OK;
}

esp_lcd_touch: Support multiple interfaces to touch controllers (BSP-140)

There is one unresolved issue from initial esp_lcd_touch review:

... it should have a similar situation to controlled-based LCD panel, where a device might support multiple IO interfaces. We'd better not couple the IO driver inside the device driver.
So to install a touch driver, the step could be (take the I2C as an example):

  1. Initialize the I2C bus (in user app)
  2. Register an I2C device, get the IO handle
  3. Install the touch device with that IO handle, and return the device handle

It should be possible to use one touch controller with both SPI and I2C.

cc @suda-morris

ESP32-S3-Korvo-2: Generic LCD initialization function is not available (BSP-269)

Public function for generic LCD initialization is not available.

Proposed API-function prototype:
esp_lcd_panel_handle_t bsp_lcd_init(esp_lcd_panel_io_color_trans_done_cb_t on_color_trans_done);

Functionality would be same as in static lv_disp_t *bsp_display_lcd_init(void)
lines 206 - 258 + setting callback function to esp_lcd_panel_io_spi_config_t + returning pointer to the lcd panel handle.

BSP_NULL_CHECK(bsp_io_expander_init(), NULL);
BSP_ERROR_CHECK_RETURN_ERR(esp_io_expander_set_dir(io_expander, BSP_LCD_IO_CS, IO_EXPANDER_OUTPUT));
BSP_ERROR_CHECK_RETURN_ERR(esp_io_expander_set_dir(io_expander, BSP_LCD_IO_RST, IO_EXPANDER_OUTPUT));
BSP_ERROR_CHECK_RETURN_ERR(esp_io_expander_set_dir(io_expander, BSP_LCD_IO_BACKLIGHT, IO_EXPANDER_OUTPUT));
BSP_ERROR_CHECK_RETURN_ERR(esp_io_expander_set_level(io_expander, BSP_LCD_IO_CS, 0));
ESP_LOGD(TAG, "Initialize SPI bus");
const spi_bus_config_t buscfg = {
.sclk_io_num = BSP_LCD_PCLK,
.mosi_io_num = BSP_LCD_DATA0,
.miso_io_num = GPIO_NUM_NC,
.quadwp_io_num = GPIO_NUM_NC,
.quadhd_io_num = GPIO_NUM_NC,
.max_transfer_sz = BSP_LCD_H_RES * 80 * sizeof(uint16_t),
};
BSP_ERROR_CHECK_RETURN_NULL(spi_bus_initialize(BSP_LCD_SPI_NUM, &buscfg, SPI_DMA_CH_AUTO));
ESP_LOGD(TAG, "Install panel IO");
esp_lcd_panel_io_handle_t io_handle = NULL;
const esp_lcd_panel_io_spi_config_t io_config = {
.dc_gpio_num = BSP_LCD_DC,
.cs_gpio_num = BSP_LCD_CS,
.pclk_hz = BSP_LCD_PIXEL_CLOCK_HZ,
.lcd_cmd_bits = LCD_CMD_BITS,
.lcd_param_bits = LCD_PARAM_BITS,
.spi_mode = 0,
.trans_queue_depth = 10,
};
// Attach the LCD to the SPI bus
BSP_ERROR_CHECK_RETURN_NULL(esp_lcd_new_panel_io_spi((esp_lcd_spi_bus_handle_t)BSP_LCD_SPI_NUM, &io_config, &io_handle));
ESP_LOGD(TAG, "Install LCD driver of ILI9341");
esp_lcd_panel_handle_t panel_handle = NULL;
const esp_lcd_panel_dev_config_t panel_config = {
.reset_gpio_num = BSP_LCD_RST, // Shared with Touch reset
.color_space = ESP_LCD_COLOR_SPACE_BGR,
.bits_per_pixel = 16,
};
BSP_ERROR_CHECK_RETURN_NULL(esp_lcd_new_panel_ili9341(io_handle, &panel_config, &panel_handle));
// Reset LCD
BSP_ERROR_CHECK_RETURN_ERR(esp_io_expander_set_level(io_expander, BSP_LCD_IO_RST, 0));
vTaskDelay(pdMS_TO_TICKS(10));
BSP_ERROR_CHECK_RETURN_ERR(esp_io_expander_set_level(io_expander, BSP_LCD_IO_RST, 1));
vTaskDelay(pdMS_TO_TICKS(10));
// Enable display
BSP_ERROR_CHECK_RETURN_ERR(esp_io_expander_set_level(io_expander, BSP_LCD_IO_CS, 0));
esp_lcd_panel_init(panel_handle);
esp_lcd_panel_mirror(panel_handle, true, true);
esp_lcd_panel_disp_on_off(panel_handle, true);

Alternative proposal:

Add two public API-function similar to ESP-BOX LCD BSP.

esp_lcd_panel_handle_t bsp_lcd_init(void);
void bsp_lcd_set_cb(esp_lcd_panel_io_color_trans_done_cb_t on_color_trans_done);

For reference
https://github.com/espressif/esp-box/blob/master/components/bsp/src/peripherals/bsp_lcd.c#L115
https://github.com/espressif/esp-box/blob/master/components/bsp/src/peripherals/bsp_lcd.c#L227

ESP32-S3-Korvo-2: Generic touch controller initialization function is not available (BSP-270)

Public function for generic touch controller initialization is not available.

Proposed API-function prototype:
esp_lcd_touch_handle_t bsp_lcd_touch_init(void);

Functionality would be same as in static lv_indev_t *bsp_display_indev_init(lv_disp_t *disp) lines 286 - 306 + returning pointer to the touch handle.

/* Initialize touch */
const esp_lcd_touch_config_t tp_cfg = {
.x_max = BSP_LCD_H_RES,
.y_max = BSP_LCD_V_RES,
.rst_gpio_num = GPIO_NUM_NC, // Shared with LCD reset
.int_gpio_num = BSP_LCD_TOUCH_INT,
.levels = {
.reset = 0,
.interrupt = 0,
},
.flags = {
.swap_xy = 0,
.mirror_x = 1,
.mirror_y = 0,
},
};
esp_lcd_panel_io_handle_t tp_io_handle = NULL;
const esp_lcd_panel_io_i2c_config_t tp_io_config = ESP_LCD_TOUCH_IO_I2C_TT21100_CONFIG();
BSP_ERROR_CHECK_RETURN_NULL(esp_lcd_new_panel_io_i2c((esp_lcd_i2c_bus_handle_t)BSP_I2C_NUM, &tp_io_config, &tp_io_handle));
BSP_ERROR_CHECK_RETURN_NULL(esp_lcd_touch_new_i2c_tt21100(tp_io_handle, &tp_cfg, &tp));
assert(tp);

Minor updates on the structure of SquareLine Studio boards (BSP-213)

Hi,

We made a few little modification on directory structure of the boards in SquareLine Studio. The current version is also working but maybe you want to make the content of the espressif folder aligned with the other board folders. We manually updated the name of all existing boards and files and this is how it looks like now:

├── arduino
│   ├── tft_espi_v1_0_0
│   │   ├── tft_espi.png
│   │   ├── tft_espi.slb
│   │   └── tft_espi.zip
│   └── tft_espi_v1_0_1
│       ├── tft_espi.png
│       ├── tft_espi.slb
│       └── tft_espi.zip
├── desktop
│   ├── eclipse_sdl_v1_0_0
│   │   ├── eclipse_sdl.png
│   │   ├── eclipse_sdl.slb
│   │   └── eclipse_sdl.zip
│   ├── eclipse_sdl_v1_0_1
│   │   ├── eclipse_sdl.png
│   │   ├── eclipse_sdl.slb
│   │   └── eclipse_sdl.zip
│   ├── micropython_v1_0_0
│   │   ├── micropython.png
│   │   ├── micropython.slb
│   │   └── micropython.zip
│   └── micropython_v1_0_1
│       ├── micropython.png
│       ├── micropython.slb
│       └── micropython.zip
└── espressif
    ├── espbox_v1_0_0
    │   ├── espbox.png
    │   ├── espbox.slb
    │   └── espbox.zip
    └── espwroverkit_v1_0_0
        ├── espwroverkit.png
        ├── espwroverkit.slb
        └── espwroverkit.zip

So <vendor>/<board_name>_<version>/<files_without_version>.


We also needed to update how LVGL versions are enumerated in the .slb file. Our initial idea was to support wildchars like v8.0+ but finally we have choosen a more explicit way. So the supported LVGL versions needs to be written one by one like:

"supported_lvgl_version": "8.2.0, 8.3.3",

(At this moment we support these 2 LVGL versions)


If you wish I can send a PR for gen.py, but I don't know if LVGL v8.3.3 is supported.

CST816S touch and ST7789 display (X axis inverted) (BSP-406)

I am creating this issue to solve :
krupis/T-Display-S3-esp-idf#1

An issue has been discovered on T-Display-S3 development board from Lilygo:
https://www.lilygo.cc/products/t-display-s3

The issue is that the X axis for touch seems to be inverted which does not allow to use sliders and other display elements that require proper X axis.

The example project can be found:
https://github.com/krupis/T-Display-S3-esp-idf

The example contains a simple slider. Please see the video attached below:
https://www.youtube.com/shorts/KaQ7J90QQLY

I have tried to play around with esp_lcd_panel_mirror but could not achieve the proper results. Please can someone suggest how to ensure the X axis is not inverted for touch?

Allow mounting the SD card with SDMMC_FREQ_HIGHSPEED (BSP-286)

I would like to be able to mount the SD card on ESP32-S3-EYE with host.max_freq_khz = SDMMC_FREQ_HIGHSPEED.

Currently I have to copy the SD card mounting code from the BSP component into the app just to modify this setting.

Could we consider either or both solutions:

  1. Add a way to change the SD card frequency setting, either via Kconfig or a run-time parameter.
  2. Always set max_freq_khz = SDMMC_FREQ_HIGHSPEED on boards where we know this works. (But still provide a way to fall back to a lower frequency, same as 1.)

how to use example in espidf4.4? (BSP-201)

I want to use these examples, but am I reporting a mistake in the build project, the current version can only run on the idf5 version? I am currently using idf4.4, how should I deal with this problem, I do not know in which branch is corresponding to the support of idf4.4, please let me know, thank you

Touch rotated but not display Waveshare 7inch hardware rotation (BSP-323)

Machine

Computer: Windows 11
MCU: ESP32-S3 N8R8
LVGL: v8.3.3

Symptom

I would like to rotate the display by 180 degree.

After setting disp_drv.rotated = LV_DISP_ROT_180; , only touch input is rotated. The UI is not rotated.

Extra info

By setting the rotated flag, the screen could perform hardware rotation. Hardware rotation has better performance.

According to LVGL documentation:

LVGL supports rotation of the display in 90 degree increments. You can select whether you'd like software rotation or hardware rotation.
If you select software rotation (sw_rotate flag set to 1), LVGL will perform the rotation for you. Your driver can and should assume that the screen width and height have not changed. Simply flush pixels to the display as normal. Software rotation requires no additional logic in your flush_cb callback.
There is a noticeable amount of overhead to performing rotation in software, which is why hardware rotation is also available. In this mode, LVGL draws into the buffer as though your screen now has the width and height inverted. You are responsible for rotating the provided pixels yourself.
The default rotation of your display when it is initialized can be set using the rotated flag. The available options are LV_DISP_ROT_NONE, LV_DISP_ROT_90, LV_DISP_ROT_180, or LV_DISP_ROT_270. The rotation values are relative to how you would rotate the physical display in the clockwise direction. Thus, LV_DISP_ROT_90 means you rotate the hardware 90 degrees clockwise, and the display rotates 90 degrees counterclockwise to compensate.

I implemented by adding this line:

disp_drv.rotated = LV_DISP_ROT_180;

The rotated algorithm is in the following lines:

static void lvgl_port_update_callback(lv_disp_drv_t *drv)
{
    esp_lcd_panel_handle_t panel_handle = (esp_lcd_panel_handle_t) drv->user_data;

    switch (drv->rotated) {
    case LV_DISP_ROT_NONE:
        // Rotate LCD display
        esp_lcd_panel_swap_xy(panel_handle, false);
        esp_lcd_panel_mirror(panel_handle, false, false);
        // Rotate LCD touch
        esp_lcd_touch_set_mirror_y(tp, false);
        esp_lcd_touch_set_mirror_x(tp, false);
        break;
    case LV_DISP_ROT_90:
        // Rotate LCD display
        esp_lcd_panel_swap_xy(panel_handle, true);
        esp_lcd_panel_mirror(panel_handle, false, true);
        // Rotate LCD touch
        esp_lcd_touch_set_mirror_y(tp, false);
        esp_lcd_touch_set_mirror_x(tp, false);
        break;
    case LV_DISP_ROT_180:
        // Rotate LCD display
        esp_lcd_panel_swap_xy(panel_handle, false);
        esp_lcd_panel_mirror(panel_handle, true, true);
        // Rotate LCD touch
        esp_lcd_touch_set_mirror_y(tp, false);
        esp_lcd_touch_set_mirror_x(tp, false);
        break;
    case LV_DISP_ROT_270:
        // Rotate LCD display
        esp_lcd_panel_swap_xy(panel_handle, true);
        esp_lcd_panel_mirror(panel_handle, true, false);
        // Rotate LCD touch
        esp_lcd_touch_set_mirror_y(tp, false);
        esp_lcd_touch_set_mirror_x(tp, false);
        break;
    }
}

Screen shows Snowflakes but the first few lines (BSP-324)

TL;DR

TL;DR: After updating to the latest Waveshare 7-inch screen component, the UI started displaying snowflakes and flickering. The error log indicates a task watchdog timeout, with the LVGL task failing to reset the watchdog in time.

Version

Waveshare 7inch screen component: v1.0.1

Symptoms

Before

When I was using Waveshare 7inch screen component v1.0.0, the UI works normally as expected.

After

Right after the change to v1.0.1, there are snowflakes on the screen. At the very top, there is a few lines of pixel that display normally. But other parts of the screen remains white and flickering.

image

The UI does not respond to touch screen either.

Code

main.c

/*
 * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
 *
 * SPDX-License-Identifier: CC0-1.0
 */

#include "esp_log.h"
#include "bsp/ws_7inch.h"
#include "lvgl.h"
#include "ui/ui.h"


#define TAG "ESP-EXAMPLE"

/*******************************************************************************
* Private functions
*******************************************************************************/

// *INDENT-OFF*
void app_lvgl_display(void)
{
    bsp_display_lock(0);

    ui_init();

    bsp_display_unlock();
}

void app_main(void)
{
    /* Initialize I2C (for touch) */
    bsp_i2c_init();

    /* Initialize display and LVGL */
    bsp_display_start();

    /* Turn on display backlight */
    bsp_display_backlight_on();

    /* Add and show objects on display */
    app_lvgl_display();

    ESP_LOGI(TAG, "Example initialization done.");
}
// *INDENT-ON*

Error log

I have also check the serial monitor. It seems that LVGL task is triggering watchdog reset. Then, it resets itself and keeps repeating this process again and again.

Check out I (1787), ESP32 prints out ESP-EXAMPLE: Example initialization done. which means that the initialization in app_main() was executed normally.

I (1447) LVGL: Starting LVGL task
I (1447) gpio: GPIO[9]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (1477) PWM_var: PWM_var = 0.00%
I (1487) gpio: GPIO[11]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (1517) gpio: GPIO[10]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:2 
I (1517) GT911: TouchPad_ID:0x39,0x31,0x31
I (1517) GT911: TouchPad_Config_Version:91
I (1787) gpio: GPIO[14]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1787) ESP-EXAMPLE: Example initialization done.
E (6957) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:
E (6957) task_wdt:  - IDLE (CPU 0)
E (6957) task_wdt: Tasks currently running:
E (6957) task_wdt: CPU 0: LVGL task
E (6957) task_wdt: CPU 1: IDLE
E (6957) task_wdt: Print CPU 0 (current core) backtrace


Backtrace: 0x42045D0E:0x3FC94600 0x42045EC4:0x3FC94620 0x40377139:0x3FC94640 0x4201BABC:0x3FCF7BA0 0x4201C0C5:0x3FCF7BC0 0x4201C21B:0x3FCF7C30 0x4201C328:0x3FCF7C60 0x4201C4D0:0x3FCF7C80 0x4202C041:0x3FCF7CB0 0x4202C0EF:0x3FCF7CD0 0x42010FDC:0x3FCF7CF0 0x4037E955:0x3FCF7D10
0x42045d0e: task_wdt_timeout_handling at E:/esp_idf_5.0/Espressif/frameworks/esp-idf-v5.0/components/esp_system/task_wdt.c:486 (discriminator 3)

0x42045ec4: task_wdt_isr at E:/esp_idf_5.0/Espressif/frameworks/esp-idf-v5.0/components/esp_system/task_wdt.c:586

0x40377139: _xt_lowint1 at E:/esp_idf_5.0/Espressif/frameworks/esp-idf-v5.0/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_vectors.S:1117

0x4201babc: draw_buf_flush at E:/esp_fryer_highend/ESP-fryer-highend/managed_components/lvgl__lvgl/src/core/lv_refr.c:1198
0x4201c0c5: refr_area_part at E:/esp_fryer_highend/ESP-fryer-highend/managed_components/lvgl__lvgl/src/core/lv_refr.c:712

0x4201c21b: refr_area at E:/esp_fryer_highend/ESP-fryer-highend/managed_components/lvgl__lvgl/src/core/lv_refr.c:594 (discriminator 2)

0x4201c328: refr_invalid_areas at E:/esp_fryer_highend/ESP-fryer-highend/managed_components/lvgl__lvgl/src/core/lv_refr.c:532

0x4201c4d0: _lv_disp_refr_timer at E:/esp_fryer_highend/ESP-fryer-highend/managed_components/lvgl__lvgl/src/core/lv_refr.c:324

0x4202c041: lv_timer_exec at E:/esp_fryer_highend/ESP-fryer-highend/managed_components/lvgl__lvgl/src/misc/lv_timer.c:313 
(discriminator 2)

0x4202c0ef: lv_timer_handler at E:/esp_fryer_highend/ESP-fryer-highend/managed_components/lvgl__lvgl/src/misc/lv_timer.c:109

0x42010fdc: lvgl_port_task at E:/esp_fryer_highend/ESP-fryer-highend/managed_components/espressif__esp_lvgl_port/esp_lvgl_port.c:441

0x4037e955: vPortTaskWrapper at E:/esp_idf_5.0/Espressif/frameworks/esp-idf-v5.0/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:151


E (11957) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:
E (11957) task_wdt:  - IDLE (CPU 0)
E (11957) task_wdt: Tasks currently running:
E (11957) task_wdt: CPU 0: LVGL task
E (11957) task_wdt: CPU 1: IDLE
E (11957) task_wdt: Print CPU 0 (current core) backtrace


Backtrace: 0x42045D0E:0x3FC94600 0x42045EC4:0x3FC94620 0x40377139:0x3FC94640 0x4201BAB9:0x3FCF7BA0 0x4201C0C5:0x3FCF7BC0 0x4201C21B:0x3FCF7C30 0x4201C328:0x3FCF7C60 0x4201C4D0:0x3FCF7C80 0x4202C041:0x3FCF7CB0 0x4202C0EF:0x3FCF7CD0 0x42010FDC:0x3FCF7CF0 0x4037E955:0x3FCF7D10
0x42045d0e: task_wdt_timeout_handling at E:/esp_idf_5.0/Espressif/frameworks/esp-idf-v5.0/components/esp_system/task_wdt.c:486 (discriminator 3)

0x42045ec4: task_wdt_isr at E:/esp_idf_5.0/Espressif/frameworks/esp-idf-v5.0/components/esp_system/task_wdt.c:586

0x40377139: _xt_lowint1 at E:/esp_idf_5.0/Espressif/frameworks/esp-idf-v5.0/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_vectors.S:1117

0x4201bab9: draw_buf_flush at E:/esp_fryer_highend/ESP-fryer-highend/managed_components/lvgl__lvgl/src/core/lv_refr.c:1199 (discriminator 1)

0x4201c0c5: refr_area_part at E:/esp_fryer_highend/ESP-fryer-highend/managed_components/lvgl__lvgl/src/core/lv_refr.c:712

0x4201c21b: refr_area at E:/esp_fryer_highend/ESP-fryer-highend/managed_components/lvgl__lvgl/src/core/lv_refr.c:594 (discriminator 2)

0x4201c328: refr_invalid_areas at E:/esp_fryer_highend/ESP-fryer-highend/managed_components/lvgl__lvgl/src/core/lv_refr.c:532

0x4201c4d0: _lv_disp_refr_timer at E:/esp_fryer_highend/ESP-fryer-highend/managed_components/lvgl__lvgl/src/core/lv_refr.c:324

0x4202c041: lv_timer_exec at E:/esp_fryer_highend/ESP-fryer-highend/managed_components/lvgl__lvgl/src/misc/lv_timer.c:313 
(discriminator 2)

0x4202c0ef: lv_timer_handler at E:/esp_fryer_highend/ESP-fryer-highend/managed_components/lvgl__lvgl/src/misc/lv_timer.c:109

0x42010fdc: lvgl_port_task at E:/esp_fryer_highend/ESP-fryer-highend/managed_components/espressif__esp_lvgl_port/esp_lvgl_port.c:441

0x4037e955: vPortTaskWrapper at E:/esp_idf_5.0/Espressif/frameworks/esp-idf-v5.0/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:151

Build examples and tests with -Werror (BSP-176)

To make sure that the examples can be built without warnings, we should export EXTRA_CFLAGS and EXTRA_CXXFLAGS variables in CI before running idf.py build.

Here's a snippet from IDF:

export PEDANTIC_FLAGS="-DIDF_CI_BUILD -Werror -Werror=deprecated-declarations -Werror=unused-variable -Werror=unused-but-set-variable -Werror=unused-function"
export PEDANTIC_CFLAGS="${PEDANTIC_FLAGS} -Wstrict-prototypes"
export PEDANTIC_CXXFLAGS="${PEDANTIC_FLAGS}"
export EXTRA_CFLAGS=${PEDANTIC_CFLAGS}
export EXTRA_CXXFLAGS=${PEDANTIC_CXXFLAGS}

(IDF build system picks up EXTRA_CFLAGS and EXTRA_CXXFLAGS environment variables)

  • Test app pedantic flags
  • Examples pedantic flags

[ESP LCD Touch CST816S Controller] Freeze while trying to read id using ESP32C6 and releasev5.1 (BSP-404)

Hello,

Before opening this issue, I've tried two base codes to get CST816S working : esp-watch from esp-bsp and T display S3 both codes doesn't seem to work with my ESP32C6 and LCD TFT setup.
The LCD works fine and displays whatever you instructs it to show with LVGL.
But once I configure the CST816S driver the MCU stucks at doing its first hadnshake with the driver, at id reading.
I've made a minimal code (without this driver) to test the hardware wiring and i'm able to notice INT interrupts when I touch the screen and I'm also able to get the ID with this command :
`static void id_register_read(uint8_t addr)
{
uint8_t data[2];

i2c_master_write_read_device(0, 0x15, &addr, 1, data, 1, 1000 / portTICK_PERIOD_MS);
ESP_LOGI(TAG, "WHO_AM_I = %X", data[0]);

}`

Following up the issue with the library I ended up seeing the freeze/blocking at this function
esp_err_t panel_io_i2c_rx_buffer(esp_lcd_panel_io_t *io, int lcd_cmd, void *buffer, size_t buffer_size)
in esp_lcd/src/esp_lcd_panel_io_i2c.c file.

I've this minimal code to debug this issue :

#include <stdio.h>
#include <inttypes.h>
#include "sdkconfig.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/queue.h"
#include "driver/i2c.h"
#include "esp_system.h"
#include "esp_err.h"
#include "esp_check.h"
#include "esp_log.h"
#include "esp_lcd_touch_cst816s.h"
#include "freertos/semphr.h"

static const char *TAG = "i2CTest";
#define CHIP_ID_REG         (0xA7)

static QueueHandle_t gpio_evt_queue = NULL;
static esp_lcd_touch_handle_t tp;   // LCD touch handle

static SemaphoreHandle_t touch_mux;

static void IRAM_ATTR touch_callback(esp_lcd_touch_handle_t tp)
{
    uint32_t gpio_num = 8;
    xQueueSendFromISR(gpio_evt_queue, &gpio_num, NULL);

    BaseType_t xHigherPriorityTaskWoken = pdFALSE;
    xSemaphoreGiveFromISR(touch_mux, &xHigherPriorityTaskWoken);

    if (xHigherPriorityTaskWoken) {
        portYIELD_FROM_ISR();
    }
}

void i2c_init(void)
{
    const i2c_config_t i2c_conf = {
        .mode = I2C_MODE_MASTER,
        .sda_io_num = 19,
        .sda_pullup_en = GPIO_PULLUP_ENABLE,
        .scl_io_num = 20,
        .scl_pullup_en = GPIO_PULLUP_ENABLE,
        .master.clk_speed = 400000
    };
    i2c_param_config(0, &i2c_conf);
    i2c_driver_install(0, i2c_conf.mode, 0, 0, 0);
}

static void reset(void)
{
        gpio_set_level(21, 0);
        vTaskDelay(pdMS_TO_TICKS(200));
        gpio_set_level(21, 1);
        vTaskDelay(pdMS_TO_TICKS(200));
}

static void id_register_read(uint8_t addr)
{
    uint8_t data[2];

    i2c_master_write_read_device(0, 0x15, &addr, 1, data, 1, 1000 / portTICK_PERIOD_MS);
    ESP_LOGI(TAG, "WHO_AM_I = %X", data[0]);

}

void app_main(void)
{
    printf("Hello world!\n");
    gpio_evt_queue = xQueueCreate(10, sizeof(uint32_t));
    touch_mux = xSemaphoreCreateBinary();

    i2c_init();

    esp_lcd_panel_io_i2c_config_t io_config = ESP_LCD_TOUCH_IO_I2C_CST816S_CONFIG();

    esp_lcd_touch_config_t tp_cfg = {
        .x_max = 240,
        .y_max = 280,
        .rst_gpio_num = 21,
        .int_gpio_num = 2,
        .levels = {
            .reset = 0,
            .interrupt = 0,
        },
        .flags = {
            .swap_xy = 0,
            .mirror_x = 0,
            .mirror_y = 0,
        },
        .interrupt_callback = touch_callback,
    };
    esp_lcd_panel_io_handle_t io_handle = NULL;
    esp_lcd_new_panel_io_i2c((esp_lcd_i2c_bus_handle_t)0 , &io_config, &io_handle);
    esp_lcd_touch_new_i2c_cst816s(io_handle, &tp_cfg, &tp);
    uint32_t io_num;
    for(;;) {
        if (xSemaphoreTake(touch_mux, 0) == pdTRUE) {
        esp_lcd_touch_read_data(tp); // read only when ISR was triggled
        uint16_t touch_x[1];
        uint16_t touch_y[1];
        uint16_t touch_strength[1];
        uint8_t touch_cnt = 0;
        bool touchpad_pressed = esp_lcd_touch_get_coordinates(tp, touch_x, touch_y, touch_strength, &touch_cnt, 1);
        ESP_LOGI(TAG, "touch pressed = %d , x = %u , y=%u", touchpad_pressed, touch_x[0], touch_y[0]);

     }
        if(xQueueReceive(gpio_evt_queue, &io_num, portMAX_DELAY)) {
            printf("GPIO[%"PRIu32"] intr, val: %d\n", io_num, gpio_get_level(io_num));
        }
    }
}

Please note that I've added a queue to see if the ISR generates the interrupts but I don't see them coming. The esp32c6 is lost in the id reading step in esp_lcd_touch_new_i2c_cst816s function.
Could you please provide me with some guidelines to debug this issue or resolve it.

Regards,
Mohammed

ILI9341V LCD driver support (BSP-408)

Hi. I recently bought 2.8 IPS display module with ILI9341V chip (like this one http://www.lcdwiki.com/2.8inch_IPS_SPI_Module_ILI9341). The standard esp_lcd_ili9341 driver refused to drive this display. So, I figured out that the difference is in initialization sequence. Here is the code snippet of vendor_specific_init array to make this module working. It will be good it this will be integrated in the esp_lcd_ili9341 driver (probably through Kconfig with ability to select chip).

static const lcd_init_cmd_t vendor_specific_init[] = {
	/* SW reset */
	{LCD_CMD_SWRESET, {0}, 0},
	/* 200 ms delay */
	{0x80, {250}, 1},
	{0xCF, {0x00, 0xC1, 0X30}, 3},
	{0xED, {0x64, 0x03, 0X12, 0X81}, 4},
	{0xE8, {0x85, 0x00, 0x78}, 3},
	{0xCB, {0x39, 0x2C, 0x00, 0x34, 0x02}, 5},
	{0xF7, {0x20}, 1},
	{0xEA, {0x00, 0x00}, 2},
	{0xC0, {0x13}, 1},
	{0xC1, {0x13}, 1},
	{0xC5, {0x22, 0x35}, 2},
	{0xC7, {0xBD}, 1},
	{LCD_CMD_MADCTL, {(LCD_CMD_MV_BIT | 0x08)}, 1},
	{0x3A, {0x55}, 1},  //*** INTERFACE PIXEL FORMAT: 0x66 -> 18 bit; 0x55 -> 16 bit
	{0xF6, {0x01, 0x30}, 2},
	{0xB1, {0x00, 0x1B}, 2},
	{0xF2, {0x00}, 1},
	{0x26, {0x01}, 1},
	/* Positive gamma correction */
	{0xE0, {0x0F, 0x35, 0x31, 0x0B, 0x0E, 0x06, 0x49, 0XA7, 0x33, 0x07, 0x0F, 0x03, 0x0C, 0x0A, 0x00}, 15},
	/* Negative gamma correction */
	{0xE1, {0x00, 0x0A, 0x0F, 0x04, 0x11, 0x08, 0x36, 0x58, 0x4D, 0x07, 0x10, 0x0C, 0x32, 0x34, 0x0F}, 15},

	/* Column address set, SC=0, EC=0xEF */
	{LCD_CMD_CASET, {0x00, 0x00, 0x00, 0xEF}, 4},
	/* Page address set, SP=0, EP=0x013F */
	{LCD_CMD_RASET, {0x00, 0x00, 0x01, 0x3F}, 4},
	/* Memory write */
	{LCD_CMD_RAMWR, {0}, 0},
	/* Entry mode set, Low vol detect disabled, normal display */
	{0xB7, {0x07}, 1},
	/* Display function control */
	{0xB6, {0x08, 0x82, 0x27}, 3},

	/* Sleep out */
	{LCD_CMD_SLPOUT, {0}, 0x80},
	/* Invert colors */
	{LCD_CMD_INVON, {0}, 0},
	/* Display on */
	{LCD_CMD_DISPON, {0}, 0x80},

	{0, {0}, 0xff},
};

esp-box v1.1.0 issues and requirement (BSP-291)

I use esp-idf v4.4.x, so have to use esp-box v1.1.0 or older versions, but this version issue. I refer to esp-box old code and add semaphore to lvgl_port_flush_ready and lvgl_port_flush_callback and it works well. Besides this I would like to make LVGL task's stack size configurable.
I have patch, how could I add PR to patch an esp-box of older version?

please add an example for esp_lvgl_port component (BSP-333)

I'm following the code samples in README.md and there's so many things I am looking for.
Could you just please provide a full source file from which you've pasted the stuff in README.md to avoid the (seemingly) endless search ?

Thanks you !

BSP for ESP32-S3-LCD-EV-Board-SUB2 480x480 (BSP-368)

Hi,

Is there a BSP for the said ESP32-S3-LCD-EV-Board-SUB2 480x480 (GC9503CV Display and FT5x06 Touch)?
We are trying to use Squareline, but the current available template only exist for ESP32-S3-LCD-EV-Board-SUB3 800 x 480.

Thanks

Mute function for ES7210 (BSP-295)

Hello,

I am fiddling with my new ESP32-S3-BOX, and I wanted to mute the microphone via software (instead of cutting power to the ES7210 chip) as the physical mute button does. I could not find the implementation of the mute function in your ESP component (using the registries 0x15 and 0x16).

Do you plan to add this feature in the near future? Thank you,

Greetings,

error: unknown type name 'portMUX_TYPE' (BSP-217)

@espzav Hi, when I didn't declare esp_lcd_touch.h before freertos/FreeRTOS.h and freertos/semphr.h, I got an error as belows:

error: unknown type name 'portMUX_TYPE'
   69 |     portMUX_TYPE lock; /*!< Lock for read/write */
      |     ^~~~~~~~~~~~

I think maybe it's better to include freertos/FreeRTOS.h and freertos/semphr.h in the file esp_lcd_touch.h.

Follow semantic versioning in BSP (BSP-135)

Most dependencies are defined as >=, this may work, but in general is not compatible with semantic versioning that we are using.

I would suggest "^1.1.1" (>=1.1.1,<2.0.0) or "~1.1.1" (>=1.1.1,<1.2.0) requirements,

like

dependencies:
  idf: ">=4.2"

  button:
    version: "^1.0.0"
    public: true
  es8311:
    version: "^0.0.2-alpha"
    public: true
  led_strip:
    version: "^1.1.0-alpha"
    public: true
  lvgl/lvgl_esp32_drivers:
    version: "^0.0.3"
    public: true
  • Kaluga
  • Azure
  • Wrover

i80_controller demo with esp_lcd_ra8875 - artifacts and shifted image (BSP-209)

I tried to adapt i80_controller demo to use esp_lcd_ra8875 component. It seems to work but there are artifacts and shifted image. It is most visible on LVGL FPS counter as it is redrawn periodically. Sometimes the artifacts are also visible outside of the FPS counter like on this picture:
screen1

LVGL FPS counter image shifts:
screen2
screen3

After pressing "Show again" touchscreen button the FPS counter is displayed correctly for 2-3 seconds, than it gets corrupted again.
Everything is displayed correctly after hard reset until the logo animation is finished therefore I don't think this is a PCLK frequency issue or FPS issue.

My code can be found here:
i80_controller_ra8875_20221012.zip

Hardware used:

  • ESP32-S3-DEVKITC-1U-N8R8
  • Waveshare 7inch Capacitive Touch LCD (C) 800x480

Software components:

  • esp-idf 5.0
  • lvgl 8.3.0
  • esp_lcd_ra8875 1.0.0
  • esp_lcd_touch 1.0.1
  • esp_lcd_touch_gt911 1.0.1

assert failed: esp_lcd_touch_new_i2c_gt911 esp_lcd_touch_gt911.c:51 (io != NULL) (BSP-231)

`esp_lcd_panel_io_i2c_config_t io_config = ESP_LCD_TOUCH_IO_I2C_GT911_CONFIG();

esp_lcd_touch_config_t tp_cfg = {
.x_max = CONFIG_LCD_HRES,
.y_max = CONFIG_LCD_VRES,
.rst_gpio_num = -1,
.int_gpio_num = -1,
.levels = {
.reset = 0,
.interrupt = 0,
},
.flags = {
.swap_xy = 0,
.mirror_x = 0,
.mirror_y = 0,
},
};

esp_lcd_touch_handle_t tp;
esp_lcd_touch_new_i2c_gt911(io_handle, &tp_cfg, &tp);
`
使用上面的代码时,提示assert failed: esp_lcd_touch_new_i2c_gt911 esp_lcd_touch_gt911.c:51 (io != NULL)
idf版本用的是master

Enable required fonts in sdkconfig.defaults of the project generated by Squareline (BSP-318)

This issue is at the boundary between ESP-BSP and Squareline, I'm filing it here for now for discussion.

Currently when we use a font in Squareline which isn't enabled by default in LVGL, the build will fail due to missing definitions. For example, if we use Monserrat size 48, CONFIG_LV_FONT_MONTSERRAT_48=y option should be enabled in sdkconfig.

This could be solved by:

  • Adding some placeholder in sdkconfig.defaults of our Squareline package
  • Squareline IDE should put the font-related settings instead of that placeholder
  • [Optional] Squareline package JSON file can define mapping between font names and the lines to be put into sdkconfig.defaults, to avoid hardcoding the Kconfig option names in Squareline

An alternative, simpler, solution:

  • Enable all the fonts in sdkconfig.defaults by default. Unused fonts will be eliminated at link time, since IDF build system uses -ffunction-sections -fdata-sections -Wl,--gc-sections options.

cc @kisvegabor @espzav

[DS18B20] Feature Request: Trigger temperature conversion on all devices (BSP-348)

When working with more than one DS18B20 temperature sensors, three in my case, it would be nice to call ds18b20_trigger_temperature_conversion() on all three and then only delay for the required amount before reading the temperatures from all three.

The current implementation forces me to wait x ms for each sensor where ideally I could only wait once.

I would imagine an function defined as follow:

esp_err_t ds18b20_trigger_temperature_conversions(const ds18b20_device_handle_t *ds18b20, uint8_t ds18b20_size );

Adding ISR support to MPU6050 sensor module (FEATURE) (BSP-241)

I have used the MPU6050 component in a custom project, and it works great. However, I believe that there are a few capabilities of the sensor not yet implemented by the component, such as interrupt configuration and handling.

One of the features of my project involved waking up the ESP32 from deep sleep whenever the MPU6050 detected motion. Initially, I wanted to implement it using the ULP to communicate directly with the MPU6050 via I2C, but then I found out about "Motion detection" interrupts which can be enabled on the sensor to trigger a wakeup from EXT0 or EXT1. Based on the MPU6050 datasheet and this post from the Arduino Stack Exchange, I learned that registers 0x1F, 0x37, 0x38 and 0x3A can be used to configure interrupt behavior of the MPU6050. Yet, as far as I know, the component provided in this repo does not support reading or writing to these registers. In the end, I implemented an extension module to support DATA_READY and MOTION interrupts for my project.

Does it make sense to enhance the MPU6050 component to make it capable of enabling interrupts in the MPU6050, registering ISR handlers and getting the interrupt status? If so, I would like to contribute to the component with the work that I've already implemented. I would greatly appreciate your opinion on this.

(I am opening this issue since the CONTRIBUTING.md mentions that an issue should be created before contributing large(ish) scale changes)

CST816 Touch driver support (IDFGH-10255) (BSP-328)

Is your feature request related to a problem?

I have been using ST7789 display from the lilygo and it works flawlesly.

The only issue is that I believe the esp-idf does not currently support the touch driver (CST816) for this display.

image

https://www.lilygo.cc/products/t-display-s3

I think adding support for this touch driver would be very useful for developers such as myself.

Describe the solution you'd like.

Working touch display driver for CST816 and example project on how to get it going.

Describe alternatives you've considered.

Using different displays.

Additional context.

No response

esp_lvgl_port appears to lack declaration of lv_tick_inc() (BSP-335)

In an esp32 project with these dependencies

dependencies:
  lvgl/lvgl: "*"
  espressif/esp_lcd_touch: "*"
  espressif/esp_lvgl_port: "*"
  espressif/esp_lcd_touch_gt911: "==1.0.0"

there is always a compile error because in managed_components/espressif__esp_lvgl_port/esp_lvgl_port.c around line 790, lv_tick_inc() isn't declared. So I added a single line in my copy as such :

static void lvgl_port_tick_increment(void *arg)
{
    void lv_tick_inc(uint32_t);

    /* Tell LVGL how many milliseconds have elapsed */
    lv_tick_inc(lvgl_port_timer_period_ms);
}

I can't find a setting to automate this so I'm guessing it's an oversight.
Example : https://sourceforge.net/p/esp32s3-4827s043/code/HEAD/tree/trunk/lvgl-port .

Thanks,
Danny

Port expander TCA 9555/9539 (BSP-276)

I'm planning to integrate either a TCA 9555 or a TCA 9539 (16bit port expander) into my project.
There currently is a driver for TCA9554, which is the 8-bit equivalent.
I would like to contribute the expansion to 16 bit, but I would like some feedback first on what way to go:

  • build a separate component for 16bit (basically a carbon copy of everything except a few lines)
  • use the same component
    • with multiple h/c-files and structs
    • with only one h/c file, but separate functions
    • extend functions to take a parameter (probably worst option because of backwards compatibility)
  • just keep my stuff locally and don't push to this repo

GT911 init error: Custom wiring on WaveShare 7 inch (BSP-273)

Pin mapping

I designed a custom PCB that connect the WaveShare 7 inch in the following pin mapping.

/* I2C */
#define BSP_I2C_SCL           (GPIO_NUM_47)
#define BSP_I2C_SDA           (GPIO_NUM_21)

/* Display */
#define BSP_LCD_WIDTH   (16)
#define BSP_LCD_DB0     (GPIO_NUM_12)
#define BSP_LCD_DB1     (GPIO_NUM_13)
#define BSP_LCD_DB2     (GPIO_NUM_10)
#define BSP_LCD_DB3     (GPIO_NUM_11)
#define BSP_LCD_DB4     (GPIO_NUM_46)
#define BSP_LCD_DB5     (GPIO_NUM_9)
#define BSP_LCD_DB6     (GPIO_NUM_8)
#define BSP_LCD_DB7     (GPIO_NUM_3)
#define BSP_LCD_DB8     (GPIO_NUM_17)
#define BSP_LCD_DB9     (GPIO_NUM_18)
#define BSP_LCD_DB10    (GPIO_NUM_41)
#define BSP_LCD_DB11    (GPIO_NUM_42)
#define BSP_LCD_DB12    (GPIO_NUM_39)
#define BSP_LCD_DB13    (GPIO_NUM_40)
#define BSP_LCD_DB14    (GPIO_NUM_37)
#define BSP_LCD_DB15    (GPIO_NUM_38)
#define BSP_LCD_CS      (GPIO_NUM_NC)
#define BSP_LCD_DC      (GPIO_NUM_4)
#define BSP_LCD_WR      (GPIO_NUM_36) 
#define BSP_LCD_RD      (GPIO_NUM_NC)
#define BSP_LCD_RST     (GPIO_NUM_35)
#define BSP_LCD_WAIT    (GPIO_NUM_48)
#define BSP_LCD_BL      (GPIO_NUM_NC)
#define BSP_LCD_TP_INT  (GPIO_NUM_45)

Error code

However, when I connect the PCB to the display. It gives out GT911 related error. It fails to initialize.

I (685) gpio: GPIO[35]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (685) gpio: GPIO[48]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (715) gpio: GPIO[45]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
E (715) lcd_panel.io.i2c: panel_io_i2c_rx_buffer(119): i2c transaction failed
E (725) GT911: touch_gt911_read_cfg(239): GT911 read error!
E (725) GT911: esp_lcd_touch_new_i2c_gt911(99): GT911 init failed
E (735) GT911: Error (0xffffffff)! Touch controller GT911 initialization failed!
I (745) gpio: GPIO[45]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0

assert failed: bsp_display_lock ws_7inch.c:386 (lvgl_mux && "bsp_display_start must be called first")

What I have tried

Pin are connected respectively

I made sure the pin on the WaveShare GT911 LCD are connected to the respective GPIO. I used a multimeter that beeps if it connects. Every pin is correct.

Is there any other thing I might miss?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.